diff --git a/.github/workflows/notify-app-on-test-change.yml b/.github/workflows/notify-app-on-test-change.yml new file mode 100644 index 000000000..1a1771351 --- /dev/null +++ b/.github/workflows/notify-app-on-test-change.yml @@ -0,0 +1,37 @@ +name: Notify App about test changes +on: + push: + branches: + - master + paths: + - 'tests/**' + +jobs: + check-and-notify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Check for test changes + id: check-changes + run: | + if git diff --name-only HEAD^ HEAD | grep -q "^tests/"; then + echo "changes_detected=true" >> $GITHUB_OUTPUT + else + echo "changes_detected=false" >> $GITHUB_OUTPUT + fi + + - name: Trigger aria-at-app workflow + if: steps.check-changes.outputs.changes_detected == 'true' + uses: peter-evans/repository-dispatch@v2 + with: + token: 'TODO: ADD ONCE APPROACH IS ACCEPTED' + repository: w3c/aria-at-app + event-type: update-test-snapshots + client-payload: | + { + "ref": "${{ github.sha }}", + "commit_message": "${{ github.event.head_commit.message }}" + }