Repository navigation
60 lines (55 loc) · 3.21 KB
/
Copy pathissue-dependencies.yml
File metadata and controls
60 lines (55 loc) · 3.21 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
53
54
55
56
57
58
59
60
name: Issue dependencies
# Keeps the `blocked` label in step with each issue's native "Blocked by" links (the rules live in
# tools/issue_dependencies.py and CONTRIBUTING.md, "Dependencies between issues"):
# - an open issue with a blocker that is not closed as completed gets `blocked`;
# - every other issue loses it, with one comment when an open issue is unblocked, and so does a pull request;
# - a blocker closed as not planned or as a duplicate leaves the issue blocked and asks a maintainer to re-plan it;
# - every open pull request whose "Issue dependencies" check no longer matches its linked issues (red although
# they are unblocked, or green although one became blocked) gets that check re-run.
#
# GitHub sends no workflow event when a "Blocked by" link is added or removed, so this runs when an issue is closed
# or reopened (what unblocks or re-blocks its dependents), every 15 minutes as the backstop for link edits (off the
# hour, when GitHub's scheduler is busiest), and on demand.
# Every run is a full reconciliation of state, not a reaction to a transition, so the concurrency group may drop a
# pending run, and a run that fails half-way is finished by the next one. tests/test_issue_dependencies.py pins:
# - the token holds `contents: read`, `issues: write`, `pull-requests: read`, `checks: read` and `actions: write`,
# nothing else;
# - no `${{ }}` appears in a `run:` line; the script reads the environment itself;
# - the checkout takes the default branch, one file, no stored credentials, pinned to a full commit SHA.
#
# Maintainers: to stop it, open Actions > "Issue dependencies" > the "..." menu > "Disable workflow". The links
# stay; only the label stops following them.
on:
issues:
types: [closed, reopened]
schedule:
- cron: "2,17,32,47 * * * *"
workflow_dispatch:
permissions: {}
concurrency:
group: issue-dependencies
cancel-in-progress: false
jobs:
sync:
# This repository, and only its default branch: a manual run started from another branch would check out that
# branch's copy of the script with this job's write token. After a rename or a transfer the guard must name the
# new repository, or the sync stops without a word (MAINTAINERS.md, "Repository automation").
if: ${{ github.repository == 'HodeTech/ForgeLM' && github.ref == 'refs/heads/development' }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read # the checkout reads one script from the default branch
issues: write # add or remove `blocked` / `needs-triage`, and post the notices
pull-requests: read # read the open pull requests and the issues they link
checks: read # read each one's latest "Issue dependencies" result
actions: write # re-run that check when the result no longer matches
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: tools/issue_dependencies.py
sparse-checkout-cone-mode: false
- name: Bring the blocked label in step with the Blocked-by links
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python3 tools/issue_dependencies.py sync