Skip to content

Commit

Permalink
Add explicit checks update for comment-triggered builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartleeks committed Mar 1, 2022
1 parent 607abde commit 2c4b532
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/deploy_tre_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ on:
workflow_call:
inputs:
prRepo:
description: Name of the repo GitHub repo containing the ref (as org/repo )
description: Name of the repo GitHub repo containing the ref (as org/repo)
type: string
required: false
prRef:
description: The git ref to checkout
type: string
required: false
prHeadSha:
description: For PR builds where GITHUB_REF isn't set to the PR (e.g. comment trigger), pass the PR's head SHA commit here
type: string
required: false
ciGitRef:
description: The git ref to use in annotations to associate a deployment with the code that triggered it
type: string
Expand Down Expand Up @@ -591,6 +595,20 @@ jobs:
TRE_ID: "${{ secrets.TRE_ID }}"
IS_API_SECURED: false

# For PR builds triggered from comment builds, the GITHUB_REF is set to main
# so the checks aren't automatically associated with the PR
# If prHeadSha is specified then explicity mark the checks for that SHA
- name: Report check status
if: ${{ inputs.prHeadSha }}
uses: LouisBrunner/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
# the name must be identical to the one received by the real job
sha: ${{ inputs.prHeadSha }}
name: "Deploy PR / Run E2E Tests (Smoke)"
status: "completed"
conclusion: "success"

- name: Notify dedicated teams channel
uses: sachinkundu/[email protected]
if: ${{ failure() && github.ref == 'refs/heads/main'}}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr_comment_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ jobs:
uses: ./.github/workflows/deploy_tre_reusable.yml
with:
prRef: ${{ needs.pr_comment.outputs.prRef }}
prHeadSha: ${{ needs.pr_comment.outputs.prHeadSha }}
# prRepo: ${{ needs.pr_comment.outputs.prRepo }}
ciGitRef: ${{ needs.pr_comment.outputs.ciGitRef }}
secrets:
Expand Down Expand Up @@ -196,3 +197,4 @@ jobs:
TRE_ADDRESS_SPACE: ${{ secrets.TRE_ADDRESS_SPACE }}
TRE_ID: ${{ format('tre{0}', needs.pr_comment.outputs.refid) }}
CI_CACHE_ACR_NAME: ${{ secrets.ACR_NAME }}

0 comments on commit 2c4b532

Please sign in to comment.