Skip to content

Commit

Permalink
chore: test contributing pipeline
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 0818b68 commit c93a3d0
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/parent-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit c93a3d0

Please sign in to comment.