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

Support the "not planned" state reason (when available) #744

Closed
spenserblack opened this issue May 29, 2022 · 4 comments · Fixed by #764
Closed

Support the "not planned" state reason (when available) #744

spenserblack opened this issue May 29, 2022 · 4 comments · Fixed by #764
Labels
enhancement New feature or request

Comments

@spenserblack
Copy link

Apologies if this duplicates anything, but I didn't see this mentioned in the README or any issues.

The problem

GitHub Issues can now have a state reason (why they were closed). Currently, actions/stale closes as complete, and it doesn't look like there is an input to change that behavior.

I'm not sure if this has been released for the REST API yet, but it's at least planned. I'm wondering if, when it is available in the API, there are plans for this action to support it.

The solution

When it's available via the API, perhaps a close-issue-reason input, which defaults to "complete" to keep the current behavior, but also allows "not planned" input.

@spenserblack spenserblack added the enhancement New feature or request label May 29, 2022
@spenserblack spenserblack changed the title Support the "not planned" state reason (when planned) Support the "not planned" state reason (when available) May 29, 2022
@parkerbxyz
Copy link
Contributor

parkerbxyz commented Jun 1, 2022

When it's available via the API, perhaps a close-issue-reason input, which defaults to "complete" to keep the current behavior, but also allows "not planned" input.

I think this action should close stale issues as not planned by default, with an option to close as complete if desired. 🙂

The help text for close as not planned even mentions stale as a reason to choose that option:

image

Perhaps an option like close-as-complete could be used, with a default value of false:

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v4
        with:
          close-as-complete: true # default: false

A more future-proof option might be something like state-reason or reason-closed, with a default value of not-planned:

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v4
        with:
         state-reason: complete # default: not-planned

@spenserblack
Copy link
Author

Update

REST API, GraphQL API and webhook support for closed issue reasons.

@Bo98
Copy link

Bo98 commented Jun 5, 2022

I see a way to do it via GraphQL (via a dedicated closeIssue mutation rather than updateIssue) but I don't see a way via REST API unless the documentation is not updated?

@jtbandes
Copy link
Contributor

jtbandes commented Jun 23, 2022

I manually tested the REST API and found that passing state_reason: "not_planned" works to close an issue as not planned. The opposite is state_reason: "completed". I made a PR for this here: #764

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

Successfully merging a pull request may close this issue.

4 participants