Skip to content

Commit

Permalink
chore: additional to workflow configurations-env
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Andrews <[email protected]>
  • Loading branch information
ABC2015 committed Nov 28, 2024
1 parent 205a933 commit 409936f
Showing 1 changed file with 28 additions and 37 deletions.
65 changes: 28 additions & 37 deletions .github/workflows/parent-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This parent pipeline only runs and routes to the correct child workflow after validation checks.

# This parent pipeline only runs and routes to the correct child workflow after validation checks.

name: Parent Pipeline

on:
Expand All @@ -13,73 +11,66 @@ on:
- '*' # Matches pull requests to any branch

jobs:
trigger-validation:
name: Trigger Validation Workflow
uses: ./.github/workflows/validation-workflow.yml
with:
branch_name: ${{ github.ref_name }}
event_name: ${{ github.event_name }}

determine-workflow:
needs: trigger-validation
name: Determine Branch and Event
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.determine.outputs.branch }}
branch_name: ${{ steps.determine.outputs.branch_name }}
base_branch: ${{ steps.determine.outputs.base_branch }}
event_name: ${{ steps.determine.outputs.event }}
event_name: ${{ steps.determine.outputs.event_name }}
steps:
- name: Determine Branch and Event
- name: Extract Information
id: determine
run: |
echo "Branch: ${{ github.ref_name }}"
echo "Branch Name: ${{ github.ref_name }}"
echo "Base Branch: ${{ github.base_ref }}"
echo "Event: ${{ github.event_name }}"
echo "::set-output name=branch::${{ github.ref_name }}"
echo "Event Name: ${{ github.event_name }}"
echo "::set-output name=branch_name::${{ github.ref_name }}"
echo "::set-output name=base_branch::${{ github.base_ref }}"
echo "::set-output name=event::${{ github.event_name }}"
echo "::set-output name=event_name::${{ github.event_name }}"
trigger-contributor-workflow:
needs: [determine-workflow]
name: Trigger Contributor Workflow
needs: determine-workflow
name: Contributor Workflow
uses: ./.github/workflows/contributor-workflow.yml
with:
branch_name: ${{ needs.determine-workflow.outputs.branch_name }}
event_name: ${{ needs.determine-workflow.outputs.event_name }}
env:
BRANCH_NAME: ${{ needs.determine-workflow.outputs.branch_name }}
EVENT_NAME: ${{ needs.determine-workflow.outputs.event_name }}
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'
trigger-qa-workflow:
needs: [determine-workflow]
name: Trigger QA Workflow
needs: determine-workflow
name: QA Workflow
uses: ./.github/workflows/qa-workflow.yml
with:
branch_name: ${{ needs.determine-workflow.outputs.branch_name }}
event_name: ${{ needs.determine-workflow.outputs.event_name }}
env:
BRANCH_NAME: ${{ needs.determine-workflow.outputs.branch_name }}
EVENT_NAME: ${{ needs.determine-workflow.outputs.event_name }}
if: |
github.event_name == 'pull_request' &&
needs.determine-workflow.outputs.base_branch == 'qa'
trigger-beta-workflow:
needs: [determine-workflow]
name: Trigger Beta Workflow
needs: determine-workflow
name: Beta Workflow
uses: ./.github/workflows/beta-workflow.yml
with:
branch_name: ${{ needs.determine-workflow.outputs.branch_name }}
event_name: ${{ needs.determine-workflow.outputs.event_name }}
env:
BRANCH_NAME: ${{ needs.determine-workflow.outputs.branch_name }}
EVENT_NAME: ${{ needs.determine-workflow.outputs.event_name }}
if: |
github.event_name == 'pull_request' &&
needs.determine-workflow.outputs.base_branch == 'beta'
trigger-main-workflow:
needs: [determine-workflow]
name: Trigger Main Workflow
needs: determine-workflow
name: Main Workflow
uses: ./.github/workflows/main-workflow.yml
with:
branch_name: ${{ needs.determine-workflow.outputs.branch_name }}
event_name: ${{ needs.determine-workflow.outputs.event_name }}
env:
BRANCH_NAME: ${{ needs.determine-workflow.outputs.branch_name }}
EVENT_NAME: ${{ needs.determine-workflow.outputs.event_name }}
if: |
github.event_name == 'pull_request' &&
needs.determine-workflow.outputs.base_branch == 'main'

0 comments on commit 409936f

Please sign in to comment.