dessant / lock-threads

GitHub Action that locks closed issues, pull requests and discussions after a period of inactivity
https://github.com/marketplace/actions/lock-threads
MIT License
313 stars 34 forks source link

Fails on access to resources #43

Closed DonBower closed 11 months ago

DonBower commented 1 year ago

Hi. I have a private repo, and this action always fails. I have tried with and without the github-token: statement with the same results.

I get this message with debug:

##[debug]Evaluating condition for step: 'Run dessant/lock-threads@v4.0.1'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run dessant/lock-threads@v4.0.1
##[debug]Loading inputs
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run dessant/lock-threads@v4.0.1
##[debug]Searching (issues)
Error: Validation Failed: {"message":"The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.","resource":"Search","field":"q","code":"invalid"}
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Run dessant/lock-threads@v4.0.1

My workflow yaml lock-threads.yml is simple:

---
name: "Lock Threads"
on:
  schedule:
    - cron: 30 00 * * *
jobs:
  lock:
    runs-on: ubuntu-latest
    steps:
      - name: Lock-Threads
        uses: dessant/lock-threads@v4.0.1
        with:
          github-token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
          issue-comment: >-
            I'm going to lock this issue because it has been closed for 30
            days. This helps our maintainers find and focus on the active
            issues. 

            If you have found a problem that seems similar to this,
            please open a new issue and complete the issue template so we can
            capture all the details necessary to investigate further.
          issue-inactive-days: "30"
          pr-comment: >-
            I'm going to lock this pull request because it has been closed for
            30 days. This helps our maintainers find and focus on the active
            issues. 

            If you have found a problem that seems related to this
            change, please open a new issue and complete the issue template so
            we can capture all the details necessary to investigate further.
          pr-inactive-days: "30"
dessant commented 11 months ago

I can't reproduce the issue in a private repository. Please let me know if the problem is present with a fresh account and repository, or if you figure out which GitHub option is triggering it.

This thread may also be of help: https://github.com/dessant/lock-threads/issues/27