Skip to content

Commit e2b8bae

Browse files
Merge pull request #302 from OAI/workflows-with-app-token
Workflows with app-generated access token
2 parents 0615263 + a32e593 commit e2b8bae

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

.github/workflows/respec.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@ on:
1919
jobs:
2020
respec:
2121

22-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-22.04
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,7 +44,7 @@ jobs:
3544

3645
- uses: actions/checkout@v4 # checkout gh-pages branch
3746
with:
38-
token: ${{ secrets.OAS_REPO_TOKEN }}
47+
token: ${{ steps.generate-token.outputs.token }}
3948
repository: OAI/OpenAPI-Specification
4049
ref: gh-pages
4150
path: deploy
@@ -48,13 +57,13 @@ jobs:
4857
- name: Create Pull Request
4958
uses: peter-evans/create-pull-request@v6
5059
with:
51-
token: ${{ secrets.OAS_REPO_TOKEN }}
60+
token: ${{ steps.generate-token.outputs.token }}
5261
branch: update-arazzo-respec-version
5362
base: gh-pages
5463
delete-branch: true
5564
path: deploy
5665
labels: Housekeeping
57-
reviewers: darrelmiller,webron,earth2marsh,webron,lornajane,mikekistler,miqui,handrews,karenetheridge # ralfhandl
66+
reviewers: darrelmiller,webron,earth2marsh,webron,lornajane,mikekistler,miqui,handrews,karenetheridge,ralfhandl
5867
title: Arazzo - Update ReSpec-rendered specification versions
5968
commit-message: Update ReSpec-rendered specification versions
6069
signoff: true

.github/workflows/schema-publish.yaml

+13-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21+
- name: Generate access token
22+
id: generate-token
23+
uses: actions/create-github-app-token@v1
24+
with:
25+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
26+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
27+
owner: OAI
28+
repositories: OpenAPI-Specification
29+
2130
- uses: actions/checkout@v4 # checkout main branch
2231
with:
2332
fetch-depth: 0
@@ -31,7 +40,7 @@ jobs:
3140

3241
- uses: actions/checkout@v4 # checkout gh-pages branch
3342
with:
34-
token: ${{ secrets.OAS_REPO_TOKEN }}
43+
token: ${{ steps.generate-token.outputs.token }}
3544
repository: OAI/OpenAPI-Specification
3645
ref: gh-pages
3746
path: deploy
@@ -42,16 +51,14 @@ jobs:
4251
- name: Create Pull Request
4352
uses: peter-evans/create-pull-request@v7
4453
with:
45-
# A personal access token is required to push changes to the repository.
46-
# This token needs to be refreshed regularly and stored in the repository secrets.
47-
token: ${{ secrets.OAS_REPO_TOKEN }}
54+
token: ${{ steps.generate-token.outputs.token }}
4855
branch: publish-arazzo-schema-iteration
4956
base: gh-pages
5057
delete-branch: true
5158
path: deploy
5259
labels: Housekeeping,Schema
53-
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,handrews
54-
title: Publish Arazzo Schema Iterations
60+
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl
61+
title: Arazzo - Publish Schema Iterations
5562
commit-message: New Arazzo schema iterations
5663
signoff: true
5764
body: |

0 commit comments

Comments
 (0)