Skip to content

Commit 939d06f

Browse files
authored
Merge pull request #113 from OAI/workflows-with-app-token
Workflows with app-generated access token
2 parents f90ed11 + cbe01ff commit 939d06f

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

.github/workflows/respec.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@ jobs:
1919
respec:
2020
if: github.repository == 'OAI/Overlay-Specification'
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 # TODO: change to OAI/...
4049
ref: gh-pages
4150
path: deploy
@@ -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
57-
team-reviewers: OAI/tsc
58-
title: Update ReSpec-rendered specification versions for Overlay
64+
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl
65+
title: Overlay - Update ReSpec-rendered specification versions
5966
commit-message: Update ReSpec-rendered specification versions
6067
signoff: true
6168
body: |

.github/workflows/schema-publish.yaml

Lines changed: 13 additions & 6 deletions
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-overlay-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 Overlay Schema Iterations
60+
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl
61+
title: Overlay - Publish Schema Iterations
5562
commit-message: New Overlay schema iterations
5663
signoff: true
5764
body: |

0 commit comments

Comments
 (0)