Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: push auto-generated files directly instead of using PRs #2275

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a drive-by - I noticed the update-node-js workflow didn't trigger GHA workflow since it created a PR with the workflow 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
Loading