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

Dependabot and GH API access #248

Open
jnus opened this issue Mar 1, 2022 · 1 comment
Open

Dependabot and GH API access #248

jnus opened this issue Mar 1, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@jnus
Copy link

jnus commented Mar 1, 2022

Been running into some issues with this action and Dependabot PR's, when uploading the test result to the GH API. I've got a organization level token specified ,(ORG_GITHUB_TOKEN) as the REPO_TOKEN parameter, since Dependabot does not have access to GITHUB-TOKEN but get the following errror

Syntax

    - name: Parse Trx files
      uses: NasAmin/[email protected]
      id: trx-parser
      if: always()
      with:
        TRX_PATH: ${{ github.workspace }}/TestResults
        REPO_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}

Error

....
Creating PR check for ORBIT UNITTESTS
Creating status check for GitSha: c040653ee8bead3071fee97ac7d27f52[18](https://github.com/...api/runs/5380650173?check_suite_focus=true#step:7:18)6c681d on a pull request event
Check time is: Tue, 01 Mar 2022 [19](https://github.com/...api/runs/5380650173?check_suite_focus=true#step:7:19):09:12 GMT
Error: Resource not accessible by integration
....

Should Dependabot not be able to write to GH API with this?

@NasAmin
Copy link
Owner

NasAmin commented Mar 2, 2022

Hi @jnus

Thanks for opening an issue.

The issue you are seeing was introduced by GitHub to not allow access to workflow secrets to dependabot due to some security concerns on forked repositories.

However, this had affected normal repos even for orgs that don't allow forks.

GitHub now allows you to specify which permissions dependabot can get.
Docs: https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/

For reference, please checkout the test workflow from this repo.

Hope this helps.

@NasAmin NasAmin added the documentation Improvements or additions to documentation label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants