-
Notifications
You must be signed in to change notification settings - Fork 154
45 lines (42 loc) · 1.53 KB
/
post-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
45
name: Post Release
on:
# Triggered manually
workflow_dispatch:
inputs:
versionNumber:
required: true
type: string
description: "If running this manually please insert a version number that corresponds to the latest published in the GitHub releases (i.e. v1.1.1)"
# Or triggered as result of a release
release:
types: [released]
permissions:
contents: read
jobs:
post_release:
permissions:
contents: read
issues: write
discussions: write
pull-requests: write
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ inputs.versionNumber }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get release version
run: |
# The code below does the following:
# 1. If the workflow was triggered manually, it will use the version number provided by the user
# 2. If the workflow was triggered by a release, it will use the version number of the release
if [ -z "$RELEASE_VERSION" ]; then
export RELEASE_VERSION=$(git describe --tags --abbrev=0)
fi
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Update issues related to release
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const post_release = require('.github/scripts/post_release.js')
await post_release({github, context, core})