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

Permission denied on git push #75

Open
pgrange opened this issue May 3, 2023 · 1 comment
Open

Permission denied on git push #75

pgrange opened this issue May 3, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@pgrange
Copy link

pgrange commented May 3, 2023

I copy/pasted the first exemple from the README and see that it will always fail for a permission denied at the git push step.

Step to reproduce: copy/paste the exemple from the README and adjust it (here I point to version 19 of the action and I also activate the workflow when pushing on the dependencies_update branch:

name: update-flake-lock
on:
  push:
    branches:
      - dependencies_update
  workflow_dispatch: # allows manual triggering
  schedule:
    - cron: '0 0 * * 0' # runs weekly on Sunday at 00:00

jobs:
  lockfile:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Install Nix
        uses: DeterminateSystems/nix-installer-action@v1
      - name: Update flake.lock
        uses: DeterminateSystems/update-flake-lock@v19
        with:
          pr-title: "Update flake.lock" # Title of PR to be created
          pr-labels: |                  # Labels to be set on the PR
            dependencies
            automated

Then push and see the error in the action execution output:

Pushing pull request branch to 'origin/update_flake_lock_action'
  /usr/bin/git push --force-with-lease origin HEAD:refs/heads/update_flake_lock_action
  remote: Permission to pgrange/hydra.git denied to github-actions[bot].
  fatal: unable to access 'https://github.com/pgrange/hydra/': The requested URL returned error: 403
  Error: The process '/usr/bin/git' failed with exit code 128

Here is the full action output: job 8691097940

Here is the workflow file for this particular run: dependencies-update.yaml.

@pgrange
Copy link
Author

pgrange commented May 3, 2023

Changing the permissions of the Workflows in the repository settings fixed the issue.

I would suggest to explain that in the README:

  • Go to repository settings / Actions / general
  • In Workflow permissions:
    • give Read and write permission
    • Allow GitHub Actions to create and approve pull requests

Capture d’écran 2023-05-03 à 16 09 38

@cole-h cole-h added documentation Improvements or additions to documentation good first issue Good for newcomers labels May 3, 2023
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

2 participants