Skip to content

Commit

Permalink
Update branch verification in GitHub workflows
Browse files Browse the repository at this point in the history
This commit modifies the branch verification procedure in the GitHub workflows file. The code now includes a condition that checks if the event is a release that has been published before proceeding with fetching from the main branch. For other cases, the procedure remains the same, with fetching taking place from the referenced branch.
  • Loading branch information
sfmskywalker committed Mar 29, 2024
1 parent 69aacd6 commit 7c9f9f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/packages.yml
Expand Up @@ -42,8 +42,14 @@ jobs:
uses: actions/checkout@v3
- 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}
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 7c9f9f5

Please sign in to comment.