mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-11-23 20:23:50 +08:00
Merge pull request #193 from tj-actions/fix/bug-with-branch-name-with-pr-s-from-forks
This commit is contained in:
commit
f41e4b666d
@ -73,7 +73,7 @@ runs:
|
||||
run: |
|
||||
# "Set the current branch name..."
|
||||
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
||||
if [[ ${{ github.event_name }} == 'pull_request' || ${{ github.event_name }} == 'pull_request_target' ]]; then
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
|
||||
else
|
||||
@ -92,7 +92,7 @@ runs:
|
||||
run: |
|
||||
# "Set the default branch name..."
|
||||
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ github.event.repository.default_branch }}" ]]; then
|
||||
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ github.event.repository.default_branch }}" && "${{ github.event.head.fork }}" != "true" ]]; then
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=is_default::true"
|
||||
echo "::set-output name=default_branch::${{ github.event.repository.default_branch }}"
|
||||
|
Loading…
Reference in New Issue
Block a user