Skip to content

Commit 4e548ee

Browse files
Merge pull request #4502 from AI-Hypercomputer:fix/promote-docker-tags
PiperOrigin-RevId: 949063196
2 parents 0fe4dc7 + d748c04 commit 4e548ee

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/promote_docker_image.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,22 @@ on:
2525

2626
permissions:
2727
contents: read
28+
actions: read
2829

2930
jobs:
3031
handle_result:
3132
name: Handle Airflow DAG Result
3233
runs-on: ubuntu-latest
3334
steps:
3435
- name: Report DAG result
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
STATE: ${{ github.event.client_payload.state }}
39+
DAG_ID: ${{ github.event.client_payload.dag_id }}
40+
DAG_RUN_ID: ${{ github.event.client_payload.dag_run_id }}
41+
SHA: ${{ github.event.client_payload.sha }}
42+
GITHUB_RUN_ID: ${{ github.event.client_payload.github_run_id }}
3543
run: |
36-
STATE="${{ github.event.client_payload.state }}"
37-
DAG_ID="${{ github.event.client_payload.dag_id }}"
38-
DAG_RUN_ID="${{ github.event.client_payload.dag_run_id }}"
39-
SHA="${{ github.event.client_payload.sha }}"
40-
GITHUB_RUN_ID="${{ github.event.client_payload.github_run_id }}"
41-
4244
echo "================================"
4345
echo "Github Run ID: ${GITHUB_RUN_ID}"
4446
echo "DAG ID: ${DAG_ID}"
@@ -53,6 +55,14 @@ jobs:
5355
*) echo "DAG ended with unexpected state: ${STATE}"; exit 1 ;;
5456
esac
5557
58+
if [ -n "$GITHUB_RUN_ID" ]; then
59+
echo "Checking nightly build status for run: $GITHUB_RUN_ID"
60+
gh run watch "$GITHUB_RUN_ID" --exit-status --interval 60 --repo "$GITHUB_REPOSITORY"
61+
else
62+
echo "Error: No Github Run ID provided. Cannot verify nightly build status."
63+
exit 1
64+
fi
65+
5666
tag_docker_image:
5767
name: Promote ${{ matrix.image_name }} Docker Image
5868
needs: handle_result
@@ -71,9 +81,10 @@ jobs:
7181
run: gcloud auth configure-docker us-docker.pkg.dev,gcr.io -q
7282
- name: Add tags to Docker image
7383
shell: bash
84+
env:
85+
GITHUB_RUN_ID: ${{ github.event.client_payload.github_run_id }}
7486
run: |
7587
SOURCE_IMAGE="gcr.io/${{ vars.PROJECT_NAME }}/${{ matrix.image_name }}"
76-
GITHUB_RUN_ID="${{ github.event.client_payload.github_run_id }}"
7788
7889
# Add the traceability tag to confirm it passed validation suite
7990
gcloud container images add-tag "${SOURCE_IMAGE}:${GITHUB_RUN_ID}" \

0 commit comments

Comments
 (0)