From c93a3d09c7398bdad9fa3d5f72db3404ec4ae48f Mon Sep 17 00:00:00 2001 From: Jeremy Andrews Date: Thu, 28 Nov 2024 08:41:49 -0500 Subject: [PATCH] chore: test contributing pipeline Signed-off-by: Jeremy Andrews --- .github/workflows/parent-pipeline.yml | 29 +++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/parent-pipeline.yml b/.github/workflows/parent-pipeline.yml index 2dd41e7..53f2c5d 100644 --- a/.github/workflows/parent-pipeline.yml +++ b/.github/workflows/parent-pipeline.yml @@ -21,12 +21,29 @@ jobs: - id: determine name: Extract Branch and Event run: | - echo "Extracting branch and event context..." - branch=$(echo "${{ github.ref_name }}" - echo "Branch Name: $branch" - echo "Event Name: ${{ github.event_name }}" - echo "branch_name=$branch" >> $GITHUB_OUTPUT - echo "event_name=${{ github.event_name }}" >> $GITHUB_OUTPUT + 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 }}"