-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Update Issues statuses on Release workflow
- Loading branch information
1 parent
7ce6461
commit ac4be0b
Showing
3 changed files
with
255 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Update Issues statuses on Release | ||
|
||
on: | ||
pull_request: | ||
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); |