chore: test contributing pipeline #22
Workflow file for this run
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
# This parent pipeline only runs and routes to the correct child workflow after validation checks. | ||
name: Parent Pipeline | ||
on: | ||
push: | ||
branches: | ||
- '*' # Matches any branch | ||
pull_request: | ||
branches: | ||
- '*' # Matches pull requests to any branch | ||
jobs: | ||
determine-workflow: | ||
name: Determine Workflow Context | ||
runs-on: ubuntu-latest | ||
outputs: | ||
branch_name: ${{ steps.determine.outputs.branch_name }} | ||
event_name: ${{ steps.determine.outputs.event_name }} | ||
steps: | ||
- id: determine | ||
name: Extract Branch and Event | ||
run: | | ||
echo "Extracting branch and event context..." | ||
# Extract branch name based on ref type | ||
if [[ "${{ github.ref }}" == refs/heads/* ]]; then | ||
branch_name="${{ github.ref#refs/heads/ }}" # Strip refs/heads/ | ||
elif [[ "${{ github.ref }}" == refs/pull/* ]]; then | ||
branch_name="pull_request_${{ github.event.pull_request.number }}" # Handle pull requests | ||
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then | ||
branch_name="${{ github.ref#refs/tags/ }}" # Handle tags | ||
else | ||
branch_name="${{ github.ref }}" # Default to raw ref | ||
fi | ||
echo "Branch Name: $branch_name" | ||
echo "Event Name: ${{ github.event_name }}" | ||
# Set outputs | ||
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | ||
echo "event_name=${{ github.event_name }}" >> $GITHUB_OUTPUT | ||
# Set outputs | ||
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | ||
echo "event_name=${{ github.event_name }}" >> $GITHUB_OUTPUT | ||
- name: Debug Branch Name | ||
run: | | ||
echo "Extracted Branch Name: ${{ needs.determine-workflow.outputs.branch_name }}" | ||
echo "Event Name: ${{ needs.determine-workflow.outputs.event_name }}" | ||
trigger-validation: | ||
name: Trigger Validation Workflow | ||
needs: determine-workflow | ||
uses: ./.github/workflows/validation-workflow.yml | ||
with: | ||
branch_name: ${{ needs.determine-workflow.outputs.branch_name }} | ||
event_name: ${{ needs.determine-workflow.outputs.event_name }} | ||
trigger-contributor-workflow: | ||
name: Trigger Contributor Workflow | ||
needs: trigger-validation | ||
if: | | ||
github.event_name == 'push' && | ||
needs.determine-workflow.outputs.branch_name != 'main' && | ||
needs.determine-workflow.outputs.branch_name != 'qa' && | ||
needs.determine-workflow.outputs.branch_name != 'beta' | ||
uses: ./.github/workflows/contributor-workflow.yml | ||
with: | ||
branch_name: ${{ needs.determine-workflow.outputs.branch_name }} | ||
event_name: ${{ needs.determine-workflow.outputs.event_name }} | ||
trigger-qa-workflow: | ||
name: Trigger QA Workflow | ||
needs: trigger-validation | ||
if: | | ||
github.event_name == 'pull_request' && | ||
github.base_ref == 'qa' | ||
uses: ./.github/workflows/qa-workflow.yml | ||
with: | ||
branch_name: ${{ needs.determine-workflow.outputs.branch_name }} | ||
event_name: ${{ needs.determine-workflow.outputs.event_name }} | ||
trigger-beta-workflow: | ||
name: Trigger Beta Workflow | ||
needs: trigger-validation | ||
if: | | ||
github.event_name == 'pull_request' && | ||
github.base_ref == 'beta' | ||
uses: ./.github/workflows/beta-workflow.yml | ||
with: | ||
branch_name: ${{ needs.determine-workflow.outputs.branch_name }} | ||
event_name: ${{ needs.determine-workflow.outputs.event_name }} | ||
trigger-main-workflow: | ||
name: Trigger Main Workflow | ||
needs: trigger-validation | ||
if: | | ||
github.event_name == 'pull_request' && | ||
github.base_ref == 'main' | ||
uses: ./.github/workflows/main-workflow.yml | ||
with: | ||
branch_name: ${{ needs.determine-workflow.outputs.branch_name }} | ||
event_name: ${{ needs.determine-workflow.outputs.event_name }} |