python / release-tools

Scripts for making (C)Python releases
39 stars 32 forks source link

Triple lint YAML #105

Closed hugovk closed 5 months ago

hugovk commented 5 months ago

Follow on from https://github.com/python/release-tools/pull/104.

Before that fix, the "Upload the docs artifacts" step was being skipped:

https://github.com/python/release-tools/actions/runs/8519755747/job/23334443184

Linting with https://github.com/rhysd/actionlint:

❯ actionlint
.github/workflows/source-and-docs-release.yml:71:9: shellcheck reported issue in this script: SC2046:warning:7:22: Quote this to prevent word splitting [shellcheck]
   |
71 |         run: |
   |         ^~~~
.github/workflows/source-and-docs-release.yml:96:13: if: condition "${{ hashFiles('cpython/${{ inputs.cpython_release }}/docs') != '' }}" is always evaluated to true because extra characters are around ${{ }} [if-cond]
   |
96 |         if: ${{ hashFiles('cpython/${{ inputs.cpython_release }}/docs') != '' }}
   |             ^~~

That second one was the problem: it doesn't like the ${{ inputs.cpython_release } inside a string: 'cpython/${{ inputs.cpython_release }}/docs' (try in the playground).

See:

Let's also fix that shellcheck warning, and add three YAML linters to the CI to help prevent this :) Plus some other handy linters.