Skip to content

Commit 71d347a

Browse files
committed
fix(ci): when gathering build artifacts for subsequent jobs/steps then constrain finding said artifacts and ignore generated directories
1 parent f000c2a commit 71d347a

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/_build.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,21 @@ jobs:
112112
113113
# Find the paths to the artifact files that will be included in the release, compute
114114
# the SHA digest for all the release files and encode them using Base64, and export it
115-
# from this job.
115+
# from this job. Note that using -maxdepth 1 ensures searching for the generated
116+
# artifacts only, even if other directories (e.g. a generated Simple Index) exist.
116117
- name: Compute package hash
117118
if: matrix.os == env.ARTIFACT_OS && matrix.python == env.ARTIFACT_PYTHON
118119
id: compute-hash
119120
shell: bash
120121
run: |
121122
set -euo pipefail
122-
TARBALL_PATH=$(find dist/ -type f -name "*.tar.gz")
123-
WHEEL_PATH=$(find dist/ -type f -name "*.whl")
124-
REQUIREMENTS_PATH=$(find dist/ -type f -name "*-requirements.txt")
125-
SBOM_PATH=$(find dist/ -type f -name "*-sbom.json")
126-
HTML_DOCS_PATH=$(find dist/ -type f -name "*-docs-html.zip")
127-
MARKDOWN_DOCS_PATH=$(find dist/ -type f -name "*-docs-md.zip")
128-
BUILD_EPOCH_PATH=$(find dist/ -type f -name "*-build-epoch.txt")
123+
TARBALL_PATH=$(find dist/ -maxdepth 1 -type f -name "*.tar.gz")
124+
WHEEL_PATH=$(find dist/ -maxdepth 1 -type f -name "*.whl")
125+
REQUIREMENTS_PATH=$(find dist/ -maxdepth 1 -type f -name "*-requirements.txt")
126+
SBOM_PATH=$(find dist/ -maxdepth 1 -type f -name "*-sbom.json")
127+
HTML_DOCS_PATH=$(find dist/ -maxdepth 1 -type f -name "*-docs-html.zip")
128+
MARKDOWN_DOCS_PATH=$(find dist/ -maxdepth 1 -type f -name "*-docs-md.zip")
129+
BUILD_EPOCH_PATH=$(find dist/ -maxdepth 1 -type f -name "*-build-epoch.txt")
129130
DIGEST=$(sha256sum "$TARBALL_PATH" "$WHEEL_PATH" "$REQUIREMENTS_PATH" "$SBOM_PATH" "$HTML_DOCS_PATH" "$MARKDOWN_DOCS_PATH" "$BUILD_EPOCH_PATH" | base64 -w0)
130131
echo "Digest of artifacts is $DIGEST."
131132
echo "artifacts-sha256=$DIGEST" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)