Skip to content

Commit

Permalink
ci: update adev-preview-deployment to no longer use metadata from bui…
Browse files Browse the repository at this point in the history
…ld output (#988)

Use the github event values instead of the user generated information.
  • Loading branch information
josephperrott authored Sep 27, 2024
1 parent 0257838 commit 26f3423
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/adev-preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ jobs:
- name: Inject pull request number
run: echo "${{ github.event.pull_request.number }}" >> __metadata__pull_number.txt
working-directory: build/dist/bin/adev/build/browser
- name: Inject commit hash
run: echo "${{ github.event.pull_request.head.sha }}" >> __metadata__commit_hash.txt
working-directory: build/dist/bin/adev/build/browser
- uses: actions/upload-artifact@v4
with:
name: adev-preview
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/adev-preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,11 @@ jobs:
path: ${{ env.BUILD_DIR }}
github-token: '${{secrets.GITHUB_TOKEN}}'
run-id: ${{ github.event.workflow_run.id }}
- run: ls -R
- name: Extract pull request number
id: pr-number
run: |
PR_NUMBER=$(cat ./$BUILD_DIR/__metadata__pull_number.txt)
echo "value=$PR_NUMBER" >> $GITHUB_OUTPUT
- name: Extract commit hash
id: commit-hash
run: |
COMMIT_HASH=$(cat ./$BUILD_DIR/__metadata__commit_hash.txt)
echo "value=$COMMIT_HASH" >> $GITHUB_OUTPUT
- run: echo ${{ steps.pr-number.outputs.value }} ${{ steps.commit-hash.outputs.value }}
echo 'value=$PR_NUMBER' >> $GITHUB_OUTPUT
- name: Deploy to Firebase Hosting Preview
id: firebase-deploy
uses: FirebaseExtended/[email protected]
Expand All @@ -74,5 +67,5 @@ jobs:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: |
Preview deployed: ${{ steps.firebase-deploy.outputs.details_url }} (commit: ${{ steps.commit-hash.outputs.value }})
Preview deployed: ${{ steps.firebase-deploy.outputs.details_url }} (commit: ${{ github.event.workflow_run.head_sha }})

0 comments on commit 26f3423

Please sign in to comment.