-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (38 loc) · 1.25 KB
/
update_project_items_on_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Update Issues statuses on Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
context:
description: 'The simulated context of the release'
required: true
jobs:
update-issues-statuses:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.LE_BOT_APP_ID }}
private_key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
- name: Update Issues statuses
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const { updateReleasedItemsStatuses } = require('./.github/githubUtils.js');
let ghContext; // get context from input if its a workflow_dispatch event
if (context.payload.release) {
ghContext = context;
} else {
ghContext = context.payload.inputs.context;
ghContext = JSON.parse(ghContext);
}
updateReleasedItemsStatuses(ghContext, github);