Skip to content

Commit

Permalink
👻 update workflow to use correct branch
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Apr 16, 2024
1 parent 209ad23 commit d713fce
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ jobs:
steps:
- name: Extract pull request number from inputs or PR description
run: |
echo "${{ github.event.pull_request.body }}"
PULL_REQUEST_NUMBER=$(echo "${{ github.event.pull_request.body }}" | grep -oP 'Analyzer PR: \K\d+' || true)
if [ -z "$PULL_REQUEST_NUMBER" ]; then
echo "ANALYZER_REF=main" >>$GITHUB_ENV
else
echo "ANALYZER_REF=${CURRENT_BRANCH#refs/heads/}" >>$GITHUB_ENV
if [ ! -z "${BASE_BRANCH}" ]; then
echo "ANALYZER_REF=${BASE_BRANCH}" >>$GITHUB_ENV
fi
if [ ! -z "$PULL_REQUEST_NUMBER" ]; then
echo "ANALYZER_REF=refs/pull/$PULL_REQUEST_NUMBER/merge" >>$GITHUB_ENV
fi
echo "Using analyzer branch ${{ env.ANALYZER_REF }}"
env:
CURRENT_BRANCH: ${{ github.ref }}
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}

- uses: actions/checkout@v3
with:
Expand Down

0 comments on commit d713fce

Please sign in to comment.