add: watch scripts github for changes and run the workflows #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OCM Tests Orchestrator | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the specified branch and files. | |
push: | |
branches: | |
- main | |
paths: | |
- "cypress/ocm-test-suite/**" | |
- "dev/ocm-test-suite.sh" | |
- "dev/ocm-test-suite/**" | |
- ".github/workflows/**" | |
- "./scripts/github/**" | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "cypress/ocm-test-suite/**" | |
- "dev/ocm-test-suite.sh" | |
- "dev/ocm-test-suite/**" | |
- ".github/workflows/**" | |
- "./scripts/github/**" | |
# Allows you to run this workflow manually from the Actions tab. | |
workflow_dispatch: | |
jobs: | |
orchestrate-tests: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_sha: ${{ steps.get-sha.outputs.sha }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get commit SHA | |
id: get-sha | |
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Trigger and monitor test workflows | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const orchestrateTests = require('./scripts/github/orchestrate-tests.js'); | |
await orchestrateTests(github, context); | |
trigger-pages: | |
needs: orchestrate-tests | |
uses: ./.github/workflows/github-pages.yml | |
with: | |
sha: ${{ needs.orchestrate-tests.outputs.commit_sha }} |