File tree 2 files changed +4
-3
lines changed 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Tests
3
3
4
4
on :
5
5
pull_request :
6
- paths : [.github/workflows/tf_tests .yaml, action.yml, tests/**]
6
+ paths : [.github/workflows/test_suite .yaml, action.yml, tests/**]
7
7
types : [opened, reopened, synchronize, closed]
8
8
9
9
jobs :
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ runs:
106
106
job_id=$(echo "$workflow_run" | jq --raw-output '(.jobs[] | select((.name | ascii_downcase | gsub("-|_"; " ")) == (env.GITHUB_JOB | ascii_downcase | gsub("-|_"; " "))) | .id) // .jobs[0].id' | tail -n 1)
107
107
else
108
108
# For matrix jobs, join the matrix values with comma separator into a single string and get the ID of the job which contains it.
109
- matrix=$(echo "$GH_MATRIX" | jq --raw-output 'to_entries | map(.value) | join(", ")')
109
+ matrix=$(echo "$GH_MATRIX" | jq --raw-output 'to_entries | map(if .value | type == "object" then (.value | to_entries[0].value) else .value end ) | join(", ")')
110
110
job_id=$(echo "$workflow_run" | jq --raw-output --arg matrix "$matrix" '.jobs[] | select(.name | contains($matrix)) | .id' | tail -n 1)
111
111
fi
112
112
echo "job=$job_id" >> "$GITHUB_OUTPUT"
@@ -168,7 +168,8 @@ runs:
168
168
run : |
169
169
# Download plan file.
170
170
# Get the artifact ID of the latest matching plan files for download.
171
- artifact_id=$(gh api /repos/${{ github.repository }}/actions/artifacts --header "$GH_API" --method GET --field "name=${{ steps.identifier.outputs.name }}" --jq '.artifacts[0].id')
171
+ artifact_id=$(gh api /repos/${{ github.repository }}/actions/artifacts --header "$GH_API" --method GET --field "name=${{ steps.identifier.outputs.name }}" --jq '.artifacts[0].id' 2>/dev/null)
172
+ if [ -z "$artifact_id" ]; then echo "Unable to locate plan file: ${{ steps.identifier.outputs.name }}." && exit 1; fi
172
173
gh api /repos/${{ github.repository }}/actions/artifacts/${artifact_id}/zip --header "$GH_API" --method GET > "${{ steps.identifier.outputs.name }}.zip"
173
174
174
175
# Unzip the plan file to the working directory, then clean up the zip file.
You can’t perform that action at this time.
0 commit comments