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 3bd1e65 commit 57913a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ jobs:
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 57913a9

Please sign in to comment.