File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 1010 runs-on : ubuntu-latest
1111 steps :
1212 - uses : actions/github-script@v5
13+ id : main
1314 with :
1415 # PAT needed as the GITHUB_TOKEN won't be able to see cross-references from other orgs (matrix-org)
1516 github-token : ${{ secrets.ELEMENT_BOT_TOKEN }}
@@ -127,13 +128,7 @@ jobs:
127128
128129 // Duplicate was closed with wrong reason, fix it
129130 if (stateReason === "COMPLETED") {
130- await github.graphql(`mutation($id:ID!) {
131- closeIssue(input: { issueId:$id, stateReason:NOT_PLANNED }) {
132- clientMutationId
133- }
134- }`, {
135- id: context.payload.issue.node_id,
136- });
131+ core.setOutput("closeAsNotPlanned", "true");
137132 }
138133 } else {
139134 // This issue was closed, close all related rageshakes
@@ -146,3 +141,16 @@ jobs:
146141 });
147142 }
148143 }
144+ - uses : actions/github-script@v5
145+ name : Close duplicate as Not Planned
146+ if : steps.main.outputs.closeAsNotPlanned
147+ with :
148+ # We do this step separately, and with the default token so as to not re-trigger this workflow when re-closing
149+ script : |
150+ await github.graphql(`mutation($id:ID!) {
151+ closeIssue(input: { issueId:$id, stateReason:NOT_PLANNED }) {
152+ clientMutationId
153+ }
154+ }`, {
155+ id: context.payload.issue.node_id,
156+ });
You can’t perform that action at this time.
0 commit comments