The default value of inputs branch is now main, which is fine on the main branch, but needs to be changed when switching to another branch.
Changing the value to ${{ github.head_ref || github.ref_name }} will automatically get the current branch name. github.head_ref will be used when triggered by pull_request and github.ref_name will be used when triggered by push.
The default value of inputs
branch
is nowmain
, which is fine on the main branch, but needs to be changed when switching to another branch.Changing the value to
${{ github.head_ref || github.ref_name }}
will automatically get the current branch name.github.head_ref
will be used when triggered bypull_request
andgithub.ref_name
will be used when triggered bypush
.Reference: https://stackoverflow.com/a/71158878