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

Add a label when closing an issue. #2

Open
hjdhjd opened this issue Oct 10, 2020 · 2 comments
Open

Add a label when closing an issue. #2

hjdhjd opened this issue Oct 10, 2020 · 2 comments

Comments

@hjdhjd
Copy link

hjdhjd commented Oct 10, 2020

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.

@swalkinshaw
Copy link
Member

Good idea 👍 do you want to try contributing this?

@joey-ma
Copy link

joey-ma commented Dec 23, 2022

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 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants