Skip to content

Commit

Permalink
Testing new codeql config for branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-then committed Oct 30, 2024
1 parent b372194 commit 8e9a511
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,42 @@ jobs:
path: rskj
fetch-depth: 0

- name: Determine branch to checkout for PR
if: github.event_name == 'pull_request'
working-directory: rskj
env:
PR_BRANCH: ${{ github.head_ref }}
run: |
IS_RSKJ_BRANCH=$(git ls-remote --heads origin "$PR_BRANCH")
if test -n "${IS_RSKJ_BRANCH}"; then
echo "Found matching branch name in RSKj repo"
CHECKOUT_REF="$PR_BRANCH"
else
echo "Using master for RSKj"
CHECKOUT_REF="master"
fi
echo "CHECKOUT_REF=$CHECKOUT_REF" >> $GITHUB_ENV
- name: Determine branch to checkout for push
if: github.event_name != 'pull_request'
working-directory: rskj
env:
POW_REF: ${{ github.ref_name }}
run: |
IS_RSKJ_REF=$(git ls-remote --heads origin "$POW_REF")
if test -n "${IS_RSKJ_REF}"; then
echo "Found matching ref in RSKj"
CHECKOUT_REF="$POW_REF"
else
echo "Using master for RSKj"
CHECKOUT_REF="master"
fi
echo "CHECKOUT_REF=$CHECKOUT_REF" >> $GITHUB_ENV
- name: Check out appropriate rskj reference
if: ${{ matrix.language == 'java' }}
working-directory: rskj
env:
CHECKOUT_REF: ${{ github.ref_name }}
CHECKOUT_REF: ${{ env.CHECKOUT_REF }}
run: |
git switch "$CHECKOUT_REF"
Expand Down

0 comments on commit 8e9a511

Please sign in to comment.