pypa / pypa/packaging.python.org

Suggest branch restriction in GitHub Actions tutorial

Open
#744 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
1.7k
Avg merge
3d 12h
Merged PRs (30d)
4

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked publishing guide and locate the workflow example containing on: push. Update the documented trigger to restrict publishing to the master branch, then review the rendered guide to confirm the example matches the requested restriction.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.