-
Notifications
You must be signed in to change notification settings - Fork 2
Add nightly CodeQL CLI update workflow #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
783315c
e5f8b19
4b5a2fb
fc260c1
8edf080
f4c8e6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,172 @@ | ||||||||||||
| name: Update CodeQL CLI Dependencies | ||||||||||||
|
|
||||||||||||
| on: | ||||||||||||
| workflow_dispatch: | ||||||||||||
| # Nightly check for new CodeQL CLI releases | ||||||||||||
| schedule: | ||||||||||||
| - cron: '30 5 * * *' | ||||||||||||
|
|
||||||||||||
| permissions: | ||||||||||||
| contents: read | ||||||||||||
|
|
||||||||||||
| jobs: | ||||||||||||
| # ───────────────────────────────────────────────────────────────────────────── | ||||||||||||
| # Step 1: Detect new CodeQL CLI version | ||||||||||||
| # | ||||||||||||
| # Compares the current CodeQL CLI version in .codeql-version against the | ||||||||||||
| # latest release from github/codeql-cli-binaries. If a newer version is | ||||||||||||
| # available, downstream jobs orchestrate the update and PR creation. | ||||||||||||
| # ───────────────────────────────────────────────────────────────────────────── | ||||||||||||
| detect-update: | ||||||||||||
| name: Detect CodeQL CLI Update | ||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
|
|
||||||||||||
| outputs: | ||||||||||||
| current_version: ${{ steps.check-version.outputs.current_version }} | ||||||||||||
| latest_version: ${{ steps.check-version.outputs.latest_version }} | ||||||||||||
| update_needed: ${{ steps.check-version.outputs.update_needed }} | ||||||||||||
| version: ${{ steps.check-version.outputs.version }} | ||||||||||||
|
|
||||||||||||
| steps: | ||||||||||||
| - name: Detect - Checkout repository | ||||||||||||
| uses: actions/checkout@v6 | ||||||||||||
|
|
||||||||||||
| - name: Detect - Check latest CodeQL CLI version | ||||||||||||
| id: check-version | ||||||||||||
| env: | ||||||||||||
| GH_TOKEN: ${{ github.token }} | ||||||||||||
| run: | | ||||||||||||
| echo "Checking latest CodeQL CLI version..." | ||||||||||||
|
|
||||||||||||
| # Read current version from .codeql-version (stores vX.Y.Z) | ||||||||||||
| current_version_raw=$(cat .codeql-version | tr -d '[:space:]') | ||||||||||||
| current_version="${current_version_raw#v}" | ||||||||||||
|
|
||||||||||||
| # Get latest release from codeql-cli-binaries | ||||||||||||
| latest_tag=$(gh release list --repo github/codeql-cli-binaries --json 'tagName,isLatest' --jq '.[] | select(.isLatest == true) | .tagName') | ||||||||||||
|
|
||||||||||||
| # Validate that we found a latest release | ||||||||||||
| if [ -z "${latest_tag}" ]; then | ||||||||||||
| echo "❌ Error: Could not determine latest CodeQL CLI version from github/codeql-cli-binaries" >&2 | ||||||||||||
| echo "No release marked as 'latest' was found. This may indicate an API issue or repository change." >&2 | ||||||||||||
| exit 1 | ||||||||||||
| fi | ||||||||||||
|
|
||||||||||||
| latest_clean="${latest_tag#v}" | ||||||||||||
|
|
||||||||||||
|
data-douser marked this conversation as resolved.
|
||||||||||||
| if [ -z "${latest_tag}" ]; then | ||||||||||||
| echo "❌ ERROR: Failed to determine latest CodeQL CLI release. 'gh release list' returned no results or no release is marked as latest." >&2 | ||||||||||||
| echo "update_needed=false" >> $GITHUB_OUTPUT | ||||||||||||
| exit 1 | ||||||||||||
| fi | ||||||||||||
|
Comment on lines
+57
to
+61
|
||||||||||||
| if [ -z "${latest_tag}" ]; then | |
| echo "❌ ERROR: Failed to determine latest CodeQL CLI release. 'gh release list' returned no results or no release is marked as latest." >&2 | |
| echo "update_needed=false" >> $GITHUB_OUTPUT | |
| exit 1 | |
| fi |
Uh oh!
There was an error while loading. Please reload this page.