Skip to content

Update Issues statuses on Release #4

Update Issues statuses on Release

Update Issues statuses on Release #4

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);