issue-closer-action icon indicating copy to clipboard operation
issue-closer-action copied to clipboard

Add a label when closing an issue.

Open hjdhjd opened this issue 5 years ago • 2 comments

Summary

Once issue-closer-action has determined that an issue should be closed, it would be helpful if it also had an option to also add a label to the issue.

Motivation

It would improve sorting through closed issues at a glance, particularly in higher-trafficked repos.

Additional context

None needed.

hjdhjd avatar Oct 10 '20 21:10 hjdhjd

Good idea 👍 do you want to try contributing this?

swalkinshaw avatar Oct 29 '20 20:10 swalkinshaw

2 years have passed, and here I am thinking the same thing!

I'd be happy to take a look, except I am pretty new to this and am just exploring GitHub Actions. I'm not familiar with how I can test it on my own, so feedback is greatly appreciated! @swalkinshaw @hjdhjd

So far, combining my intuition and findings from resources below:

  1. workflow Annotations (logs) Unexpected input(s) 'close-issue-reason', 'close-issue-label', valid inputs are ['issue-close-message', 'issue-pattern', 'pr-close-message', 'pr-pattern', 'repo-token']
  2. close-issue-label from List of input options of GitHub Action's Close Stale Issues workflow actions/[email protected]
  3. Template starter-workflow from Github Actions manual.yml

I'm guessing I'd go to action.yml, under inputs, add another optional input close-issue-label with properties description and required, like so:

  close-issue-label:
    description: Label to apply on closed issues
    required: false

Inside YOUR_WORKFLOW.yml, add permissions to follow runs-on:

    runs-on: ubuntu-latest # existing line
    permissions:
      issues: write
    steps: # existing line

Thanks 🙏🏻

joey-ma avatar Dec 23 '22 19:12 joey-ma