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

Experiencing workflow run failures #88

Open
crabdancing opened this issue Oct 18, 2023 · 6 comments
Open

Experiencing workflow run failures #88

crabdancing opened this issue Oct 18, 2023 · 6 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@crabdancing
Copy link

crabdancing commented Oct 18, 2023

The repo in question can be found here.

I am new to Github workflows, so I've probably done something wrong here. Here is the error:
image

In text:

  remote: Permission to alxpettit/httm-flake.git denied to github-actions[bot].
  fatal: unable to access 'https://github.com/alxpettit/httm-flake/': The requested URL returned error: 403
@cole-h
Copy link
Member

cole-h commented Oct 18, 2023

Since you specified the permissions: block in your workflow, GitHub sets everything that you don't specify to read (or otherwise breaks all the not-explicitly-set permissions). Try playing with the permissions set there. I think maybe contents: write might make it work again?

@crabdancing
Copy link
Author

I got the same error before setting the permissions block, actually. But I'll try it :)

@crabdancing
Copy link
Author

Hmm, now I'm getting:

Create or update the pull request
  Attempting creation of pull request
  Error: GitHub Actions is not permitted to create or approve pull requests.

@cole-h
Copy link
Member

cole-h commented Oct 19, 2023

You might actually need pull-requests: write, and/or you might need to enable the setting on your repo that allows GitHub actions to create and approve PRs in Settings > Actions > General:

image

@sellout
Copy link

sellout commented Oct 22, 2023

I ran into this the other day, too. It seems like you need both

permissions:
  contents: write # to push the branch for the PR
  pull-requests: write # to open the PR

and checking that checkbox in Settings>Actions>General1.

These should probably be added to the docs.

Footnotes

  1. I use Probot’s Settings app. I’m not certain, but I think the corresponding settings.yml entry is

    actions:
      permissions:
        workflow:
          can_approve_pull_request_reviews: true
    

    See https://docs.github.com/en/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-an-organization

sellout added a commit to sellout/flaky that referenced this issue Oct 22, 2023
The documentation was missing some important bits.

See DeterminateSystems/update-flake-lock#88
@cole-h cole-h added documentation Improvements or additions to documentation good first issue Good for newcomers labels Oct 23, 2023
@crabdancing
Copy link
Author

crabdancing commented Oct 23, 2023

Oh, thank you @sellout! I'll keep this issue open to track the documentation issue, but my personal issue has been solved :)

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 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants