Github actions setup#
The following should be setup on the github page of the repo.
Copier/cruft update#
By default, the generated repo will have .github/workflows/update-copier.yml
or .github/workflows/update-cruft.yml. These will periodically check for
updates to the template and create a pr with changes. These require a token to
trigger on: push and on: pull_request workflows, and to update workflow
files. Create the token using one of the following:
Classic personal access token with
repoandworkflowsscopeFine-grained personal access token with
contents: write,pull_requests: writeandworkflows: writepermissions.
Also, allow workflows to create pull requests
You’ll also need to use add an environment pull-request under
Settings -> Environments.
Add the token to the github repo pull-requestenvironment using either:
Under
Settings -> Environments -> pull-request -> Environment secretsaddPATwith generated token.Use github cli:
gh secret set PAT --env pull-request
Trusted publishing#
Generated repos use [trusted publishing] to release the code to pypi and
test.pypi. This requires defining the environments pypi and test-pypi,
which can be created under Settings -> Environments of the github repo.
Rules#
It is a good idea to setup a merge rule. This can be done under
Settings -> Rules -> Rulesets, using something like the following:
Add
maintoTarget branchesusingInclude by patternSelect
Require status checks to pass. Addpre-commit.ci - prandrequired-checks-passto theStatus checks that are requiredlist.