Skip to content

Commit 26f3423

Browse files
ci: update adev-preview-deployment to no longer use metadata from build output (#988)
Use the github event values instead of the user generated information.
1 parent 0257838 commit 26f3423

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

.github/workflows/adev-preview-build.yml

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ jobs:
4949
- name: Inject pull request number
5050
run: echo "${{ github.event.pull_request.number }}" >> __metadata__pull_number.txt
5151
working-directory: build/dist/bin/adev/build/browser
52-
- name: Inject commit hash
53-
run: echo "${{ github.event.pull_request.head.sha }}" >> __metadata__commit_hash.txt
54-
working-directory: build/dist/bin/adev/build/browser
5552
- uses: actions/upload-artifact@v4
5653
with:
5754
name: adev-preview

.github/workflows/adev-preview-deploy.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,11 @@ jobs:
3636
path: ${{ env.BUILD_DIR }}
3737
github-token: '${{secrets.GITHUB_TOKEN}}'
3838
run-id: ${{ github.event.workflow_run.id }}
39-
- run: ls -R
4039
- name: Extract pull request number
4140
id: pr-number
4241
run: |
4342
PR_NUMBER=$(cat ./$BUILD_DIR/__metadata__pull_number.txt)
44-
echo "value=$PR_NUMBER" >> $GITHUB_OUTPUT
45-
- name: Extract commit hash
46-
id: commit-hash
47-
run: |
48-
COMMIT_HASH=$(cat ./$BUILD_DIR/__metadata__commit_hash.txt)
49-
echo "value=$COMMIT_HASH" >> $GITHUB_OUTPUT
50-
- run: echo ${{ steps.pr-number.outputs.value }} ${{ steps.commit-hash.outputs.value }}
43+
echo 'value=$PR_NUMBER' >> $GITHUB_OUTPUT
5144
- name: Deploy to Firebase Hosting Preview
5245
id: firebase-deploy
5346
uses: FirebaseExtended/[email protected]
@@ -74,5 +67,5 @@ jobs:
7467
comment-id: ${{ steps.find-comment.outputs.comment-id }}
7568
edit-mode: replace
7669
body: |
77-
Preview deployed: ${{ steps.firebase-deploy.outputs.details_url }} (commit: ${{ steps.commit-hash.outputs.value }})
70+
Preview deployed: ${{ steps.firebase-deploy.outputs.details_url }} (commit: ${{ github.event.workflow_run.head_sha }})
7871

0 commit comments

Comments
 (0)