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(gh): add action to update changeset PR #2412

Merged
merged 3 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions .changeset/sweet-pens-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
46 changes: 46 additions & 0 deletions .github/workflows/update-changeset-prs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update Changeset PRs
schultzp2020 marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- 'changeset-release/**'

jobs:
update-and-commit-files:
name: Update and Commit Files
schultzp2020 marked this conversation as resolved.
Show resolved Hide resolved
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