diff --git a/.github/workflows/test-old-branches.yml b/.github/workflows/test-old-branches.yml index 31b706d740..03cd79f4a2 100644 --- a/.github/workflows/test-old-branches.yml +++ b/.github/workflows/test-old-branches.yml @@ -1,9 +1,17 @@ name: Test old branches on: - # Once weekly On Mondays at 00:00 UTC. + # Verify the workflow is successful when this file is updated. + push: + branches: + - master + - trunk + paths: + - '.github/workflows/test-old-branches.yml' + # Run twice a month on the 1st and 15th at 00:00 UTC. schedule: - - cron: '0 0 1,15 * *' + - cron: '0 0 1 * *' + - cron: '0 0 15 * *' jobs: dispatch-workflows-for-old-branches: @@ -45,9 +53,11 @@ jobs: - branch: '3.7' workflow: 'javascript-tests.yml' + # Run all branches monthly, but only the currently supported one twice per month. steps: - name: Dispatch workflow run uses: actions/github-script@47f7cf65b5ced0830a325f705cad64f2f58dddf7 # v3.1.0 + if: ${{ github.event_name == 'push' || github.event.schedule == '0 0 15 * *' || matrix.branch == '5.7' }} with: github-token: ${{ secrets.GHA_OLD_BRANCH_DISPATCH }} script: |