Skip to content

Commit 3b4a023

Browse files
saikumarrsdependabot[bot]web-flow
authored
chore(release): merge release/4.0.3 into main (#49)
* chore: upgrade packages to latest versions and address vulnerabilities (#40) * chore: upgrade packages to latest versions and address vulnerabilities * chore: fix dependabot and overrides * chore(deps-dev): bump eslint-plugin-compat in the npm-dev-deps group (#41) Bumps the npm-dev-deps group with 1 update: [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat). Updates `eslint-plugin-compat` from 6.0.1 to 6.0.2 - [Release notes](https://github.com/amilajack/eslint-plugin-compat/releases) - [Changelog](https://github.com/amilajack/eslint-plugin-compat/blob/main/CHANGELOG.md) - [Commits](amilajack/eslint-plugin-compat@v6.0.1...v6.0.2) --- updated-dependencies: - dependency-name: eslint-plugin-compat dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-dev-deps ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: upgrade github actions to latest versions (#42) * chore(deps-dev): bump eslint-plugin-sonarjs from 2.0.3 to 3.0.2 (#43) Bumps [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS) from 2.0.3 to 3.0.2. - [Release notes](https://github.com/SonarSource/SonarJS/releases) - [Commits](https://github.com/SonarSource/SonarJS/commits) --- updated-dependencies: - dependency-name: eslint-plugin-sonarjs dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump eslint-config-prettier from 9.1.0 to 10.1.1 (#46) Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.1.0 to 10.1.1. - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](prettier/eslint-config-prettier@v9.1.0...v10.1.1) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump eslint from 8.57.0 to 9.24.0 (#47) * chore(deps-dev): bump eslint from 8.57.0 to 9.24.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.57.0 to 9.24.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.57.0...v9.24.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 9.24.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: upgrade eslint configuration --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sai Kumar Battinoju <[email protected]> * chore(release): 4.0.3 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Sai Kumar Battinoju <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sai Kumar Battinoju <[email protected]> Co-authored-by: GitHub actions <[email protected]>
2 parents 5b3da08 + f1b3334 commit 3b4a023

15 files changed

+3639
-4792
lines changed

.eslintignore

-8
This file was deleted.

.eslintrc.json

-46
This file was deleted.

.github/dependabot.yml

+22
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,25 @@ updates:
44
directory: '/'
55
schedule:
66
interval: 'weekly'
7+
target-branch: 'develop'
8+
9+
- package-ecosystem: 'npm'
10+
directory: '/'
11+
schedule:
12+
interval: 'weekly'
13+
target-branch: 'develop'
14+
groups:
15+
npm-prod-deps:
16+
patterns:
17+
- '*'
18+
update-types:
19+
- 'minor'
20+
- 'patch'
21+
dependency-type: 'production'
22+
npm-dev-deps:
23+
patterns:
24+
- '*'
25+
dependency-type: 'development'
26+
update-types:
27+
- 'minor'
28+
- 'patch'
+19-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
name: Create new hotfix branch
1+
name: Create a new hotfix branch
22

33
on:
44
workflow_dispatch:
55
inputs:
6-
hotfix_name:
7-
description: Hotfix branch name
6+
hotfix_branch_name:
7+
description: Hotfix branch name ('hotfix/' is automatically prepended)
88
required: true
99

1010
jobs:
1111
create-branch:
12-
name: Create new branch
12+
name: Create a new hotfix branch
1313
runs-on: ubuntu-latest
1414
if: github.ref == 'refs/heads/main'
1515
steps:
16-
- name: Create branch
17-
uses: peterjgrainger/[email protected]
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
- name: Checkout source code
17+
uses: actions/checkout@v4
2018
with:
21-
branch: 'hotfix/${{ github.event.inputs.hotfix_name }}'
19+
fetch-depth: 0
20+
21+
# In order to make a commit, we need to initialize a user.
22+
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
23+
- name: Initialize mandatory git config
24+
run: |
25+
git config user.name "GitHub actions"
26+
git config user.email [email protected]
27+
28+
- name: Create hotfix branch
29+
run: |
30+
chmod +x scripts/create-hotfix-branch.sh
31+
./scripts/create-hotfix-branch.sh "${{ github.event.inputs.hotfix_branch_name }}"

.github/workflows/deploy-npm.yml

+25-5
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,27 @@ jobs:
5151
5252
- name: Send message to Slack channel
5353
id: slack
54-
uses: slackapi/[email protected]
54+
continue-on-error: true
55+
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
5556
env:
56-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
5757
PROJECT_NAME: 'Gatsby Plugin'
5858
NPM_PACKAGE_URL: 'https://www.npmjs.com/package/gatsby-plugin-rudderstack'
59+
RELEASES_URL: 'https://github.com/rudderlabs/gatsby-plugin-rudderstack/releases/tag/v'
5960
with:
60-
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
61+
method: 'chat.postMessage'
62+
token: ${{ secrets.SLACK_BOT_TOKEN }}
63+
retries: rapid
64+
payload-templated: true
6165
payload: |
6266
{
67+
"channel": ${{ secrets.SLACK_RELEASE_CHANNEL_ID }},
68+
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S03SHJ20350>",
6369
"blocks": [
6470
{
6571
"type": "header",
6672
"text": {
6773
"type": "plain_text",
68-
"text": "New release: ${{ env.PROJECT_NAME }}"
74+
"text": "New Release: ${{ env.PROJECT_NAME }}"
6975
}
7076
},
7177
{
@@ -75,8 +81,22 @@ jobs:
7581
"type": "section",
7682
"text": {
7783
"type": "mrkdwn",
78-
"text": "*Release: <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}"
84+
"text": "*<${{ env.NPM_PACKAGE_URL }}|v${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S03SW7DM8P3>"
85+
},
86+
"accessory": {
87+
"type": "image",
88+
"image_url": "https://img.icons8.com/color/452/npm.png",
89+
"alt_text": "NPM Icon"
7990
}
91+
},
92+
{
93+
"type": "context",
94+
"elements": [
95+
{
96+
"type": "mrkdwn",
97+
"text": "For more details, check the full release notes <${{ env.RELEASES_URL }}${{ env.CURRENT_VERSION_VALUE }}|here>."
98+
}
99+
]
80100
}
81101
]
82102
}

.github/workflows/draft-new-release.yml

+27-7
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,30 @@ jobs:
7676
git push
7777
7878
- name: Create pull request into main
79-
uses: repo-sync/pull-request@v2
80-
with:
81-
source_branch: ${{ steps.create-release.outputs.branch_name }}
82-
destination_branch: 'main'
83-
github_token: ${{ secrets.PAT }}
84-
pr_title: 'chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main'
85-
pr_body: ':crown: *An automated PR*'
79+
env:
80+
GH_TOKEN: ${{ secrets.PAT }}
81+
run: |
82+
pr_title="chore(release): merge ${{ steps.create-release.outputs.branch_name }} into main"
83+
84+
# Create PR body with proper formatting
85+
cat > pr_body.md << EOF
86+
:crown: **Automated Release PR**
87+
88+
This pull request was created automatically by the GitHub Actions workflow. It merges the release branch (\`${{ steps.create-release.outputs.branch_name }}\`) into the \`main\` branch.
89+
90+
This ensures that the latest release branch changes are incorporated into the \`main\` branch for production.
91+
92+
### Details
93+
- **Release Version**: v${{ env.NEW_VERSION_VALUE }}
94+
- **Release Branch**: \`${{ steps.create-release.outputs.branch_name }}\`
95+
96+
---
97+
Please review and merge when ready. :rocket:
98+
EOF
99+
100+
# Create the PR using GitHub CLI
101+
gh pr create \
102+
--base main \
103+
--head ${{ steps.create-release.outputs.branch_name }} \
104+
--title "$pr_title" \
105+
--body-file pr_body.md

.github/workflows/housekeeping.yaml

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
name: Handle stale PRs
1+
name: Handle Stale PRs and Branches
22

33
on:
44
schedule:
5-
- cron: '42 1 * * *'
5+
- cron: '1 0 * * *' # every day at 00:01
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.sha }}
9+
cancel-in-progress: true
610

711
jobs:
812
prs:
9-
name: Clean up stale prs
13+
name: Clean up stale PRs
1014
runs-on: ubuntu-latest
1115

1216
permissions:
@@ -16,26 +20,28 @@ jobs:
1620
steps:
1721
- uses: actions/stale@v9
1822
with:
19-
repo-token: ${{ github.token }}
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
2024
operations-per-run: 200
21-
stale-pr-message: 'This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 10 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.'
25+
stale-pr-message: "Hello! This PR has been open for 20 days without any activity. Therefore, it's considered as stale and is scheduled to be closed in 10 days. If you're still working on this, please remove the 'Stale' label or add a comment to keep it open. Thanks for your contribution!"
2226
days-before-pr-stale: 20
2327
days-before-pr-close: 10
2428
stale-pr-label: 'Stale'
29+
ascending: true
2530

2631
branches:
27-
name: Cleanup old branches
32+
name: Clean up stale branches
2833
runs-on: ubuntu-latest
2934
steps:
3035
- name: Checkout repository
3136
uses: actions/checkout@v4
32-
33-
- name: Run delete-old-branches-action
34-
uses: beatlabs/[email protected]
3537
with:
36-
repo_token: ${{ github.token }}
37-
date: '2 months ago'
38-
dry_run: false
39-
delete_tags: false
40-
extra_protected_branch_regex: ^(main|develop)$
41-
exclude_open_pr_branches: true
38+
fetch-depth: 0
39+
40+
- name: Run branch cleanup script
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
chmod +x ./scripts/cleanup-old-branches.sh
45+
./scripts/cleanup-old-branches.sh \
46+
--months 2 \
47+
--protected-branches "^(main|develop)$"

.github/workflows/publish-new-release.yml

+42-29
Original file line numberDiff line numberDiff line change
@@ -52,49 +52,57 @@ jobs:
5252
npx conventional-github-releaser -p angular
5353
echo "DATE=$(date)" >> $GITHUB_ENV
5454
55-
- name: Create pull request into staging
56-
uses: repo-sync/pull-request@v2
57-
with:
58-
source_branch: 'main'
59-
destination_branch: 'develop'
60-
github_token: ${{ secrets.PAT }}
61-
pr_title: 'chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}'
62-
pr_body: ':crown: *An automated PR*'
63-
pr_reviewer: 'rudderlabs/js-sdk'
64-
65-
- name: Delete hotfix release branch
66-
uses: koj-co/delete-merged-action@master
67-
if: startsWith(github.event.pull_request.head.ref, 'hotfix-release/')
68-
with:
69-
branches: 'hotfix-release/*'
55+
- name: Create pull request into develop
56+
if: always()
57+
continue-on-error: true
7058
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
GH_TOKEN: ${{ secrets.PAT }}
60+
run: |
61+
pr_title="chore(release): merge main into develop after release v${{ steps.extract-version.outputs.release_version }}"
62+
63+
# Create PR body with proper formatting
64+
cat > pr_body.md << EOF
65+
:crown: **Automated Post-Release PR**
7266
73-
- name: Delete release branch
74-
uses: koj-co/delete-merged-action@master
75-
if: startsWith(github.event.pull_request.head.ref, 'release/')
76-
with:
77-
branches: 'release/*'
78-
env:
79-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
This pull request was created automatically by the GitHub Actions workflow. It merges changes from the \`main\` branch into the \`develop\` branch after a release has been completed.
68+
69+
This ensures that the \`develop\` branch stays up to date with all release-related changes from the \`main\` branch.
70+
71+
### Details
72+
- **Release Version**: v${{ steps.extract-version.outputs.release_version }}
73+
74+
---
75+
Please review and merge it before closing the release ticket. :rocket:
76+
EOF
77+
78+
# Create the PR using GitHub CLI
79+
gh pr create \
80+
--base develop \
81+
--head main \
82+
--title "$pr_title" \
83+
--body-file pr_body.md
8084
8185
- name: Send message to Slack channel
8286
id: slack
83-
uses: slackapi/slack-github-action@v1.27.0
87+
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
8488
env:
85-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
86-
PROJECT_NAME: 'Gatsby Rudderstack Plugin'
89+
PROJECT_NAME: 'Gatsby Plugin'
8790
RELEASES_URL: 'https://github.com/rudderlabs/gatsby-plugin-rudderstack/releases/'
8891
with:
89-
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
92+
method: 'chat.postMessage'
93+
token: ${{ secrets.SLACK_BOT_TOKEN }}
94+
retries: rapid
95+
payload-templated: true
9096
payload: |
9197
{
98+
"channel": ${{ secrets.SLACK_RELEASE_CHANNEL_ID }},
99+
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{env.RELEASES_URL}}${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S03SHJ20350>",
92100
"blocks": [
93101
{
94102
"type": "header",
95103
"text": {
96104
"type": "plain_text",
97-
"text": "New release: ${{ env.PROJECT_NAME }}"
105+
"text": "New Release: ${{ env.PROJECT_NAME }}"
98106
}
99107
},
100108
{
@@ -104,7 +112,12 @@ jobs:
104112
"type": "section",
105113
"text": {
106114
"type": "mrkdwn",
107-
"text": "*Release: <${{env.RELEASES_URL}}${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}"
115+
"text": "*<${{env.RELEASES_URL}}${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S03SHJ20350>"
116+
},
117+
"accessory": {
118+
"type": "image",
119+
"image_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
120+
"alt_text": "GitHub Icon"
108121
}
109122
}
110123
]

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
3636
- name: Fix filesystem paths in generated reports
3737
run: |
38-
sed -i 's+/home/runner/work/gatsby-plugin-rudderstack/gatsby-plugin-rudderstack+/github/workspace+g' reports/eslint.json
38+
sed -i 's+/home/runner/work/gatsby-plugin-rudderstack/gatsby-plugin-rudderstack++g' reports/eslint.json
3939
40-
- name: SonarCloud Scan
41-
uses: SonarSource/sonarcloud-github-action@master
40+
- name: SonarQube Scan
41+
uses: SonarSource/sonarqube-scan-action@aa494459d7c39c106cc77b166de8b4250a32bb97 # v5.1.0
4242
env:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)