From 792a64f88f1d861f79f0bf529011308c04269158 Mon Sep 17 00:00:00 2001 From: IsraelleHub <145595240+IsraelleHub@users.noreply.github.com> Date: Thu, 1 Aug 2024 08:38:51 -0500 Subject: [PATCH] testing rollback slack thread --- .../documentation_accessibility_checks.yml | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/documentation_accessibility_checks.yml b/.github/workflows/documentation_accessibility_checks.yml index 4097f597dc6..06d2d66a421 100644 --- a/.github/workflows/documentation_accessibility_checks.yml +++ b/.github/workflows/documentation_accessibility_checks.yml @@ -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: @@ -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: | @@ -61,7 +64,7 @@ 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." @@ -69,11 +72,18 @@ jobs: 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