I would like to automatically close the issue once it is created. For this I referred to Actions marketplace and this action. Currently my code in YAML file looks like below. GitHub token is saved in Actions >> Secrets sections, and it is Private repository. Every time I run below code I am receiving this error GraphQL: Could not resolve to an issue or pull request with the number of 1. (repository.issue). I do not understand why workflow is complaining about Could not resolve an issue? Any setting I need to perform in my GitHub repo for issue to be close automatically?
name: CI
on:
issues:
types:
- opened
jobs:
titlePrefixCheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set repo
run: gh repo set-default user/private-repo
- name: Close Issue
run: gh issue close --comment "Auto-closing issue" "1"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
