Deny
- Alpha
In the Denied
state, we know that the issue has been denied and there is no
further action to take. This is one of the first states in the workflow where we
can perform an unguarded transition.
In our repository workflow, a request is transitioned to the Denied
state when
an authorized user comments on the request with .deny
. However, immediately
after reaching this state, we want to close the issue (moving it to the Closed
state). This is called an unguarded transition because there is no condition
that must be met before the transition occurs.
The actual implementation of this transition is up to you! There are a few recommendations to keep in mind:
completed
may be
misleading. Consider not_planned
instead.When a new repository request is denied, we want to close the issue and leave a comment for the user. We should also add an appropriate label so we know the request was closed as denied.
# This job is responsible for handling denied requests.deny:name: Deny Requestruns-on: ubuntu-latest# Only run after validation has completed.needs: validatesteps:- name: Deny Commandid: denyuses: github/command@vX.X.Xwith:allowed_contexts: issueallowlist: octo-org/approversallowlist_pat: ${{ secrets.MY_TOKEN }}command: .deny# Comment on the issue to let the user know their request was denied.- if: ${{ steps.deny.outputs.continue == 'true' }}name: Post Commentid: commentuses: peter-evans/create-or-update-comment@vX.X.Xwith:issue-number: ${{ github.event.issue.number }}body:':no_entry_sign: This request has been denied! This issue will beclosed shortly.'# Close the issue.- if: ${{ steps.deny.outputs.continue == 'true' }}name: Close Issueid: closerun: gh issue close ${{ github.event.issue.number }} --reason not_planned
Your IssueOps workflow is officially complete! For the complete workflow files,
check out the
new-repository-request-example
directory.