-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip deploy when only md files are updated (#1351)
* run workflow steps when needed * update comment
- Loading branch information
1 parent
a9ec4d3
commit 383c7f8
Showing
2 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ jobs: | |
|| contains(github.event.pull_request.labels.*.name, 'safe to test')) | ||
outputs: | ||
refid: ${{ steps.run-id.outputs.refid }} | ||
not-md: ${{ steps.filter.outputs.not-md }} | ||
steps: | ||
- id: run-id | ||
name: Get run id | ||
|
@@ -77,9 +78,36 @@ jobs: | |
echo "using id of: ${REFID} for GitHub Ref: ${GITHUB_REF}" | ||
echo "::set-output name=refid::${REFID}" | ||
- name: Checkout | ||
# Code is used by orny/paths-filter action but not required for pull requests | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
not-md: | ||
# we need to check for changes in files other than *.md | ||
- '**/!(*.md)' | ||
# If we don't run the actual deploy (below) we won't receive a check-run status, | ||
# and will have to send it "manually" | ||
- name: Bypass E2E check-runs status | ||
if: ${{ steps.filter.outputs.not-md == 'false' }} | ||
uses: LouisBrunner/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# the name must be identical to the one received by the real job | ||
name: "Deploy PR / Run E2E Tests (Smoke)" | ||
status: "completed" | ||
conclusion: "success" | ||
|
||
run-deploy-tre-not-main: | ||
name: "Deploy PR" | ||
if: github.ref != 'refs/heads/main' | ||
if: ${{ github.ref != 'refs/heads/main' && needs.prepare-not-main.outputs.not-md == 'true' }} | ||
needs: [prepare-not-main] | ||
uses: ./.github/workflows/deploy_tre_reusable.yml | ||
secrets: | ||
|