Skip to content

Fix GitHub Actions permissions for PR preview workflow #40

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

Merged
merged 1 commit into from
May 2, 2025

Conversation

ajeetraina
Copy link
Owner

This PR fixes the GitHub Actions workflow that was failing with the error: "The process '/usr/bin/git' failed with exit code 128".

Changes made:

  1. Added top-level permissions to the workflow:

    permissions:
      contents: write
      pull-requests: write
  2. Replaced personal_token with github_token in the actions-gh-pages step:

    github_token: ${{ secrets.GITHUB_TOKEN }}
  3. Downgraded checkout action from v3 to v2 for the cleanup job, which has fewer issues with permissions

These changes will allow the GitHub Actions workflow to properly access the repository and make commits to the gh-pages branch. The issue occurs because GitHub Actions needs explicit permissions to write to the repository.

Ref: actions/checkout#417

Copy link

github-actions bot commented May 2, 2025

🔍 PR Preview

Your PR preview has been deployed! View it live at:

👉 https://mcp.collabnix.com/pr-preview/pr-40/

This preview will update automatically when you push new changes to your PR.

github-actions bot pushed a commit that referenced this pull request May 2, 2025
@ajeetraina ajeetraina merged commit b2dc0dd into main May 2, 2025
6 of 7 checks passed
github-actions bot pushed a commit that referenced this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant