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

Request: mention permission and action settings in docs #16

Open
multiplemonomials opened this issue Mar 9, 2025 · 1 comment
Open

Comments

@multiplemonomials
Copy link

multiplemonomials commented Mar 9, 2025

Hi! Thanks for making this action! I was able to get it working on my project, but I ran into a bit of issues due to changes that GitHub appears to have made in the last couple years.

First of all, actions do not appear to have push permission to the git repo by default any more. So, your action will run into an 'error 403' error on the last step when it tries to push the branch.

Luckily, this is easy to fix, by adding

permissions:
  contents: write

to the top level workflow yaml file. That grants it the write permission that it needs.

Second of all, it would be great to mention somewhere that this workflow needs the "Deploy from a branch" setting to be set under Settings > Pages in the repository. This is still the default, but is marked as legacy, and from the docs it isn't clear which method this action uses.

What worked for me was to set the setting like this:

Image

and then add

GH_PAGES_BRANCH: gh-pages

to the action env in the yaml file.

Maybe someday it would be cool to update this action so that it can deploy directly to pages, meaning that the pushing could be skipped and it would run a little faster. But with these settings it is working fine for me.

Anyway, hope this is helpful!

@nelsonjchen
Copy link
Owner

nelsonjchen commented Mar 9, 2025 via email

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

No branches or pull requests

2 participants