Skip to content

Commit c756bf5

Browse files
committed
Use app token - trigger PR event
1 parent ce4ecec commit c756bf5

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.github/workflows/sync-dev-to-vX.Y-dev.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ jobs:
1616
sync-branches:
1717
runs-on: ubuntu-latest
1818
steps:
19+
- name: Generate access token
20+
id: generate-token
21+
uses: actions/create-github-app-token@v2
22+
with:
23+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
24+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
25+
1926
- name: Checkout repository
2027
uses: actions/checkout@v4
2128
with:
@@ -41,5 +48,5 @@ jobs:
4148
--body "Merge \`$HEAD\` into \`$BASE\`."
4249
done
4350
env:
44-
GH_TOKEN: ${{ github.token }}
51+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
4552
HEAD: dev

.github/workflows/sync-main-to-dev.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ name: sync-main-to-dev
1010
on:
1111
push:
1212
branches:
13-
- main
13+
- main-sync
1414

1515
jobs:
1616
sync-branch:
1717
runs-on: ubuntu-latest
1818
steps:
19+
- name: Generate access token
20+
id: generate-token
21+
uses: actions/create-github-app-token@v2
22+
with:
23+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
24+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
25+
1926
- name: Checkout repository
2027
uses: actions/checkout@v4
2128

@@ -35,6 +42,6 @@ jobs:
3542
--title "$BASE: update from $HEAD" \
3643
--body "Merge \`$HEAD\` into \`$BASE\`."
3744
env:
38-
GH_TOKEN: ${{ github.token }}
39-
HEAD: main
45+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
46+
HEAD: main-sync
4047
BASE: dev

0 commit comments

Comments
 (0)