Repository navigation
GH Actions: set permissions for each workflow/job - #218
Conversation
> Users frequently over-scope their workflow and job permissions, or set broad workflow-level permissions without realizing that all jobs inherit those permissions.
>
> Furthermore, users often don't realize that the _default_ `GITHUB_TOKEN` permissions can be very broad, meaning that workflows that don't configure any permissions at all can _still_ provide excessive credentials to their individual jobs.
>
> **Remediation**
> In general, permissions should be declared as minimally as possible, and as close to their usage site as possible.
>
> In practice, this means that workflows should almost always set `permissions: {}` at the workflow level to disable all permissions by default, and then set specific job-level permissions as needed.
Refs:
* https://docs.zizmor.sh/audits/#excessive-permissions
**Notes**:
* Includes a few minor tweaks for consistency in the instructions order.
* The permissions added are based on an best effort to discover the ones needed. Some tweaking may still be needed.
|
@jrfnl: I believe that As for the artifact attestations, thank you for bringing them to my attention; I will take a look. |
I see. Want me to have a look at this when I find some time ? |
Thank you for offering that! At the same time, I wonder if the GH Pages site is worth keeping at all? There is not much to that site in general; it seems that a more comprehensive README could do its job. (Or a couple of separate Markdown files by topic.) But that could be just the way I see it. What do you think? |
Pff... not an easy question to answer, but I do have thoughts about this.... I do think having a GH pages website has value, both for search engines as well as for having docs layed out in a human friendly manner and when I looked at the site the other day when working on this PR, I quite liked it. Having said that, a GH Pages site created via a Originally, the only way to have a GH Pages site was via a Just as an example of what you can do with Liquid/Jekyll - the contributors list with the usernames and avatars on this TGMPA Authors page is generated with this small snippet of Jekyll/Liquid and auto-updates on every deploy. So, as an initial step, we could look at adding some Liquid/Jekyll magic to auto-update things like the version number of the last release, the links to PHAR downloads and the changelogs. Now, for the "orphan
The first option would probably already make life a little easier for maintenance of the site and I think we could probably maintain the history of the docs if we move the files into a The second option is to take complete control. In that case, I'd still advocate for moving the skeletons of the docs to the Just as an example, here's the (fairly simple) website for the PHPCSUtils project. Alternatively, it could be considered to move the docs to the repo wiki (currently turned off, but that's a setting). Example. In the linked repo, I imported the original git history of the wiki as it was into a subdirectory of the new repo and then added automation to update the code samples in the docs and the tables of contents on each page. And then when something gets merged to the main branch, the repo automatically deploys to the wiki of the main project via a GH Actions script. All in all, there are options to automatically update the site on each release which aren't that much work to implement and will not need much maintenance. I can't decide for you what to do, but I think injecting some small Jekyll/Liquid/GH API snippets would be a good first step. Anything beyond that, I think we'd need to weight the time investment needed against the benefits. Sorry for the long ramble. Take your time to think it over and let me know what you think. |
Refs:
Notes:
@antecedent And while looking at the workflows to create this PR, I noticed the following:
regenerate-pagesjob in therelease.ymlworkflow seems kind of useless as it doesn't do anything other than checkout the branch and create an empty commit. What is that job supposed to do ?Looking at the website, the changelog page feels painfully out of date.
bundlejob to enable that.