Skip to content

Commit

Permalink
Configuration - Refactor workflow to improve fetching of latest run I…
Browse files Browse the repository at this point in the history
…D and enhance logging output
  • Loading branch information
dpasukhi committed Oct 26, 2024
1 parent 652684b commit e7e5db4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-and-test-multiplatform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
set workflow_name="Build and Test OCCT on Multiple Platforms"
set workflow_name=Build and Test OCCT on Multiple Platforms
set target_branch=${{ github.event.pull_request.base.ref }}
echo Fetching latest run ID for workflow: "%workflow_name%" on branch: "%target_branch%"
curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=%target_branch%&status=success&event=pull_request" > response.json
for /F "tokens=*" %%i in ('jq -r ".workflow_runs[] | select(.name==\"%workflow_name%\") | .id" response.json ^| head -n 1') do set latest_run_id=%%i
for /F "tokens=*" %%i in ('jq -r ".workflow_runs[] | select(.name==\"%workflow_name%\") | .id" response.json ^| head -n 1') do (
set latest_run_id=%%i
)
echo Latest run ID: %latest_run_id%
echo latest_run_id=%latest_run_id% >> %GITHUB_ENV%
shell: cmd
Expand Down

0 comments on commit e7e5db4

Please sign in to comment.