octoherd / create-octoherd-script

CLI to create a new folder and repository for an Octoherd Script
ISC License
13 stars 6 forks source link

Create repository configuring Workflows with 'Read and write' #150

Open oscard0m opened 4 months ago

oscard0m commented 4 months ago

The problem

Octoherd repositories are scaffolded with a release GitHub workflow (.github/workflows/release.yml), which uses semantic-release to manage the releases to NPM. This workflow requires the repository to be configured to grant workflows with 'Read and Write' permissions.

But by default, a repository is created with the configuration 'Read repository contents and packages permissions'. This makes new Octoherd scripts scaffolded not work out of the box when trying to do their first release.


Proposed solution

To update the repository creation logic and set this required configuration out of the box. GitHub offers a way to update this via API: https://docs.github.com/en/rest/actions/permissions?apiVersion=2022-11-28#set-default-workflow-permissions-for-a-repository

Questions

What would be the first choice if there is an existing parent configuration at org/user level? a) To respect that parent configuration b) To still apply the Read and Write for that octoherd repository, ignoring what's configured at org/user level.

gr2m commented 4 months ago

I didn't know about that API, very cool!