Skip to content

Commit 7c80b3d

Browse files
authored
Use app-generated access token
1 parent 404b210 commit 7c80b3d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/respec.yaml

+13-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ jobs:
2222
runs-on: ubuntu-latest
2323

2424
steps:
25+
- name: Generate access token
26+
id: generate-token
27+
uses: actions/create-github-app-token@v1
28+
with:
29+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
30+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
31+
owner: OAI
32+
repositories: OpenAPI-Specification
33+
2534
- uses: actions/checkout@v4 # checkout main branch
2635
with:
2736
fetch-depth: 0
@@ -35,8 +44,8 @@ jobs:
3544

3645
- uses: actions/checkout@v4 # checkout gh-pages branch
3746
with:
38-
token: ${{ secrets.OAS_REPO_TOKEN }}
39-
repository: OAI/OpenAPI-Specification # TODO: change to OAI/...
47+
token: ${{ steps.generate-token.outputs.token }}
48+
repository: OAI/OpenAPI-Specification
4049
ref: gh-pages
4150
path: deploy
4251

@@ -46,16 +55,14 @@ jobs:
4655
- name: Create Pull Request
4756
uses: peter-evans/create-pull-request@v7
4857
with:
49-
# A personal access token is required to push changes to the repository.
50-
# This token needs to be refreshed regularly and stored in the repository secrets.
51-
token: ${{ secrets.OAS_REPO_TOKEN }}
58+
token: ${{ steps.generate-token.outputs.token }}
5259
branch: update-overlay-respec-version
5360
base: gh-pages
5461
delete-branch: true
5562
path: deploy
5663
labels: Housekeeping
5764
team-reviewers: OAI/tsc
58-
title: Update ReSpec-rendered specification versions for Overlay
65+
title: Overlay - Update ReSpec-rendered specification versions
5966
commit-message: Update ReSpec-rendered specification versions
6067
signoff: true
6168
body: |

0 commit comments

Comments
 (0)