Skip to content

Commit

Permalink
Update GitHub workflow for better branch handling
Browse files Browse the repository at this point in the history
This update modifies the GitHub workflow in packages.yml for improved branch name extraction and more accurate commit verification. It provides more feedback by outputting the extracted branch name, and checks for commits in the specific branch rather than in 'origin/dispatch-channels'.
  • Loading branch information
sfmskywalker committed Feb 14, 2024
1 parent 2f05eae commit ceee982
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
timeout-minutes: 30
steps:
- name: Extract branch name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | rev | cut -d/ -f1 | rev)" >> $GITHUB_ENV
run: |
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | rev | cut -d/ -f1 | rev)" >> $GITHUB_ENV
echo "Branch name: $BRANCH_NAME"
- name: Checkout
uses: actions/checkout@v3
- name: Verify commit exists in origin/dispatch-channels
- name: Verify commit exists in branch
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/${BRANCH_NAME}
Expand Down

0 comments on commit ceee982

Please sign in to comment.