Skip to content

Commit

Permalink
chore: push auto-generated files directly instead of using PRs (#2275)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev authored Nov 22, 2024
1 parent 8bf4c46 commit 528b95f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/cron-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ 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: |
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:
Expand All @@ -44,7 +45,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: |
Expand Down Expand Up @@ -73,20 +74,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 --no-allow-empty -m "chore: update auto-generated files" || true
git push
14 changes: 6 additions & 8 deletions .github/workflows/update-node-js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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"

- name: Setup git
run: |
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
cache: "npm"

- name: Install [email protected]
run: |
Expand All @@ -38,16 +38,14 @@ 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'
title: "chore: update node.js"
body: |
- Update node.js

0 comments on commit 528b95f

Please sign in to comment.