Skip to content

Commit

Permalink
[DPC-3596] Fix workflow logic (#121)
Browse files Browse the repository at this point in the history
## 🎫 Ticket

https://jira.cms.gov/browse/3596

## 🛠 Changes

Previous workflow sent a Slack message regardless of whether the test
succeeded or not. Now it only sends on failures.

## ℹ️ Context

<!-- Why were these changes made? Add background context suitable for a
non-technical audience. -->

<!-- If any of the following security implications apply, this PR must
not be merged without Stephen Walter's approval. Explain in this section
and add @SJWalter11 as a reviewer.
  - Adds a new software dependency or dependencies.
  - Modifies or invalidates one or more of our security controls.
  - Stores or transmits data that was not stored or transmitted before.
- Requires additional review of security implications for other reasons.
-->

## 🧪 Validation

<!-- How were the changes verified? Did you fully test the acceptance
criteria in the ticket? Provide reproducible testing instructions and
screenshots if applicable. -->
  • Loading branch information
ashley-weaver authored Jul 3, 2024
1 parent 20b407e commit b93c931
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/broken-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:
uses: lycheeverse/lychee-action@v1
id: lychee
with:
fail: true
jobSummary: true
args: --no-progress --accept '200..=299, 401, 405' .
- name: "Send Slack alert if failing"
if: always() && env.lychee_exit_code != 0
- name: "Send Slack alert"
if: env.lychee_exit_code != 0
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: "https://hooks.slack.com/triggers/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" # TODO: set as env var?
Expand All @@ -28,3 +27,6 @@ jobs:
{
"Details": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
- name: "Fail workflow"
if: env.lychee_exit_code != 0
run: exit ${{ env.lychee_exit_code }}

0 comments on commit b93c931

Please sign in to comment.