Skip to content

Commit 5221c9d

Browse files
committed
add issues-pinner.yml workflow
1 parent 4722aba commit 5221c9d

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/labels.yml

+8
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@
4040
- name: "github-actions"
4141
description: "Affected resources are part of some GitHub Actions workflow"
4242
color: "0052cc"
43+
44+
#
45+
# issues-pinner.yml
46+
#
47+
48+
- name: "📌 pinned"
49+
description: "Issues that are pinned currently"
50+
color: "0e8a16"

.github/workflows/issues-pinner.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Issues pinner management
2+
3+
on:
4+
issues:
5+
types:
6+
- "pinned"
7+
- "unpinned"
8+
9+
permissions:
10+
# no checkouts needed
11+
contents: none
12+
# needed by "action-add-labels / action-remove-labels" to CRUD issue labels
13+
issues: write
14+
15+
# This allows a subsequently queued workflow run to interrupt/wait for previous runs
16+
concurrency:
17+
# group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.run_id }} :: ${{ github.event.action }}'
18+
# cancel-in-progress: true
19+
group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.run_id }}'
20+
cancel-in-progress: false
21+
22+
jobs:
23+
24+
labeler:
25+
name: Pushpin Labeler
26+
permissions:
27+
issues: write
28+
runs-on: ubuntu-latest
29+
steps:
30+
31+
- name: Add pushpin label on pinning an issue
32+
if: github.event.action == 'pinned'
33+
uses: actions-ecosystem/action-add-labels@v1
34+
with:
35+
repo: ${{ github.repository }}
36+
number: ${{ github.event.issue.number }}
37+
labels: |
38+
📌 pinned
39+
40+
- name: Remove pushpin label on unpinning an issue
41+
if: github.event.action == 'unpinned'
42+
uses: actions-ecosystem/action-remove-labels@v1
43+
with:
44+
repo: ${{ github.repository }}
45+
number: ${{ github.event.issue.number }}
46+
labels: |
47+
📌 pinned
48+
49+
- name: GitHub reporter
50+
# run even previous steps fails
51+
if: always()
52+
run: |
53+
echo "$INPUT_SUMMARY" >> $GITHUB_STEP_SUMMARY;
54+
env:
55+
INPUT_SUMMARY: ${{ format('Issue [\#{2}]({0}/{1}/issues/{2}) should be `{3}`.',
56+
github.server_url, github.repository,
57+
github.event.issue.number,
58+
github.event.action) }}

0 commit comments

Comments
 (0)