Skip to content

Commit

Permalink
Using event.release.target_commitish for target branch
Browse files Browse the repository at this point in the history
Can use this.
Or can set it to use the default branch always since the releases would only be triggered on changes to master branch.
  • Loading branch information
MukuFlash03 committed Oct 7, 2024
1 parent 7ed65c6 commit 5a9d7f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ jobs:
id: get-branch-name
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
base_ref=${{ github.event.base_ref }}
echo "Branch name: branch_name=${base_ref#refs/heads/}"
echo "branch_name=${base_ref#refs/heads/}" >> "$GITHUB_OUTPUT"
# base_ref=${{ github.event.base_ref }}
# echo "Branch name: branch_name=${base_ref#refs/heads/}"
# echo "branch_name=${base_ref#refs/heads/}" >> "$GITHUB_OUTPUT"
target_branch=${{ github.event.release.target_commitish }}
echo "branch_name=${target_branch}" >> "$GITHUB_OUTPUT"
elif [ "${{ github.ref_type }}" == "branch" ]; then
echo "branch_name=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
fi
Expand Down

0 comments on commit 5a9d7f3

Please sign in to comment.