Repository navigation
52 lines (48 loc) · 2.13 KB
/
Copy pathrelease-note-edited.yml
File metadata and controls
52 lines (48 loc) · 2.13 KB
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
46
47
48
49
50
51
52
name: Release note edited
# A pull request's release note is in its description (scripts/release-note-check.ts), and editing a
# description starts no CI run. So when the description changes after CI's run of the pull request's
# head has finished with its `release note` check failed or cancelled, this re-runs that run's failed
# jobs (scripts/release-note-edited.ts): the check reads the description again, and `verify` follows
# it. A failing check stops its own run (.github/actions/stop-on-failure), which cancels the check's
# job too, so a failed check most often reports cancelled. Nothing else runs again, since every
# other job of the run passed or is re-run only because it failed or was cancelled. While the run is
# still going, nothing is needed: the check runs last and reads the description then.
#
# Pull requests from this repository: a fork's token is read-only and cannot re-run. A maintainer
# re-runs a fork's failed jobs by hand.
on:
pull_request:
types: [edited]
permissions: {}
concurrency:
group: release-note-edited-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
rerun:
name: re-run the release note
if: >-
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.changes.body != null
runs-on: ubuntu-latest
timeout-minutes: 5 # seconds
permissions:
# To check out the script.
contents: read
# To read CI's runs and re-run one.
actions: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: scripts/release-note-edited.ts
sparse-checkout-cone-mode: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
no-cache: true
- name: Re-run CI's failed or cancelled release note on the pull request's head
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: bun scripts/release-note-edited.ts