Skip to content

Commit b4627cf

Browse files
authored
Merge branch 'main' into changeset-release/main
2 parents 3dbde38 + f8348b6 commit b4627cf

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

.changeset/stupid-dogs-call.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/workflows/pr-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
yarn install
4141
4242
- name: Verify changesets
43-
if: github.actor != 'janus-idp[bot]'
43+
if: startsWith(github.ref_name, 'changeset-release/')
4444
run: |
4545
yarn changeset status --since=${{ github.event.pull_request.base.sha }}
4646

.github/workflows/release.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,18 @@ jobs:
2222
name: Release Packages
2323
runs-on: ubuntu-latest
2424
steps:
25-
- name: Checkout
26-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
27-
with:
28-
# don't persist the GITHUB_TOKEN so the release can use use the generated token
29-
persist-credentials: false
30-
3125
- name: Generate token
3226
id: generate-token
3327
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
3428
with:
3529
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }}
3630
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }}
3731

32+
- name: Checkout
33+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
34+
with:
35+
token: ${{ steps.generate-token.outputs.token }}
36+
3837
- name: Setup Node.js
3938
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
4039
with:

.github/workflows/update-changeset-prs.yaml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,40 @@ on:
66
- 'changeset-release/**'
77

88
jobs:
9+
prev-commit:
10+
name: Verify previous commit
11+
runs-on: ubuntu-latest
12+
outputs:
13+
valid: ${{ steps.prev-commit.outputs.valid }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
17+
18+
# We do not want an infinite loop; therefore, we are checking if the previous
19+
# commit was created by this action.
20+
- name: Get previous commit message
21+
id: prev-commit
22+
run: |
23+
echo "valid=$(if [[ $(git log -1 --pretty=%B HEAD) != 'chore: update yarn.lock' ]]; then echo 'true'; else echo 'false'; fi)" >> $GITHUB_OUTPUT
24+
925
update-and-commit-files:
1026
name: Update and commit files
27+
needs: prev-commit
28+
if: needs.prev-commit.outputs.valid == 'true'
1129
runs-on: ubuntu-latest
1230

13-
permissions:
14-
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
15-
contents: write
16-
1731
steps:
32+
- name: Generate token
33+
id: generate-token
34+
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
35+
with:
36+
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }}
37+
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }}
38+
1839
- name: Checkout
1940
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
2041
with:
21-
# Fetch the last 2 commits instead of just 1. (Fetching just 1 commit would overwrite the whole history)
22-
fetch-depth: 2
42+
token: ${{ steps.generate-token.outputs.token }}
2343

2444
- name: Setup Node.js
2545
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
@@ -31,17 +51,8 @@ jobs:
3151
# We want to commit the yarn.lock changes
3252
run: yarn install --no-immutable
3353

34-
- name: Get last commit message
35-
id: last-commit
36-
run: |
37-
echo "message=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
38-
echo "author=$(git log -1 --pretty=\"%an <%ae>\")" >> $GITHUB_OUTPUT
39-
4054
- name: Amend previous commit
4155
uses: stefanzweifel/git-auto-commit-action@v5
4256
with:
43-
commit_author: ${{ steps.last-commit.outputs.author }}
44-
commit_message: ${{ steps.last-commit.outputs.message }}
45-
commit_options: '--amend --no-edit'
46-
push_options: '--force'
47-
skip_fetch: true
57+
commit_message: 'chore: update yarn.lock'
58+
file_pattern: yarn.lock

0 commit comments

Comments
 (0)