Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the Docs workflow via workflow_dispatch always fails #103884

Closed
AlexWaygood opened this issue Apr 26, 2023 · 3 comments
Closed

Running the Docs workflow via workflow_dispatch always fails #103884

AlexWaygood opened this issue Apr 26, 2023 · 3 comments

Comments

@AlexWaygood
Copy link
Member

AlexWaygood commented Apr 26, 2023

Our Docs workflow file allows people to manually trigger the workflow on arbitrary branches in their GitHub fork of CPython:

name: Docs
on:
workflow_dispatch:

This is a useful feature that I like to use in order to test possible changes prior to filing a PR. However, on latest main, while it is still possible to run the Docs workflow via the workflow_dispatch, it now always fails if you try to do so. Example failing run on my GitHub fork: /~https://github.com/AlexWaygood/cpython/actions/runs/4803232831/jobs/8547528105.

The error occurs in the "Get list of changed files" step here (added to the workflow in #102513):

# Add pull request annotations for Sphinx nitpicks (missing references)
- name: 'Get list of changed files'
id: changed_files
uses: Ana06/get-changed-files@v2.2.0
with:
filter: "Doc/**"

The error message is:

Run Ana06/get-changed-files@v[2](/~https://github.com/AlexWaygood/cpython/actions/runs/4803232831/jobs/8547528105#step:8:2).2.0
  with:
    filter: Doc/**
    token: ***
    format: space-delimited
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](/~https://github.com/AlexWaygood/cpython/actions/runs/4803232831/jobs/8547528105#step:8:3).11.3/x6[4](/~https://github.com/AlexWaygood/cpython/actions/runs/4803232831/jobs/8547528105#step:8:4)
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.3/x[6](/~https://github.com/AlexWaygood/cpython/actions/runs/4803232831/jobs/8547528105#step:8:6)4/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.[11](/~https://github.com/AlexWaygood/cpython/actions/runs/4803232831/jobs/8547528105#step:8:11).3/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.3/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.3/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.3/x64/lib
Error: This action only supports pull requests and pushes, workflow_dispatch events are not supported. Please submit an issue on this action's GitHub repo if you believe this in correct.
Base commit: undefined
Head commit: undefined
Error: The base and head commits are missing from the payload for this workflow_dispatch event. Please submit an issue on this action's GitHub repo.
Error: Not Found

While this isn't a huge problem, it would be nice if we could continue to be able to run the Docs workflow via the workflow_dispatch trigger without it failing.

Cc. @hugovk, @ezio-melotti, @CAM-Gerlach

Linked PRs

@hugovk
Copy link
Member

hugovk commented Apr 26, 2023

Yep, we can't get the list of files changed in a PR, when not running as a PR :)

Let's add some logic to skip this bit for non-PRs:

# Add pull request annotations for Sphinx nitpicks (missing references)
- name: 'Get list of changed files'
id: changed_files
uses: Ana06/get-changed-files@v2.2.0
with:
filter: "Doc/**"
- name: 'Build changed files in nit-picky mode'
continue-on-error: true
run: |
# Mark files the pull request modified
touch ${{ steps.changed_files.outputs.added_modified }}
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
python Doc/tools/warnings-to-gh-actions.py

@hugovk
Copy link
Member

hugovk commented Apr 26, 2023

Fixed in #103889, thanks for the report!

@AlexWaygood
Copy link
Member Author

Thanks for the lightning-quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants