Skip to content

Commit f5f05e2

Browse files
UjjwalSaini19claude
andcommitted
GUARD-2071: Update CodeQL runner to use public labeled runner
- Changed runner from ubuntu-latest to ubuntu-24.04-2cores-tools-public - Removed GitHub App token workaround (no longer needed) - Removed manual SARIF upload steps (no longer needed) - Now using standard CodeQL action upload mechanism The new labeled runner has allowlisted IPs that can interact with the Skyscanner GitHub org, eliminating the need for the previous workaround that used a GitHub App to upload SARIF results. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7aba7bb commit f5f05e2

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
analyze:
1313
name: Analyze
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-24.04-2cores-tools-public
1515
permissions:
1616
actions: read
1717
contents: read
@@ -28,55 +28,16 @@ jobs:
2828
with:
2929
persist-credentials: false
3030

31-
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
32-
id: app-token
33-
with:
34-
app-id: ${{ vars.GH_APP_ID }}
35-
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
36-
3731
- name: Initialize CodeQL
3832
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
3933
with:
4034
languages: ${{ matrix.language }}
4135
queries: +security-and-quality
42-
token: ${{ steps.app-token.outputs.token }}
4336

4437
- name: Autobuild
4538
uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
46-
with:
47-
token: ${{ steps.app-token.outputs.token }}
4839

4940
- name: Perform CodeQL Analysis
5041
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
5142
with:
5243
category: "/language:${{ matrix.language }}"
53-
token: ${{ steps.app-token.outputs.token }}
54-
upload: never
55-
56-
# Workaround for parallel GitHub bugs
57-
# * Can't use GHA token with IP allowlisting
58-
# https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#using-github-actions-with-an-ip-allow-list
59-
# * Can't use codeql-action/analyze with custom token
60-
# https://support.github.com/ticket/enterprise/3427/3214517
61-
- name: Prepare for CodeQL Upload
62-
run: |
63-
echo "{\"commit_sha\": \"${{ github.sha }}\", \"ref\": \"${GITHUB_REF}\"}" > ./codeql-upload.json
64-
65-
- name: Gzip CodeQL SARIF Result
66-
run: |
67-
gzip -c ../results/${{ matrix.language }}.sarif | base64 -w0 > codeql-results.sarif.gz.base64
68-
69-
- name: Staple SARIF result to CodeQL upload
70-
run: |
71-
jq --rawfile sarif codeql-results.sarif.gz.base64 '.sarif = $sarif' codeql-upload.json > codeql-upload-with-sarif.json
72-
73-
- name: Upload CodeQL Results
74-
run: |
75-
curl --fail-with-body \
76-
-X POST \
77-
-H "Authorization: token ${STEPS_APP_TOKEN_OUTPUTS_TOKEN}" \
78-
-H "Accept: application/vnd.github.v3+json" \
79-
--data "@codeql-upload-with-sarif.json" \
80-
https://api.github.com/repos/${{ github.repository }}/code-scanning/sarifs
81-
env:
82-
STEPS_APP_TOKEN_OUTPUTS_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)