Skip to content

Commit 0ed5706

Browse files
committed
feat: devtest using pr number as image identifier
1 parent a2f3666 commit 0ed5706

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

.github/workflows/stage-3-build-images-devtest.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,16 @@ jobs:
6565
GH_TOKEN: ${{ github.token }}
6666
run: |
6767
# Find the PR associated with the current commit SHA
68-
PR_NUM_TAG=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number')
68+
PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number')
6969
70-
if [ -z "$PR_NUM_TAG" ]; then
70+
if [ -z "$PR_NUM" ]; then
7171
echo "No PR found for this tag push."
72-
echo "PR_NUM_TAG=null" >> $GITHUB_OUTPUT
72+
echo "PR_NUM=null" >> $GITHUB_OUTPUT
7373
else
74-
echo "Found PR: $PR_NUM_TAG"
74+
echo "Found PR: $PR_NUM"
75+
PR_NUM_TAG="pr${PR_NUM}"
76+
echo "PR tag: $PR_NUM_TAG"
77+
7578
echo "PR_NUM_TAG=$PR_NUM_TAG" >> $GITHUB_OUTPUT
7679
fi
7780
@@ -144,7 +147,6 @@ jobs:
144147
if: ${{ steps.detect-base-image-changes.outputs.BASE_IMAGE_CHANGE == 'true' || github.ref == 'refs/heads/main' }}
145148
continue-on-error: false
146149
run: |
147-
PR_NUM_TAG=pr${PR_NUM_TAG}
148150
SHORT_COMMIT_HASH=$(git rev-parse --short ${GITHUB_SHA})
149151
echo $SHORT_COMMIT_HASH
150152
echo $PR_NUM_TAG
@@ -171,7 +173,6 @@ jobs:
171173
id: set-image-tags
172174
run: |
173175
174-
PR_NUM_TAG=pr${PR_NUM_TAG}
175176
IMAGE_TAG="latest"
176177
177178
# if [[ ${{steps.detect-base-image-changes.outputs.BASE_IMAGE_CHANGE}} == 'true' ]]; then
@@ -202,7 +203,6 @@ jobs:
202203
function: ${{ fromJSON(needs.get-functions.outputs.FUNC_NAMES) }}
203204
if: needs.get-functions.outputs.FUNC_NAMES != '[]'
204205
outputs:
205-
# pr_num_tag: ${{ env.PR_NUM_TAG }}
206206
short_commit_hash: ${{ env.COMMIT_HASH_TAG }}
207207
devtest_commit_hash: ${{ env.DEVTEST_HASH_TAG }}
208208
devtest_pr_num_tag: ${{ env.DEVTEST_PR_NUM_TAG }}
@@ -249,9 +249,6 @@ jobs:
249249
# PR_NUM_TAG=$(echo ${PULLS_JSON} | jq -r '.[].number')
250250
# fi
251251
252-
echo "PR_NUM_TAG: pr${PR_NUM_TAG}"
253-
# echo "PR_NUM_TAG=pr${PR_NUM_TAG}" >> ${GITHUB_ENV}
254-
255252
DEVTEST_PR_NUM_TAG="devtest_${PR_NUM_TAG}"
256253
echo "Devtest Pr Num tag: ${DEVTEST_PR_NUM_TAG}"
257254
echo "DEVTEST_PR_NUM_TAG=${DEVTEST_PR_NUM_TAG}" >> ${GITHUB_ENV}

0 commit comments

Comments
 (0)