Skip to content

Commit

Permalink
Update fetch condition in GitHub workflows
Browse files Browse the repository at this point in the history
The fetching action in the packages.yml workflow has been adjusted based on the event type and associated action. This update ensures that when a release event is published, code fetches from the "main" branch. Otherwise, the code fetches based on the provided branch name.
  • Loading branch information
sfmskywalker committed Mar 29, 2024
1 parent 796bb31 commit cfcc573
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ jobs:
uses: actions/checkout@v3
- name: Verify commit exists in remote branch
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/${BRANCH_NAME}
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "published" ]]; then
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
else
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/${BRANCH_NAME}
fi
- name: Set VERSION variable
run: |
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "published" ]]; then
Expand Down

0 comments on commit cfcc573

Please sign in to comment.