packaging.python.org icon indicating copy to clipboard operation
packaging.python.org copied to clipboard

Suggest branch restriction in GitHub Actions tutorial

Open di opened this issue 4 years ago • 2 comments

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

di avatar Jun 19 '20 18:06 di

(cc @webknjaz)

di avatar Jun 19 '20 18:06 di

@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.

webknjaz avatar Nov 19 '22 15:11 webknjaz