free-programming-books icon indicating copy to clipboard operation
free-programming-books copied to clipboard

ci(pinner): Create `issues-pinner.yml` workflow

Open davorpa opened this issue 3 years ago • 4 comments

What does this PR do?

For resources

Description

A workflow to monitor pin/unpin issue event types and add/remove state labels accordingly

Needs declare a new label: ~📌 pinned~ :pushpin: pinned

Resolves #7055

Workflow runs: - Tested with davorpa/free-programming-books#16 issue - https://github.com/davorpa/free-programming-books/actions/runs/2983767547 - https://github.com/davorpa/free-programming-books/actions/runs/2983768434 - https://github.com/davorpa/free-programming-books/actions/runs/2983769061 - https://github.com/davorpa/free-programming-books/actions/runs/2983769167

Checklist:

Follow-up

  • Check the status of GitHub Actions and resolve any reported warnings!

davorpa avatar Sep 03 '22 08:09 davorpa

do you know of another repo where this is done?

eshellman avatar Sep 05 '22 17:09 eshellman

any comments, @mohitsaxenaknoldus ?

eshellman avatar Sep 05 '22 17:09 eshellman

do you know of another repo where this is done?

Not directly. But workflow is easy to newbies. I apply some merged knowledges:

  • Base docs: actions-ecosystem/action-add-labels & actions-ecosystem/action-remove-labels & actions-ecosystem/action-size
  • Run jobs concurrently to take performance into account. Stack stragegy is used (FIFO), so new runs waits for those older
  • Security. Scoping permissions to what really needed. In general issues: read and no git/filesystem (content: none) access.
  • Supercharging workflows with summaries. https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/
  • It only affect to pin/unpin issue events image not PRs/commits

davorpa avatar Sep 05 '22 17:09 davorpa

A job cleanup is made. Instead have defined 3 jobs we have 3 steps. It seems go a bit faster

Tests over

  • https://github.com/davorpa/free-programming-books/issues/25#event-7380427646
  • Runs: pin https://github.com/davorpa/free-programming-books/actions/runs/3048725284, unpin https://github.com/davorpa/free-programming-books/actions/runs/3048728552

davorpa avatar Sep 13 '22 22:09 davorpa

please add a header comment in the code that describes the purpose of the action and exactly what it does.

eshellman avatar Sep 14 '22 13:09 eshellman

please add a header comment in the code that describes the purpose of the action and exactly what it does.

This workflow adds a label to an issue when is pinned and removes it when unpinned.

The label is enhanced with stale.yml workflow. Pinned issues never stales due to the label is declared as exemption

davorpa avatar Sep 14 '22 14:09 davorpa

This workflow adds a label to an issue when is pinned and removes it when unpinned.

The label is enhanced with stale.yml workflow. Pinned issues never stales due to the label is declared as exemption

that helps. now add it to the file

eshellman avatar Sep 14 '22 15:09 eshellman

that helps. now add it to the file

Done 01663e639ceb38b1d523bf99c5f75caf563a40e8

davorpa avatar Sep 14 '22 16:09 davorpa

Nice work

LuigiImVector avatar Sep 14 '22 16:09 LuigiImVector