diff --git a/.github/workflows/caches_cron_job.yml b/.github/workflows/caches_cron_job.yml index 4bbfef049..4b1046aee 100644 --- a/.github/workflows/caches_cron_job.yml +++ b/.github/workflows/caches_cron_job.yml @@ -70,7 +70,12 @@ jobs: - name: Get current hash (SHA) of the ephy_testing_data repo id: ephy_testing_data run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT + set -o pipefail + if ! hash="$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" || [ -z "$hash" ]; then + echo "::error::could not resolve ephy_testing_data HEAD on gin; refusing to build a degenerate cache key" + exit 1 + fi + echo "dataset_hash=$hash" >> "$GITHUB_OUTPUT" - uses: actions/cache@v3 # Loading cache of ephys_testing_dataset diff --git a/.github/workflows/io-test.yml b/.github/workflows/io-test.yml index 341f9e5a3..5815d3cd6 100644 --- a/.github/workflows/io-test.yml +++ b/.github/workflows/io-test.yml @@ -42,7 +42,12 @@ jobs: # the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git id: ephy_testing_data run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT + set -o pipefail + if ! hash="$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" || [ -z "$hash" ]; then + echo "::error::could not resolve ephy_testing_data HEAD on gin; refusing to build a degenerate cache key" + exit 1 + fi + echo "dataset_hash=$hash" >> "$GITHUB_OUTPUT" - uses: actions/cache/restore@v4 # Loading cache of ephys_testing_dataset diff --git a/.github/workflows/plexon2-testing.yml b/.github/workflows/plexon2-testing.yml index 6cdb3e366..28005f404 100644 --- a/.github/workflows/plexon2-testing.yml +++ b/.github/workflows/plexon2-testing.yml @@ -33,7 +33,12 @@ jobs: # the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git id: ephy_testing_data run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT + set -o pipefail + if ! hash="$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" || [ -z "$hash" ]; then + echo "::error::could not resolve ephy_testing_data HEAD on gin; refusing to build a degenerate cache key" + exit 1 + fi + echo "dataset_hash=$hash" >> "$GITHUB_OUTPUT" - uses: actions/cache/restore@v4 # Loading cache of ephys_testing_dataset