Skip to content

ci: auto-close linked issues #6

ci: auto-close linked issues

ci: auto-close linked issues #6

Workflow file for this run

# Runs changelog related jobs.
# CI job heavily inspired by: https://github.com/tarides/changelog-check-action
name: auto-close
on:
pull_request:
types: [opened, reopened, edited]
jobs:
auto-close:
runs-on: ubuntu-latest
steps:
- name: Log stuff
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
linked_issue_id="$( gh api graphql -f query='
query($pr:ID!) {
node(id: $pr) {
... on PullRequest {
closingIssuesReferences(first:1, userLinkedOnly:false) {
totalCount
nodes {
id
}
}
}
}
}' -f pr=${{ github.event.pull_request.node_id }} --jq '.data.node.closingIssuesReferences.nodes[0].id')"
echo "ISSUE ID:"
echo "$linked_issue_id"