From d613b3ebf162b6bea63ef3c55e40f44d5755b509 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 22 Nov 2024 12:17:44 +0100 Subject: [PATCH 1/5] chore: move auto-generated files update to direct pushes instead of PRs --- .github/workflows/cron-tasks.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cron-tasks.yml b/.github/workflows/cron-tasks.yml index 18886cc6c..80e330050 100644 --- a/.github/workflows/cron-tasks.yml +++ b/.github/workflows/cron-tasks.yml @@ -24,8 +24,8 @@ jobs: - name: Set up Git run: | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" + git config --local user.email "devtoolsbot@users.noreply.github.com" + git config --local user.name "devtoolsbot" - uses: actions/setup-node@v4 with: @@ -44,7 +44,7 @@ jobs: - name: Update THIRD_PARTY_NOTICES.md run: | npm run update-third-party-notices - git commit --no-allow-empty -m "chore: update THIRD_PARTY_NOTICES" THIRD_PARTY_NOTICES.md || true + git add THIRD_PARTY_NOTICES.md - name: Update AUTHORS run: | @@ -73,20 +73,7 @@ jobs: npm run update-cli-usage-text packages/*/*.md *.md git add packages/*/*.md *.md - - name: Create pull request - id: cpr - uses: peter-evans/create-pull-request@v6 - with: - commit-message: Update auto-generated files - branch: ci/cron-tasks-update-files - title: "chore: update auto-generated files" - body: | - - Update auto-generated files - - - name: Merge PR - env: - PULL_REQUEST_NUMBER: ${{steps.cpr.outputs.pull-request-number}} - # NOTE: we don't use a PAT so to not trigger further automation - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Commit and push run: | - gh pr merge $PULL_REQUEST_NUMBER --squash --delete-branch + git commit -m "chore: update auto-generated files" + git push From 57c2e168467203b71f6799e2624a1878c3687374 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 22 Nov 2024 12:18:59 +0100 Subject: [PATCH 2/5] Don't allow empty commits --- .github/workflows/cron-tasks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron-tasks.yml b/.github/workflows/cron-tasks.yml index 80e330050..a531c6356 100644 --- a/.github/workflows/cron-tasks.yml +++ b/.github/workflows/cron-tasks.yml @@ -75,5 +75,5 @@ jobs: - name: Commit and push run: | - git commit -m "chore: update auto-generated files" + git commit --no-allow-empty -m "chore: update auto-generated files" || true git push From 626cd7a65f07c98f426e2b58fd7ce40c7246f2f5 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 22 Nov 2024 12:22:01 +0100 Subject: [PATCH 3/5] Use the devtoolsbot token --- .github/workflows/cron-tasks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cron-tasks.yml b/.github/workflows/cron-tasks.yml index a531c6356..2acd4159a 100644 --- a/.github/workflows/cron-tasks.yml +++ b/.github/workflows/cron-tasks.yml @@ -21,6 +21,7 @@ jobs: # this is important so git log can pick up on # the whole history to generate the list of AUTHORS fetch-depth: "0" + token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }} - name: Set up Git run: | From d6dd38519c26cd4c4307cb04b84f186a44a369ed Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 22 Nov 2024 12:26:42 +0100 Subject: [PATCH 4/5] Use the devtoolsbot token for update-node-js workflow --- .github/workflows/update-node-js.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-node-js.yaml b/.github/workflows/update-node-js.yaml index 201e8553a..220bec29d 100644 --- a/.github/workflows/update-node-js.yaml +++ b/.github/workflows/update-node-js.yaml @@ -18,7 +18,8 @@ jobs: # this is important so git log can pick up on # the whole history to generate the list of AUTHORS - fetch-depth: '0' + fetch-depth: "0" + token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }} - name: Setup git run: | @@ -28,7 +29,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 16.x - cache: 'npm' + cache: "npm" - name: Install npm@8.19.4 run: | @@ -46,8 +47,8 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - commit-message: 'chore: update node.js' + commit-message: "chore: update node.js" branch: ci/update-node-js-versions - title: 'chore: update node.js' + title: "chore: update node.js" body: | - Update node.js From 649b412bf25ec539ebebad95e7332e288683c2a6 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 22 Nov 2024 12:34:35 +0100 Subject: [PATCH 5/5] clean up update node workflow --- .github/workflows/update-node-js.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-node-js.yaml b/.github/workflows/update-node-js.yaml index 220bec29d..c30ebe4ec 100644 --- a/.github/workflows/update-node-js.yaml +++ b/.github/workflows/update-node-js.yaml @@ -19,7 +19,6 @@ jobs: # this is important so git log can pick up on # the whole history to generate the list of AUTHORS fetch-depth: "0" - token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }} - name: Setup git run: | @@ -39,15 +38,13 @@ jobs: run: | npm run update-node-js-versions npm run update-evergreen-config - git add . - git commit --no-allow-empty -m "chore: update node.js version" || true - name: Create Pull Request id: cpr - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "chore: update node.js" + token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }} + commit-message: "chore: update node.js version" branch: ci/update-node-js-versions title: "chore: update node.js" body: |