packaging.python.org
packaging.python.org copied to clipboard
Suggest branch restriction in GitHub Actions tutorial
I was working through the guide at https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ and made a mistake by creating a workflow that published any time a push is made.
The guide currently suggests:
on: push
But this means that the release job will run on any push on any branch.
I think instead, we should advise to restrict the job to the master branch:
on:
push:
branches:
- master
(cc @webknjaz)
@di at the moment, I recommend making use of the environments — this would be more accurate as they allow having separate secrets and requiring approvals to run the corresponding jobs. I'd rather incorporate this in the tutorial.