Skip to content

Commit

Permalink
testing rollback slack thread
Browse files Browse the repository at this point in the history
  • Loading branch information
IsraelleHub committed Aug 1, 2024
1 parent 5750841 commit 792a64f
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/documentation_accessibility_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
# Run on Weekdays at 9:00 AM UTC, 4AM ET, 1:00 AM PT
schedule:
- cron: '0 9 * * 1,2,3,4,5'
push:
branches:
[bug-axe-check-chome-driver-version]

jobs:
axe-scan:
Expand Down Expand Up @@ -36,7 +39,7 @@ jobs:
yarn build
- name: Start web server
working-directory: VAMobile/documentation
run: npm start & npx wait-on http://localhost:3000 &
run: npm start & npx wait-on http://localhost:3000 &
- name: Check accessibility issues
id: accessibility_check
run: |
Expand All @@ -61,19 +64,26 @@ jobs:

# Fail the workflow if accessibility issues are detected
if [ "$num_issues" -gt 0 ]; then
echo "Accessibility issues were detected."
echo "Accessibility issues were detected."
exit 1
else
echo "No accessibility issues were found."
fi

start_slack_thread:
name: Start Slack thread
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: axe-scan
uses: ./.github/workflows/start_slack_thread.yml
secrets: inherit
with:
channel_name: va-mobile-build-alerts
message: 'Accessibility issues detected. Please review and fix. Build started by ${{ github.actor }}: (:git: `${{ github.ref_name }}`). See :thread: or <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow run> for results.'

steps:
- name: Notify Slack
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
channel_name: va-mobile-build-alerts
message: 'Accessibility issues detected. Please review and fix. Build started by ${{ github.actor }}: (:git: `${{ github.ref_name }}`). See :thread: or <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow run> for results.'
run: |
curl -X POST \
-H "Authorization: Bearer $SLACK_API_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"channel\":\"$channel_name\",\"text\":\"$message\"}" \
https://slack.com/api/chat.postMessage

0 comments on commit 792a64f

Please sign in to comment.