Skip to content

Commit

Permalink
Merge pull request #48 from tj-actions/feature/restrict-current-branc…
Browse files Browse the repository at this point in the history
…h-output
  • Loading branch information
jackton1 committed May 24, 2021
2 parents 1f12f14 + 0b34927 commit 98c04d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
steps:
- id: branch
run: |
if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
export BASE_REF=${{ github.base_ref }}
export HEAD_REF=${{ github.head_ref }}
export REF=${{ github.ref }}
Expand All @@ -44,15 +44,15 @@ runs:
shell: bash
- id: current_branch
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
if [[ ${{ github.event_name }} == 'pull_request' && "${{ github.ref }}" != "refs/tags/"* ]]; then
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
else
echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}"
fi
shell: bash
- id: default
run: |
if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ steps.branch.outputs.ref_branch }}" ]]; then
echo "::set-output name=is_default::true"
else
Expand Down

0 comments on commit 98c04d5

Please sign in to comment.