Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(pinner): Create issues-pinner.yml workflow #7056

Merged
merged 6 commits into from
Sep 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/issues-pinner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Issues pinner management

on:
issues:
types:
- "pinned"
- "unpinned"


permissions:
contents: none
issues: read

# This allows a subsequently queued workflow run to interrupt/wait for previous runs
concurrency:
# group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.run_id }} :: ${{ github.event.action }}'
# cancel-in-progress: true
group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.run_id }}'
cancel-in-progress: false

jobs:

if-pinned:
davorpa marked this conversation as resolved.
Show resolved Hide resolved
name: On pinning an issue

if: github.event.action == 'pinned'

permissions:
issues: write

runs-on: ubuntu-latest

steps:
- uses: actions-ecosystem/action-add-labels@v1
id: add-labels
with:
repo: ${{ github.repository }}
number: ${{ github.event.issue.number }}
labels: |
📌 pinned


if-unpinned:
name: On unpinning an issue

if: github.event.action == 'unpinned'

permissions:
issues: write

runs-on: ubuntu-latest

steps:
- uses: actions-ecosystem/action-remove-labels@v1
id: remove-labels
with:
repo: ${{ github.repository }}
number: ${{ github.event.issue.number }}
labels:
📌 pinned


reporter:
name: GitHub reporter

runs-on: ubuntu-latest

steps:
- run: |
echo "$INPUT_SUMMARY" >> $GITHUB_STEP_SUMMARY;
env:
INPUT_SUMMARY: ${{ format('Issue [\#{2}]({0}/{1}/issues/{2}) should be `{3}`.',
github.server_url, github.repository,
github.event.issue.number,
github.event.action) }}