Skip to content

Commit e18b314

Browse files
authored
chore(github-actions): updated workflows to use github-app token (#748)
* updated slack-ocwm-reminder.yml * updated ocwm-reminders.yml * updated ocwm-issue-collector.yml * updated ocwm-creator.yml * updated close-completed-ocwm.yml
1 parent 0335285 commit e18b314

File tree

5 files changed

+43
-6
lines changed

5 files changed

+43
-6
lines changed

.github/workflows/close-completed-ocwm.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ jobs:
1818
with:
1919
node-version: '20'
2020

21+
- name: Get Token
22+
uses: actions/create-github-app-token@v1
23+
id: get_workflow_token
24+
with:
25+
app-id: ${{ vars.APP_ID }}
26+
private-key: ${{ secrets.PRIVATE_KEY }}
27+
2128
- name: Install dependencies
2229
run: npm install @octokit/core@5.1.0
2330

2431
- name: Close issues
2532
env:
26-
MY_TOKEN: ${{ secrets.AUTH_TOKEN }}
33+
MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
2734
MY_LABEL: ${{ vars.OCWM_LABEL }}
2835
OWNER: ${{ vars.ORGANISATION }}
2936
REPO_NAMES: ${{ vars.REPOSITORIES }}

.github/workflows/ocwm-creator.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ jobs:
1717
uses: actions/setup-node@v4
1818
with:
1919
node-version: '20'
20+
21+
- name: Get Token
22+
uses: actions/create-github-app-token@v1
23+
id: get_workflow_token
24+
with:
25+
app-id: ${{ vars.APP_ID }}
26+
private-key: ${{ secrets.PRIVATE_KEY }}
27+
2028
- name: Set up Python
2129
uses: actions/setup-python@v5
2230
with:
@@ -34,15 +42,15 @@ jobs:
3442
title: ${{ steps.create-title.outputs.title }}
3543
content-filepath: .github/ISSUE_TEMPLATE/open_community_working_meeting.md
3644
labels: 'Working Meeting'
37-
token: ${{ secrets.AUTH_TOKEN }}
45+
token: ${{ steps.get_workflow_token.outputs.token }}
3846

3947
- name: Install dependencies
4048
run: npm install @octokit/core@5.1.0
4149

4250
- name: Update Issue Body
4351
uses: actions/github-script@v7
4452
env:
45-
MY_TOKEN: ${{ secrets.AUTH_TOKEN }}
53+
MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
4654
SLACK_WEBHOOK: ${{ vars.SLACK_WEBHOOK }}
4755
with:
4856
script: |

.github/workflows/ocwm-issue-collector.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ jobs:
1616
uses: actions/setup-node@v4
1717
with:
1818
node-version: '20'
19+
20+
- name: Get Token
21+
uses: actions/create-github-app-token@v1
22+
id: get_workflow_token
23+
with:
24+
app-id: ${{ vars.APP_ID }}
25+
private-key: ${{ secrets.PRIVATE_KEY }}
26+
1927
- name: Install dependencies
2028
run: npm install @octokit/core@5.1.0
2129
- name: Adding Issues
@@ -28,7 +36,7 @@ jobs:
2836
REPO_NAMES: ${{ vars.REPOSITORIES }}
2937
AGENDA_LABEL: ${{ vars.AGENDA_LABEL }}
3038
OCWM_LABEL: ${{ vars.OCWM_LABEL }}
31-
MY_TOKEN: ${{ secrets.AUTH_TOKEN }}
39+
MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
3240
with:
3341
script: |
3442
const octokit = require('@octokit/core').Octokit

.github/workflows/ocwm-reminders.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ jobs:
1818
with:
1919
node-version: '20'
2020

21+
- name: Get Token
22+
uses: actions/create-github-app-token@v1
23+
id: get_workflow_token
24+
with:
25+
app-id: ${{ vars.APP_ID }}
26+
private-key: ${{ secrets.PRIVATE_KEY }}
27+
2128
- name: Install dependencies
2229
run: npm install @octokit/core@5.1.0
2330

2431
- name: Send reminders
2532
uses: actions/github-script@v7
2633
env:
27-
MY_TOKEN: ${{ secrets.AUTH_TOKEN }}
34+
MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
2835
OWNER: ${{ vars.ORGANISATION }}
2936
REPO: 'community'
3037
OCWM_LABEL: ${{ vars.OCWM_LABEL }}

.github/workflows/slack-ocwm-reminder.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ jobs:
1616
with:
1717
node-version: '20'
1818

19+
- name: Get Token
20+
uses: actions/create-github-app-token@v1
21+
id: get_workflow_token
22+
with:
23+
app-id: ${{ vars.APP_ID }}
24+
private-key: ${{ secrets.PRIVATE_KEY }}
25+
1926
- name: Install dependencies
2027
run: npm install @octokit/core@5.1.0
2128

2229
- name: Send reminders
2330
uses: actions/github-script@v7
2431
env:
25-
MY_TOKEN: ${{ secrets.AUTH_TOKEN }}
32+
MY_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
2633
OWNER: ${{ vars.ORGANISATION }}
2734
REPO: 'community'
2835
OCWM_LABEL: ${{ vars.OCWM_LABEL }}

0 commit comments

Comments
 (0)