-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gh): add action to update changeset PR (#2412)
* chore(gh): add action to update changeset PR Signed-off-by: Paul Schultz <pschultz@pobox.com> * Update .github/workflows/update-changeset-prs.yaml Co-authored-by: Nick Boldt <nboldt@redhat.com> * Update .github/workflows/update-changeset-prs.yaml Co-authored-by: Nick Boldt <nboldt@redhat.com> --------- Signed-off-by: Paul Schultz <pschultz@pobox.com> Co-authored-by: Nick Boldt <nboldt@redhat.com>
- Loading branch information
1 parent
12074f9
commit f7c6b86
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Update changeset PRs (yarn lock regen) | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'changeset-release/**' | ||
|
||
jobs: | ||
update-and-commit-files: | ||
name: Update and commit files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Generate token | ||
id: generate-token | ||
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3 | ||
with: | ||
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | ||
with: | ||
node-version: '.nvmrc' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
# We want to commit the yarn.lock changes | ||
run: yarn install --no-immutable | ||
|
||
- name: Commit changes | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
run: | | ||
git config user.name 'janus-idp[bot]' | ||
git config user.email '41898282+janus-idp[bot]@users.noreply.github.com' | ||
git add yarn.lock | ||
if [[ -n $(git status --porcelain) ]]; then | ||
git commit -m 'chore: update yarn.lock' | ||
git push origin HEAD:${{ github.ref }} | ||
fi |