Skip to content

Improve examplary YAML file and correct typos #83

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 6 commits into from
Jan 8, 2024

Conversation

jakobarendt
Copy link
Contributor

For GitHub pages, the publish action needs write access to the contents of the repository. This can be achieved via changing the settings for actions workflows in the repository's settings from the default read only to write. However, this change in settings then holds for all workflow YAML-files of the repository.

Alternatively, one can set such permissions for each job in the workflow YAML-files individually. For the examplary YAML file, I propose this approach, as it prevents giving permissions to other GitHub Actions workflow jobs unintendedly. Additionally, I modify the documentation to account for the change in the examplary workflow YAML-file.

The second commit records some changes to the main README.md that correct typos and improve relative links.

Cheers,
Jakob

@cderv
Copy link
Collaborator

cderv commented Jul 4, 2023

Thanks a lot @jakobarendt .

Is this permissions setting to be required in the YAML workflow file new ?

I was sure this was working without it. Can we link to a blog post or related doc on this ? This is Github specific and it would help to send users to the correct reference so that they know what they are configuring.

Thank you

@jakobarendt
Copy link
Contributor Author

jakobarendt commented Jul 4, 2023

Yes, to my knowledge, a permission is required when using the Quarto publish action for GitHub Pages – either with a job-specific permission in the YAML workflow file itself (my suggestion) or with a write permission in the repository's setting that would then apply to all of its YAML workflow files.

To be honest, I have not (yet) published anything on the topic. I basically discovered it while debugging unsuccessful workflow runs during the setup of my master's thesis repo. The corresponding log file of the run, after which I accounted for all other potential sources of failure, gave (at least to me) an indication in L62 and L63 that it is an issue of unsufficient permissions:

remote: Permission to jakobarendt/mathesis-depop.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/jakobarendt/mathesis-depop/': The requested URL returned error: 403

To me, this need for a write permission also seems intuitive as the workflow run needs to render and commit the content files to the gh-pages branch underlying the GitHub Page – otherwise, I do not see how the published website could reflect any changes in the content of the .qmd files.

@jakobarendt
Copy link
Contributor Author

@mcanouil and @t-kalinowski might be good reviewers for my suggestions since they contributed to the guide page about publishing with GitHub pages. On the guide page, the examplary YAMLs already contain the changes that I propose.

@mcanouil wrote a paragraph about setting permissions in the repository's settings and @t-kalinowski specifically added the permissions to the examplary YAMLs.

@mcanouil
Copy link
Contributor

mcanouil commented Jul 4, 2023

To check more thoroughly the required permissions, we can use https://github.com/GitHubSecurityLab/actions-permissions.

To note, Quarto documentation on publishing to GitHub Pages needs some update, see:

@mcanouil
Copy link
Contributor

The related "epic":

@mcanouil
Copy link
Contributor

@jakobarendt we'll review this in parallel to as we'll work on the documentation to have consistency.
Thanks again for the PR.

@cderv cderv merged commit d64c8b0 into quarto-dev:main Jan 8, 2024
@cderv
Copy link
Collaborator

cderv commented Jan 8, 2024

Thank you

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.

3 participants