Skip to content

ci: docs-cli-check.yml watches itself on push but not on pull requests #93

Description

@LeyckerS

This issue is reserved for someone who has never had a pull request merged on GitHub before. If you have contributed before, please leave it — the roadmap has plenty of other work.

You are adding one line. The point is to walk you through the process once, and the reason behind it is worth understanding.

The problem

.github/workflows/docs-cli-check.yml lists the paths that make it run:

  push:
    branches: [main]
    paths:
      - "**.md"
      - "**.py"
      - ".github/workflows/docs-cli-check.yml"   # <- it is here
  pull_request:
    paths:
      - "**.md"
      - "**.py"                                   # <- but not here

The push trigger watches the workflow file itself. The pull_request trigger does not.

So a pull request that changes only this workflow runs no checks at all. Whoever opens it cannot see whether their change works until after it has already been merged to main — which is the worst possible moment to find out.

This is not hypothetical: it happened this week in lint.yml. Two people submitted the same fix, and the one whose pull request also added the self-reference came back green while the other ran zero checks. That was #77.

The change

File: .github/workflows/docs-cli-check.yml

Add one line under the pull_request paths: list, so it matches the push list:

  pull_request:
    paths:
      - "**.md"
      - "**.py"
      - ".github/workflows/docs-cli-check.yml"

Indentation matters in YAML — line it up exactly with the two lines above it.

How you will know it worked

Your own pull request is the test. Because you are changing this file, and your change makes the workflow watch this file, the Docs CLI Check job should appear on your pull request and pass. If no checks appear, the line is not doing what it should — say so in a comment.

How to do it, step by step

  1. Click Fork at the top right of this repository.
  2. In your copy, open .github/workflows/docs-cli-check.yml and click the pencil icon.
  3. Add the line under pull_request:paths:.
  4. Under Commit changes, write something like ci: make docs-cli-check watch its own file on PRs, then Propose changes.
  5. Click Create pull request, write Closes #93, and submit.

All of it happens in the browser. Nothing to install.

Before you start

Comment here saying you are taking it. Then go ahead — no need to wait for a reply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciContinuous integration and workflowsfirst-timers-onlyReserved for someone who has never contributed to open source beforehelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions