Skip to content

Commit c1d96a5

Browse files
committed
Try find run info from json.
1 parent 6bc3670 commit c1d96a5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,15 @@ jobs:
9797
- name: Watch the deployment
9898
run: gh run watch $deploy_run_id -R originlab/${{ matrix.site }} -i 10 --exit-status
9999

100-
- name: Set $build_job_id and $optimize_job_id
100+
- name: Find job IDs and the SHA
101101
run: |
102-
echo "build_job_id=$(gh run view $deploy_run_id -R originlab/${{ matrix.site }} | grep 'publish_book / convert' | grep -oP '\(ID \K\d+')" >> "$GITHUB_ENV"
103-
echo "optimize_job_id=$(gh run view $deploy_run_id -R originlab/${{ matrix.site }} | grep 'publish_book / optimize' | grep -oP '\(ID \K\d+')" >> "$GITHUB_ENV"
102+
run_view_json=$(gh run view "$deploy_run_id" -R "originlab/${{ matrix.site }}" --json jobs,headSha)
103+
104+
echo "$run_view_json"
105+
106+
echo "build_job_id=$(echo "$run_view_json" | jq -r '.jobs[] | select(.name == "publish_book / convert") | .id')" >> "$GITHUB_ENV"
107+
echo "optimize_job_id=$(echo "$run_view_json" | jq -r '.jobs[] | select(.name == "publish_book / optimize") | .id')" >> "$GITHUB_ENV"
108+
echo "run_sha=$(echo "$run_view_json" | jq -r '.headSha')" >> "$GITHUB_ENV"
104109
105110
- name: Setup helper scripts
106111
run: |

0 commit comments

Comments
 (0)