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

Bump checkout to v3 and mention needed permissions #2038

Merged
merged 4 commits into from
Feb 14, 2023
Merged

Bump checkout to v3 and mention needed permissions #2038

merged 4 commits into from
Feb 14, 2023

Conversation

JeffFessler
Copy link
Contributor

My cleanup job kept failing and it took me a while to realize it was a repo permissions issue.
Hopefully having a brief note here will help others (and my future self).

@fredrikekre
Copy link
Member

I believe it should be possible to set the permissions only for this job, see e.g. https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#assigning-permissions-to-a-specific-job

@mortenpi
Copy link
Member

Yes, I think this should be sufficient?

permissions:
  contents: write

@JeffFessler
Copy link
Contributor Author

Ok, I updated the PR to list both options.
I have several of github actions that use GITHUB_TOKEN, like TagBot and CompatHelper and of course Documenter, so to me it seems easier just to give them all the write permissions using the repo settings. But I agree it is also worth explaining how to do it in the way that applies only to this job. If you prefer to emphasize the job-specific way, then we probably should update the example yaml file to include the permissions in it explicitly so that users can easily copy/paste that example and have it work.

docs/src/man/hosting.md Outdated Show resolved Hide resolved
@mortenpi
Copy link
Member

If you prefer to emphasize the job-specific way, then we probably should update the example yaml file to include the permissions in it explicitly so that users can easily copy/paste that example and have it work.

Actually, if you don't mind, that would be good. In my opinion, in general, you want the additional permissions to be as close to where you are using them. So I think we should suggest permissions: by default, but can also mention the repo-wide settings as an alternative.

@JeffFessler
Copy link
Contributor Author

Done. Feel free to reformat further if you really like those long lines. The problem with long lines (IMHO) is that they lead to big diffs in the repo when anyone changes one small part of a long line. See the current file diff where I changed "taken from" to "based on" - that tiny change causes a big diff. But it's up to you :)

@mortenpi
Copy link
Member

LGTM, thanks!

@mortenpi mortenpi merged commit fcd5ee2 into JuliaDocs:master Feb 14, 2023
@JeffFessler JeffFessler deleted the patch-1 branch February 14, 2023 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants