Skip to content

Commit

Permalink
Update test-meticulous-create-deployment.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Que3216 authored Oct 22, 2024
1 parent cd6e344 commit 35e3a85
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/test-meticulous-create-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ jobs:
# Set it as an output for the next step
echo "preview_url=$PREVIEW_URL" >> $GITHUB_OUTPUT
# We can't just use $GITHUB_SHA because in the case of pull requests this is the SHA of the temporary merge commit,
# but we want to tag the actual triggering commit
# In the case of CI runs for commits on pull requests GitHub creates a temporary merge commit, merging in the current
# head of the main/master/develop branch, and then runs the workflow on that commit, ${{ github.sha }}. However
# if our $PREVIEW_URL points to a deployment of the commit at the head of the pull request, rather than a deployment
# of the temporary merge commit then we want to tag the commit at the head of the pull request with our deployment.
# We call this the 'triggering commit SHA'.
- name: Get triggering commit SHA
id: get_sha
run: |
Expand All @@ -55,6 +58,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
COMMIT_SHA: ${{ env.TRIGGERING_COMMIT_SHA }}
# TODO: Comment out the above line and uncommment the below line if your deployment is a deployment
# of the temporary merge commit (i.e. the code checked out in this workflow) rather than the commit
# at the head of the pull request branch.
# COMMIT_SHA: ${{ github.sha }}
PREVIEW_URL: ${{ steps.create-url.outputs.preview_url }}
ENVIRONMENT_NAME: "preview"
run: |
Expand Down

0 comments on commit 35e3a85

Please sign in to comment.