mirror of
https://github.com/bitwarden/android.git
synced 2025-12-10 09:56:45 -06:00
Set SARIF upload branch to the merge commit ref/sha retrieved from GH CLI (#4958)
This commit is contained in:
parent
20bda929b3
commit
f43702cb83
3
.github/workflows/scan-ci.yml
vendored
3
.github/workflows/scan-ci.yml
vendored
@ -37,8 +37,6 @@ jobs:
|
||||
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
||||
with:
|
||||
sarif_file: cx_result.sarif
|
||||
sha: ${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.sha || github.sha }}
|
||||
ref: ${{ contains(github.event_name, 'pull_request') && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
|
||||
|
||||
quality:
|
||||
name: Quality scan
|
||||
@ -60,4 +58,3 @@ jobs:
|
||||
args: >
|
||||
-Dsonar.organization=${{ github.repository_owner }}
|
||||
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
|
||||
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
|
||||
|
||||
19
.github/workflows/scan.yml
vendored
19
.github/workflows/scan.yml
vendored
@ -40,12 +40,27 @@ jobs:
|
||||
--filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
|
||||
--output-path . ${{ env.INCREMENTAL }}
|
||||
|
||||
- name: Get branch refs
|
||||
id: get-branch-refs
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
if [[ $GITHUB_EVENT_NAME == "pull_request_target" ]]; then
|
||||
MERGE_SHA=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$_PR_NUMBER --jq .merge_commit_sha)
|
||||
echo "SHA=$MERGE_SHA" >> $GITHUB_OUTPUT
|
||||
echo "REF=refs/pull/$_PR_NUMBER/merge" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "SHA=$GITHUB_SHA" >> $GITHUB_OUTPUT
|
||||
echo "REF=$GITHUB_REF" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Upload Checkmarx results to GitHub
|
||||
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
||||
with:
|
||||
sarif_file: cx_result.sarif
|
||||
sha: ${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.sha || github.sha }}
|
||||
ref: ${{ contains(github.event_name, 'pull_request') && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
|
||||
sha: ${{ steps.get-branch-refs.outputs.SHA }}
|
||||
ref: ${{ steps.get-branch-refs.outputs.REF }}
|
||||
|
||||
quality:
|
||||
name: Quality scan
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user