Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "Resource not accessible by integration" #948

Closed
2 of 5 tasks
RunningLeon opened this issue Mar 1, 2023 · 11 comments
Closed
2 of 5 tasks

Error "Resource not accessible by integration" #948

RunningLeon opened this issue Mar 1, 2023 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@RunningLeon
Copy link

Description:
Stale workflow failed when closing issues.

 Error: [#1728] Error when creating a comment: Resource not accessible by integration
  Error: [#1728] Error when adding a label: Resource not accessible by integration

log url: https://github.com/open-mmlab/mmdeploy/actions/runs/4301174276/jobs/7498093123#step:2:522
Action version:
stale v7

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

Expected behavior:
A description of what you expected to happen.

Actual behavior:
A description of what is actually happening.

@RunningLeon RunningLeon added bug Something isn't working needs triage labels Mar 1, 2023
@dsame dsame removed the needs triage label Mar 1, 2023
@dsame
Copy link
Contributor

dsame commented Mar 1, 2023

Hello @RunningLeon , thanks for your input we are starting to review the reported problem

@dsame dsame self-assigned this Mar 2, 2023
@dsame
Copy link
Contributor

dsame commented Mar 3, 2023

Hello @RunningLeon

can you please confirm you do not have custom github token for the repository?

From the log is the token does not have issues: write permission

GITHUB_TOKEN Permissions
  Contents: read
  Issues: read
  Metadata: read
  PullRequests: read

despite the proper permissions requested in the workflow file:

permissions:
  contents: write # only for delete-branch option
  issues: write
  pull-requests: write

@RunningLeon
Copy link
Author

@dsame Hi, thanks. But the github_token is set to have read/write permission in action settings
image

@dsame
Copy link
Contributor

dsame commented Mar 7, 2023

Hello @RunningLeon, can you please double check the enterprise to which the repo belongs to

image

does not have restricted polices:

  • In the enterprise account sidebar, click Policies.
  • Under " Policies", click Actions.
  • Under "Workflow permissions", choose whether you want the GITHUB_TOKEN to have read and write access for all scopes, or just read access

@dsame
Copy link
Contributor

dsame commented Mar 14, 2023

Hello @RunningLeon , this is a gentle remainder the issue is staled waiting for response and to be closed soon due to inactivity.

@dsame
Copy link
Contributor

dsame commented Mar 17, 2023

Hello @RunningLeon , i am closing the issue because of long inactivity, but please feel free to reopen it or create a new one in case problem still exists

@dsame dsame closed this as completed Mar 17, 2023
@RunningLeon
Copy link
Author

@dsame Hi, it appeared that once the pr is merged to the master branch, the permission for GITHUB_TOKEN works fine(with write permission for issues as set in workflow yaml). At PR stage, the permission is not right. But this github procedure is not right for some cases. For instance, we add a workflow that requires GITHUB_TOKEN to have write permission in a PR, but the workflow cannot run due to he permission at PR stage. So we don't know whether the code is good to merge to master branch.

@dsame
Copy link
Contributor

dsame commented Mar 23, 2023

Hello @RunningLeon , thanks for the additional info - it is really helpful and from it i see it is much better to ask this question in runner repo - its team is responsible for the described malfunction.

Do you want me to create the new issue there in behalf of you or you'd prefer to create it yourself?

@RunningLeon
Copy link
Author

Hi, thanks for your reply. Maybe I could create a new issue later.

@dsame
Copy link
Contributor

dsame commented Mar 26, 2023

The issue is closed due it relates to other repo.

@dsame dsame closed this as completed Mar 26, 2023
@ThulinaWickramasinghe
Copy link

ThulinaWickramasinghe commented Oct 20, 2024

I'm getting a similar issue. Following are the logs I get.

with:
    stale-pr-message: This PR has been marked stale because it has been open for 21 days with no activity.
    close-pr-message: This PR has been automatically closed since it has been in stale state for 7 days.
    days-before-stale: 21
    days-before-close: 7
    repo-token: ***
    stale-issue-label: Stale
    close-issue-reason: not_planned
    stale-pr-label: Stale
    exempt-all-milestones: false
    operations-per-run: [3](https://github.com/clubpay/customer-web-app/actions/runs/11423954871/job/31783719035#step:2:3)0
    remove-stale-when-updated: true
    debug-only: false
    ascending: false
    delete-branch: false
    exempt-all-assignees: false
    exempt-draft-pr: false
    enable-statistics: true
    ignore-updates: false
    include-only-assigned: false
The saved state was not found, the process starts from the first issue.
Starting the stale action process...
Error: Error: Getting issues was blocked by the error: Resource not accessible by integration
Error: Getting issues was blocked by the error: Resource not accessible by integration

This is how I've setup my action.

name: Close stale pull requests

permissions:
    pull-requests: write

on:
    schedule:
        - cron: '0 6 * * 0' # Every Sunday 6AM UTC

jobs:
    stale:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/stale@v9
              with:
                  stale-pr-message: 'This PR has been marked stale because it has been open for 21 days with no activity.'
                  close-pr-message: 'This PR has been automatically closed since it has been in stale state for 7 days.'
                  days-before-stale: 21
                  days-before-close: 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants