Skip to content

Commit

Permalink
modify branch extraction in consumer_contract_tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-in-a-Jar committed Jun 1, 2023
1 parent bc05500 commit d226330
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/consumer_contract_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ on:
paths-ignore:
- 'README.md'
push:
branches:
- develop
paths-ignore:
- 'README.md'
merge_group:
Expand All @@ -54,16 +52,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Obtain branch properties
- name: Extract branch
id: extract-branch
run: |
FORK=false
GITHUB_EVENT_NAME=${{ github.event_name }}
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
GITHUB_REF=${{ github.ref }}
GITHUB_SHA=${{ github.sha }}
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
FORK=${{ github.event.pull_request.head.repo.fork }}
GITHUB_REF=refs/heads/${{ github.head_ref }}
GITHUB_SHA=${{ github.event.pull_request.head.sha }}
elif [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then
Expand All @@ -72,9 +68,8 @@ jobs:
echo "Failed to extract branch information"
exit 1
fi
echo "repo-branch=${GITHUB_REF/refs\/heads\//""}" >> $GITHUB_OUTPUT
echo "repo-version=${GITHUB_SHA}" >> $GITHUB_OUTPUT
echo "fork=${FORK}" >> $GITHUB_OUTPUT
echo "CURRENT_BRANCH=${GITHUB_REF/refs\/heads\//""}" >> $GITHUB_ENV
echo "CURRENT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
- name: Is PR triggered by forked repo?
if: ${{ steps.extract-branch.outputs.fork == 'true' }}
Expand Down

0 comments on commit d226330

Please sign in to comment.