mirror of
https://github.com/github/codeql-action.git
synced 2025-12-09 01:08:10 +08:00
Compare commits
1 Commits
navntoft/t
...
update-v1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5589cbc707 |
5
.eslintignore
Normal file
5
.eslintignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
**/webpack.config.js
|
||||||
|
lib/**
|
||||||
|
runner/dist/**
|
||||||
|
src/testdata/**
|
||||||
|
tests/**
|
||||||
58
.eslintrc.json
Normal file
58
.eslintrc.json
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": "./tsconfig.json"
|
||||||
|
},
|
||||||
|
"plugins": ["@typescript-eslint", "filenames", "github", "import", "no-async-foreach"],
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||||
|
"plugin:github/recommended",
|
||||||
|
"plugin:github/typescript"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
|
||||||
|
"i18n-text/no-en": "off",
|
||||||
|
"import/extensions": "error",
|
||||||
|
"import/no-amd": "error",
|
||||||
|
"import/no-commonjs": "error",
|
||||||
|
"import/no-dynamic-require": "error",
|
||||||
|
// Disable the rule that checks that devDependencies aren't imported since we use a single
|
||||||
|
// linting configuration file for both source and test code.
|
||||||
|
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
|
||||||
|
"import/no-namespace": "off",
|
||||||
|
"import/no-unresolved": "error",
|
||||||
|
"import/no-webpack-loader-syntax": "error",
|
||||||
|
"import/order": ["error", {
|
||||||
|
"alphabetize": {"order": "asc"},
|
||||||
|
"newlines-between": "always"
|
||||||
|
}],
|
||||||
|
"no-async-foreach/no-async-foreach": "error",
|
||||||
|
"no-console": "off",
|
||||||
|
"no-sequences": "error",
|
||||||
|
"no-shadow": "off",
|
||||||
|
"@typescript-eslint/no-shadow": ["error"],
|
||||||
|
"one-var": ["error", "never"]
|
||||||
|
},
|
||||||
|
"overrides": [{
|
||||||
|
// "temporarily downgraded during transition to eslint
|
||||||
|
"files": "**",
|
||||||
|
"rules": {
|
||||||
|
"@typescript-eslint/ban-types": "off",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-call": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-return": "off",
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
|
"@typescript-eslint/prefer-regexp-exec": "off",
|
||||||
|
"@typescript-eslint/require-await": "off",
|
||||||
|
"@typescript-eslint/restrict-template-expressions": "off",
|
||||||
|
"func-style": "off",
|
||||||
|
"sort-imports": "off"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# .git-blame-ignore-revs
|
|
||||||
# Added trailing commas to adhere to new eslint rules
|
|
||||||
b16296be30e150034524d6dd0b0418fc6b184267
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
name: Check Code-Scanning Config
|
|
||||||
description: |
|
|
||||||
Checks the code scanning configuration file generated by the
|
|
||||||
action to ensure it contains the expected contents
|
|
||||||
inputs:
|
|
||||||
languages:
|
|
||||||
required: false
|
|
||||||
description: The languages field passed to the init action.
|
|
||||||
|
|
||||||
packs:
|
|
||||||
required: false
|
|
||||||
description: The packs field passed to the init action.
|
|
||||||
|
|
||||||
queries:
|
|
||||||
required: false
|
|
||||||
description: The queries field passed to the init action.
|
|
||||||
|
|
||||||
config-file-test:
|
|
||||||
required: false
|
|
||||||
description: |
|
|
||||||
The location of the config file to use. If empty,
|
|
||||||
then no config file is used.
|
|
||||||
|
|
||||||
expected-config-file-contents:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
A JSON string containing the exact contents of the config file.
|
|
||||||
|
|
||||||
tools:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
The version of CodeQL passed to the `tools` input of the init action.
|
|
||||||
This can be any of the following:
|
|
||||||
|
|
||||||
- A local path to a tarball containing the CodeQL tools, or
|
|
||||||
- A URL to a GitHub release assets containing the CodeQL tools, or
|
|
||||||
- A special value `linked` which is forcing the use of the CodeQL tools
|
|
||||||
that the action has been bundled with.
|
|
||||||
|
|
||||||
If not specified, the Action will check in several places until it finds
|
|
||||||
the CodeQL tools.
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: ${{ inputs.languages }}
|
|
||||||
config-file: ${{ inputs.config-file-test }}
|
|
||||||
queries: ${{ inputs.queries }}
|
|
||||||
packs: ${{ inputs.packs }}
|
|
||||||
tools: ${{ inputs.tools }}
|
|
||||||
db-location: ${{ runner.temp }}/codescanning-config-cli-test
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: 'true'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
shell: bash
|
|
||||||
run: npm install --location=global ts-node js-yaml
|
|
||||||
|
|
||||||
- name: Check config
|
|
||||||
working-directory: ${{ github.action_path }}
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
EXPECTED_CONFIG_FILE_CONTENTS: '${{ inputs.expected-config-file-contents }}'
|
|
||||||
run: ts-node ./index.ts "$RUNNER_TEMP/user-config.yaml" "$EXPECTED_CONFIG_FILE_CONTENTS"
|
|
||||||
- name: Clean up
|
|
||||||
shell: bash
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
rm -rf $RUNNER_TEMP/codescanning-config-cli-test
|
|
||||||
rm -rf $RUNNER_TEMP/user-config.yaml
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
|
|
||||||
import * as core from '@actions/core'
|
|
||||||
import * as yaml from 'js-yaml'
|
|
||||||
import * as fs from 'fs'
|
|
||||||
import * as assert from 'assert'
|
|
||||||
|
|
||||||
const actualConfig = loadActualConfig()
|
|
||||||
|
|
||||||
const rawExpectedConfig = process.argv[3].trim()
|
|
||||||
if (!rawExpectedConfig) {
|
|
||||||
core.setFailed('No expected configuration provided')
|
|
||||||
} else {
|
|
||||||
core.startGroup('Expected generated user config')
|
|
||||||
core.info(yaml.dump(JSON.parse(rawExpectedConfig)))
|
|
||||||
core.endGroup()
|
|
||||||
}
|
|
||||||
|
|
||||||
const expectedConfig = rawExpectedConfig ? JSON.parse(rawExpectedConfig) : undefined;
|
|
||||||
|
|
||||||
assert.deepStrictEqual(
|
|
||||||
actualConfig,
|
|
||||||
expectedConfig,
|
|
||||||
'Expected configuration does not match actual configuration'
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
function loadActualConfig() {
|
|
||||||
if (!fs.existsSync(process.argv[2])) {
|
|
||||||
core.info('No configuration file found')
|
|
||||||
return undefined
|
|
||||||
} else {
|
|
||||||
const rawActualConfig = fs.readFileSync(process.argv[2], 'utf8')
|
|
||||||
core.startGroup('Actual generated user config')
|
|
||||||
core.info(rawActualConfig)
|
|
||||||
core.endGroup()
|
|
||||||
|
|
||||||
return yaml.load(rawActualConfig)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
20
.github/actions/check-sarif/action.yml
vendored
20
.github/actions/check-sarif/action.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: Check SARIF
|
|
||||||
description: Checks a SARIF file to see if certain queries were run and others were not run.
|
|
||||||
inputs:
|
|
||||||
sarif-file:
|
|
||||||
required: true
|
|
||||||
description: The SARIF file to check
|
|
||||||
|
|
||||||
queries-run:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
Comma separated list of query ids that should be included in this SARIF file.
|
|
||||||
|
|
||||||
queries-not-run:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
Comma separated list of query ids that should NOT be included in this SARIF file.
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: node20
|
|
||||||
main: index.js
|
|
||||||
43
.github/actions/check-sarif/index.js
vendored
43
.github/actions/check-sarif/index.js
vendored
@@ -1,43 +0,0 @@
|
|||||||
'use strict'
|
|
||||||
|
|
||||||
const core = require('@actions/core')
|
|
||||||
const fs = require('fs')
|
|
||||||
|
|
||||||
const sarif = JSON.parse(fs.readFileSync(core.getInput('sarif-file'), 'utf8'))
|
|
||||||
const rules = sarif.runs[0].tool.extensions.flatMap(ext => ext.rules || [])
|
|
||||||
const ruleIds = rules.map(rule => rule.id)
|
|
||||||
|
|
||||||
// Check that all the expected queries ran
|
|
||||||
const expectedQueriesRun = getQueryIdsInput('queries-run')
|
|
||||||
const queriesThatShouldHaveRunButDidNot = expectedQueriesRun.filter(queryId => !ruleIds.includes(queryId))
|
|
||||||
|
|
||||||
if (queriesThatShouldHaveRunButDidNot.length > 0) {
|
|
||||||
core.setFailed(`The following queries were expected to run but did not: ${queriesThatShouldHaveRunButDidNot.join(', ')}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check that all the unexpected queries did not run
|
|
||||||
const expectedQueriesNotRun = getQueryIdsInput('queries-not-run')
|
|
||||||
|
|
||||||
const queriesThatShouldNotHaveRunButDid = expectedQueriesNotRun.filter(queryId => ruleIds.includes(queryId))
|
|
||||||
|
|
||||||
if (queriesThatShouldNotHaveRunButDid.length > 0) {
|
|
||||||
core.setFailed(`The following queries were NOT expected to have run but did: ${queriesThatShouldNotHaveRunButDid.join(', ')}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
core.startGroup('All queries run')
|
|
||||||
rules.forEach(rule => {
|
|
||||||
core.info(`${rule.id}: ${(rule.properties && rule.properties.name) || rule.name}`)
|
|
||||||
})
|
|
||||||
core.endGroup()
|
|
||||||
|
|
||||||
core.startGroup('Full SARIF')
|
|
||||||
core.info(JSON.stringify(sarif, null, 2))
|
|
||||||
core.endGroup()
|
|
||||||
|
|
||||||
function getQueryIdsInput(name) {
|
|
||||||
return core.getInput(name)
|
|
||||||
.split(',')
|
|
||||||
.map(q => q.trim())
|
|
||||||
.filter(q => q.length > 0)
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
name: "Prepare mergeback branch"
|
|
||||||
description: Prepares a mergeback branch and opens a PR for it
|
|
||||||
inputs:
|
|
||||||
base:
|
|
||||||
description: "The name of the base branch"
|
|
||||||
required: true
|
|
||||||
head:
|
|
||||||
description: "The name of the head branch"
|
|
||||||
required: true
|
|
||||||
branch:
|
|
||||||
description: "The name of the branch to create."
|
|
||||||
required: true
|
|
||||||
version:
|
|
||||||
description: "The new version"
|
|
||||||
required: true
|
|
||||||
token:
|
|
||||||
description: "The token to use"
|
|
||||||
required: true
|
|
||||||
dry-run:
|
|
||||||
description: "Set to true to skip creating the PR. The branch will still be pushed."
|
|
||||||
default: "false"
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Create mergeback branch
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
VERSION: "${{ inputs.version }}"
|
|
||||||
NEW_BRANCH: "${{ inputs.branch }}"
|
|
||||||
run: |
|
|
||||||
set -exu
|
|
||||||
|
|
||||||
# Ensure we are on the new branch
|
|
||||||
git checkout "${NEW_BRANCH}"
|
|
||||||
|
|
||||||
# Update the version number ready for the next release
|
|
||||||
npm version patch --no-git-tag-version
|
|
||||||
|
|
||||||
# Update the changelog, adding a new version heading directly above the most recent existing one
|
|
||||||
awk '!f && /##/{print "'"## [UNRELEASED]\n\nNo user facing changes.\n"'"; f=1}1' CHANGELOG.md > temp && mv temp CHANGELOG.md
|
|
||||||
git add .
|
|
||||||
git commit -m "Update changelog and version after ${VERSION}"
|
|
||||||
|
|
||||||
git push origin "${NEW_BRANCH}"
|
|
||||||
|
|
||||||
- name: Create PR
|
|
||||||
shell: bash
|
|
||||||
if: inputs.dry-run != 'true'
|
|
||||||
env:
|
|
||||||
VERSION: "${{ inputs.version }}"
|
|
||||||
BASE_BRANCH: "${{ inputs.base }}"
|
|
||||||
HEAD_BRANCH: "${{ inputs.head }}"
|
|
||||||
NEW_BRANCH: "${{ inputs.branch }}"
|
|
||||||
GITHUB_TOKEN: "${{ inputs.token }}"
|
|
||||||
run: |
|
|
||||||
set -exu
|
|
||||||
pr_title="Mergeback ${VERSION} ${HEAD_BRANCH} into ${BASE_BRANCH}"
|
|
||||||
pr_body=$(cat << EOF
|
|
||||||
This PR bumps the version number and updates the changelog after the ${VERSION} release.
|
|
||||||
|
|
||||||
Please do the following:
|
|
||||||
|
|
||||||
- [ ] Remove and re-add the "Rebuild" label to the PR to trigger just this workflow.
|
|
||||||
- [ ] Wait for the "Rebuild" workflow to push a commit updating the distribution files.
|
|
||||||
- [ ] Mark the PR as ready for review to trigger the full set of PR checks.
|
|
||||||
- [ ] Approve and merge the PR. When merging the PR, make sure "Create a merge commit" is
|
|
||||||
selected rather than "Squash and merge" or "Rebase and merge".
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
|
|
||||||
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
|
|
||||||
gh pr create \
|
|
||||||
--head "${NEW_BRANCH}" \
|
|
||||||
--base "${BASE_BRANCH}" \
|
|
||||||
--title "${pr_title}" \
|
|
||||||
--label "Rebuild" \
|
|
||||||
--body "${pr_body}" \
|
|
||||||
--assignee "${GITHUB_ACTOR}" \
|
|
||||||
--draft
|
|
||||||
82
.github/actions/prepare-test/action.yml
vendored
82
.github/actions/prepare-test/action.yml
vendored
@@ -1,82 +0,0 @@
|
|||||||
name: "Prepare test"
|
|
||||||
description: Performs some preparation to run tests
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z"
|
|
||||||
required: true
|
|
||||||
use-all-platform-bundle:
|
|
||||||
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
|
|
||||||
default: 'false'
|
|
||||||
required: false
|
|
||||||
setup-kotlin:
|
|
||||||
description: "If true, we setup kotlin"
|
|
||||||
default: 'true'
|
|
||||||
required: true
|
|
||||||
outputs:
|
|
||||||
tools-url:
|
|
||||||
description: "The value that should be passed as the 'tools' input of the 'init' step."
|
|
||||||
value: ${{ steps.get-url.outputs.tools-url }}
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Move codeql-action
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir ../action
|
|
||||||
mv * .github ../action/
|
|
||||||
mv ../action/tests/multi-language-repo/{*,.github} .
|
|
||||||
mv ../action/.github/workflows .github
|
|
||||||
- id: get-url
|
|
||||||
name: Determine URL
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
VERSION: ${{ inputs.version }}
|
|
||||||
USE_ALL_PLATFORM_BUNDLE: ${{ inputs.use-all-platform-bundle }}
|
|
||||||
run: |
|
|
||||||
set -e # Fail this Action if `gh release list` fails.
|
|
||||||
|
|
||||||
if [[ "$VERSION" == "linked" ]]; then
|
|
||||||
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
|
|
||||||
exit 0
|
|
||||||
elif [[ "$VERSION" == "default" ]]; then
|
|
||||||
echo "tools-url=" >> "$GITHUB_OUTPUT"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$VERSION" == "nightly-latest" && "$RUNNER_OS" != "Windows" ]]; then
|
|
||||||
extension="tar.zst"
|
|
||||||
else
|
|
||||||
extension="tar.gz"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then
|
|
||||||
artifact_name="codeql-bundle.$extension"
|
|
||||||
elif [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
||||||
artifact_name="codeql-bundle-linux64.$extension"
|
|
||||||
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
||||||
artifact_name="codeql-bundle-osx64.$extension"
|
|
||||||
elif [[ "$RUNNER_OS" == "Windows" ]]; then
|
|
||||||
artifact_name="codeql-bundle-win64.$extension"
|
|
||||||
else
|
|
||||||
echo "::error::Unrecognized OS $RUNNER_OS"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$VERSION" == "nightly-latest" ]]; then
|
|
||||||
tag=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
|
|
||||||
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/$artifact_name" >> $GITHUB_OUTPUT
|
|
||||||
elif [[ "$VERSION" == *"nightly"* ]]; then
|
|
||||||
version=`echo "$VERSION" | sed -e 's/^.*\-//'`
|
|
||||||
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
|
|
||||||
elif [[ "$VERSION" == *"stable"* ]]; then
|
|
||||||
version=`echo "$VERSION" | sed -e 's/^.*\-//'`
|
|
||||||
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "::error::Unrecognized version specified!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: fwilhe2/setup-kotlin@9c245a6425255f5e98ba1ce6c15d31fce7eca9da
|
|
||||||
if: ${{ inputs.setup-kotlin == 'true' }}
|
|
||||||
with:
|
|
||||||
version: 1.8.21
|
|
||||||
62
.github/actions/query-filter-test/action.yml
vendored
62
.github/actions/query-filter-test/action.yml
vendored
@@ -1,62 +0,0 @@
|
|||||||
name: Query Filter Test
|
|
||||||
description: Runs a test of query filters using the check SARIF action
|
|
||||||
inputs:
|
|
||||||
sarif-file:
|
|
||||||
required: true
|
|
||||||
description: The SARIF file to check
|
|
||||||
|
|
||||||
queries-run:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
Comma separated list of query ids that should be included in this SARIF file.
|
|
||||||
|
|
||||||
queries-not-run:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
Comma separated list of query ids that should NOT be included in this SARIF file.
|
|
||||||
|
|
||||||
config-file:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
The location of the codeql configuration file to use.
|
|
||||||
|
|
||||||
tools:
|
|
||||||
required: true
|
|
||||||
description: |
|
|
||||||
The version of CodeQL passed to the `tools` input of the init action.
|
|
||||||
This can be any of the following:
|
|
||||||
|
|
||||||
- A local path to a tarball containing the CodeQL tools, or
|
|
||||||
- A URL to a GitHub release assets containing the CodeQL tools, or
|
|
||||||
- A special value `linked` which is forcing the use of the CodeQL tools
|
|
||||||
that the action has been bundled with.
|
|
||||||
|
|
||||||
If not specified, the Action will check in several places until it finds
|
|
||||||
the CodeQL tools.
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
config-file: ${{ inputs.config-file }}
|
|
||||||
tools: ${{ inputs.tools }}
|
|
||||||
db-location: ${{ runner.temp }}/query-filter-test
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: "true"
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload: never
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: "true"
|
|
||||||
- name: Check SARIF
|
|
||||||
uses: ./../action/.github/actions/check-sarif
|
|
||||||
with:
|
|
||||||
sarif-file: ${{ inputs.sarif-file }}
|
|
||||||
queries-run: ${{ inputs.queries-run}}
|
|
||||||
queries-not-run: ${{ inputs.queries-not-run}}
|
|
||||||
- name: Cleanup after test
|
|
||||||
shell: bash
|
|
||||||
run: rm -rf "$RUNNER_TEMP/results" "$RUNNER_TEMP/query-filter-test"
|
|
||||||
28
.github/actions/release-branches/action.yml
vendored
28
.github/actions/release-branches/action.yml
vendored
@@ -1,28 +0,0 @@
|
|||||||
name: 'Release branches'
|
|
||||||
description: 'Determine branches for release & backport'
|
|
||||||
inputs:
|
|
||||||
major_version:
|
|
||||||
description: 'The version as extracted from the package.json file'
|
|
||||||
required: true
|
|
||||||
latest_tag:
|
|
||||||
description: 'The most recent tag published to the repository'
|
|
||||||
required: true
|
|
||||||
outputs:
|
|
||||||
backport_source_branch:
|
|
||||||
description: "The release branch for the given tag"
|
|
||||||
value: ${{ steps.branches.outputs.backport_source_branch }}
|
|
||||||
backport_target_branches:
|
|
||||||
description: "JSON encoded list of branches to target with backports"
|
|
||||||
value: ${{ steps.branches.outputs.backport_target_branches }}
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- id: branches
|
|
||||||
env:
|
|
||||||
MAJOR_VERSION: ${{ inputs.major_version }}
|
|
||||||
LATEST_TAG: ${{ inputs.latest_tag }}
|
|
||||||
run: |
|
|
||||||
python ${{ github.action_path }}/release-branches.py \
|
|
||||||
--major-version "$MAJOR_VERSION" \
|
|
||||||
--latest-tag "$LATEST_TAG"
|
|
||||||
shell: bash
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
import argparse
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import configparser
|
|
||||||
|
|
||||||
# Name of the remote
|
|
||||||
ORIGIN = 'origin'
|
|
||||||
|
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
grandparent_dir = os.path.dirname(os.path.dirname(script_dir))
|
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
|
||||||
with open(os.path.join(grandparent_dir, 'releases.ini')) as stream:
|
|
||||||
config.read_string('[default]\n' + stream.read())
|
|
||||||
|
|
||||||
OLDEST_SUPPORTED_MAJOR_VERSION = int(config['default']['OLDEST_SUPPORTED_MAJOR_VERSION'])
|
|
||||||
|
|
||||||
def main():
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument("--major-version", required=True, type=str, help="The major version of the release")
|
|
||||||
parser.add_argument("--latest-tag", required=True, type=str, help="The most recent tag published to the repository")
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
major_version = args.major_version
|
|
||||||
latest_tag = args.latest_tag
|
|
||||||
|
|
||||||
print("major_version: " + major_version)
|
|
||||||
print("latest_tag: " + latest_tag)
|
|
||||||
|
|
||||||
# If this is a primary release, we backport to all supported branches,
|
|
||||||
# so we check whether the major_version taken from the package.json
|
|
||||||
# is greater than or equal to the latest tag pulled from the repo.
|
|
||||||
# For example...
|
|
||||||
# 'v1' >= 'v2' is False # we're operating from an older release branch and should not backport
|
|
||||||
# 'v2' >= 'v2' is True # the normal case where we're updating the current version
|
|
||||||
# 'v3' >= 'v2' is True # in this case we are making the first release of a new major version
|
|
||||||
consider_backports = ( major_version >= latest_tag.split(".")[0] )
|
|
||||||
|
|
||||||
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
|
|
||||||
|
|
||||||
f.write(f"backport_source_branch=releases/{major_version}\n")
|
|
||||||
|
|
||||||
backport_target_branches = []
|
|
||||||
|
|
||||||
if consider_backports:
|
|
||||||
for i in range(int(major_version.strip("v"))-1, 0, -1):
|
|
||||||
branch_name = f"releases/v{i}"
|
|
||||||
if i >= OLDEST_SUPPORTED_MAJOR_VERSION:
|
|
||||||
backport_target_branches.append(branch_name)
|
|
||||||
|
|
||||||
f.write("backport_target_branches="+json.dumps(backport_target_branches)+"\n")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
33
.github/actions/release-initialise/action.yml
vendored
33
.github/actions/release-initialise/action.yml
vendored
@@ -1,33 +0,0 @@
|
|||||||
name: 'Prepare release job'
|
|
||||||
description: 'Prepare for updating a release branch'
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Dump environment
|
|
||||||
run: env
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Dump GitHub context
|
|
||||||
env:
|
|
||||||
GITHUB_CONTEXT: '${{ toJson(github) }}'
|
|
||||||
run: echo "$GITHUB_CONTEXT"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: 3.12
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install PyGithub==2.3.0 requests
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Update git config
|
|
||||||
run: |
|
|
||||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --global user.name "github-actions[bot]"
|
|
||||||
shell: bash
|
|
||||||
14
.github/actions/update-bundle/action.yml
vendored
14
.github/actions/update-bundle/action.yml
vendored
@@ -1,14 +0,0 @@
|
|||||||
name: Update default CodeQL bundle
|
|
||||||
description: Updates 'src/defaults.json' to point to a new CodeQL bundle release.
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Install ts-node
|
|
||||||
shell: bash
|
|
||||||
run: npm install -g ts-node
|
|
||||||
|
|
||||||
- name: Run update script
|
|
||||||
working-directory: ${{ github.action_path }}
|
|
||||||
shell: bash
|
|
||||||
run: ts-node ./index.ts
|
|
||||||
67
.github/actions/update-bundle/index.ts
vendored
67
.github/actions/update-bundle/index.ts
vendored
@@ -1,67 +0,0 @@
|
|||||||
import * as fs from 'fs';
|
|
||||||
import * as github from '@actions/github';
|
|
||||||
|
|
||||||
interface BundleInfo {
|
|
||||||
bundleVersion: string;
|
|
||||||
cliVersion: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Defaults {
|
|
||||||
bundleVersion: string;
|
|
||||||
cliVersion: string;
|
|
||||||
priorBundleVersion: string;
|
|
||||||
priorCliVersion: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCodeQLCliVersionForRelease(release): string {
|
|
||||||
// We do not currently tag CodeQL bundles based on the CLI version they contain.
|
|
||||||
// Instead, we use a marker file `cli-version-<version>.txt` to record the CLI version.
|
|
||||||
// This marker file is uploaded as a release asset for all new CodeQL bundles.
|
|
||||||
const cliVersionsFromMarkerFiles = release.assets
|
|
||||||
.map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1])
|
|
||||||
.filter((v) => v)
|
|
||||||
.map((v) => v as string);
|
|
||||||
if (cliVersionsFromMarkerFiles.length > 1) {
|
|
||||||
throw new Error(
|
|
||||||
`Release ${release.tag_name} has multiple CLI version marker files.`
|
|
||||||
);
|
|
||||||
} else if (cliVersionsFromMarkerFiles.length === 0) {
|
|
||||||
throw new Error(
|
|
||||||
`Failed to find the CodeQL CLI version for release ${release.tag_name}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return cliVersionsFromMarkerFiles[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getBundleInfoFromRelease(release): Promise<BundleInfo> {
|
|
||||||
return {
|
|
||||||
bundleVersion: release.tag_name,
|
|
||||||
cliVersion: getCodeQLCliVersionForRelease(release)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getNewDefaults(currentDefaults: Defaults): Promise<Defaults> {
|
|
||||||
const release = github.context.payload.release;
|
|
||||||
console.log('Updating default bundle as a result of the following release: ' +
|
|
||||||
`${JSON.stringify(release)}.`)
|
|
||||||
|
|
||||||
const bundleInfo = await getBundleInfoFromRelease(release);
|
|
||||||
return {
|
|
||||||
bundleVersion: bundleInfo.bundleVersion,
|
|
||||||
cliVersion: bundleInfo.cliVersion,
|
|
||||||
priorBundleVersion: currentDefaults.bundleVersion,
|
|
||||||
priorCliVersion: currentDefaults.cliVersion
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8'));
|
|
||||||
const newDefaults = await getNewDefaults(previousDefaults);
|
|
||||||
// Update the source file in the repository. Calling workflows should subsequently rebuild
|
|
||||||
// the Action to update `lib/defaults.json`.
|
|
||||||
fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ideally, we'd await main() here, but that doesn't work well with `ts-node`.
|
|
||||||
// So instead we rely on the fact that Node won't exit until the event loop is empty.
|
|
||||||
main();
|
|
||||||
4
.github/codeql/codeql-actions-config.yml
vendored
4
.github/codeql/codeql-actions-config.yml
vendored
@@ -1,4 +0,0 @@
|
|||||||
# Configuration for the CodeQL Actions Queries
|
|
||||||
name: "CodeQL Actions Queries config"
|
|
||||||
queries:
|
|
||||||
- uses: security-and-quality
|
|
||||||
1
.github/codeql/codeql-config.yml
vendored
1
.github/codeql/codeql-config.yml
vendored
@@ -7,7 +7,6 @@ queries:
|
|||||||
# we include both even though one is a superset of the
|
# we include both even though one is a superset of the
|
||||||
# other, because we're testing the parsing logic and
|
# other, because we're testing the parsing logic and
|
||||||
# that the suites exist in the codeql bundle.
|
# that the suites exist in the codeql bundle.
|
||||||
- uses: security-experimental
|
|
||||||
- uses: security-extended
|
- uses: security-extended
|
||||||
- uses: security-and-quality
|
- uses: security-and-quality
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
|
|||||||
21
.github/copilot-instructions.md
vendored
21
.github/copilot-instructions.md
vendored
@@ -1,21 +0,0 @@
|
|||||||
# CodeQL Action - Copilot Instructions
|
|
||||||
|
|
||||||
## Generated code
|
|
||||||
|
|
||||||
The CodeQL Action is written in TypeScript and compiled to JavaScript. Both the TypeScript sources and the **generated** JavaScript code are contained in this repository. The TypeScript sources are contained in the `src` directory and the JavaScript code is contained in the `lib` directory. A GitHub Actions workflow checks that the JavaScript code in `lib` is up-to-date. Therefore, you should not review any changes to the contents of the `lib` folder and it is expected that the JavaScript code in `lib` closely mirrors the TypeScript code it is generated from.
|
|
||||||
|
|
||||||
GitHub Actions workflows in the `.github/workflows` directory whose filenames start with two underscores (e.g. `__all-platform-bundle.yml`) are automatically generated using the `pr-checks/sync.sh` script from template files in the `pr-checks/checks` directory. Therefore, you do not need to review files in the `.github/workflows` directory that start with two underscores. However, you should review changes to the `pr-checks` directory as well as workflows in the `.github/workflows` directory that do not start with underscores.
|
|
||||||
|
|
||||||
## Release process
|
|
||||||
|
|
||||||
- A release-PR is a PR which matches all of the following patterns:
|
|
||||||
- PR title starts with the exact prefix: `Merge main into releases/v`
|
|
||||||
- Equivalent regex: `^Merge main into releases\/v`
|
|
||||||
- AND head (source) branch matches the update-branch pattern:
|
|
||||||
- Regex: `^update-v[0-9]+(?:\.[0-9]+)*(?:-[a-f0-9]+)?` (e.g. `update-v3.29.9-cc722e476`)
|
|
||||||
- AND base (target) branch matches a release branch:
|
|
||||||
- Regex: `^releases\/v` (e.g. `releases/v3`)
|
|
||||||
|
|
||||||
- Consider all files in release-PRs to have already been reviewed and do not review them, except for the following two files:
|
|
||||||
- `CHANGELOG.md`
|
|
||||||
- `package.json`
|
|
||||||
43
.github/dependabot.yml
vendored
43
.github/dependabot.yml
vendored
@@ -1,37 +1,20 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: npm
|
- package-ecosystem: "npm"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: "weekly"
|
||||||
|
day: "thursday" # Gives us a working day to merge this before our typical release
|
||||||
labels:
|
labels:
|
||||||
- Rebuild
|
- "Update dependencies"
|
||||||
# Ignore incompatible dependency updates
|
|
||||||
ignore:
|
ignore:
|
||||||
# There is a type incompatibility issue between v0.0.9 and our other dependencies.
|
- dependency-name: "*"
|
||||||
- dependency-name: "@octokit/plugin-retry"
|
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
||||||
versions: ["~6.0.0"]
|
- package-ecosystem: "npm"
|
||||||
# This is broken due to the way configuration files have changed.
|
directory: "/runner"
|
||||||
# This might be fixed when we move to eslint v9.
|
|
||||||
- dependency-name: "eslint-plugin-import"
|
|
||||||
versions: [">=2.30.0"]
|
|
||||||
groups:
|
|
||||||
npm:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
- package-ecosystem: github-actions
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: "weekly"
|
||||||
groups:
|
day: "thursday" # Gives us a working day to merge this before our typical release
|
||||||
actions:
|
ignore:
|
||||||
patterns:
|
- dependency-name: "*"
|
||||||
- "*"
|
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
||||||
- package-ecosystem: github-actions
|
|
||||||
directory: "/.github/actions/setup-swift/" # All subdirectories outside of "/.github/workflows" must be explicitly included.
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
groups:
|
|
||||||
actions-setup-swift:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|||||||
39
.github/prepare-test/action.yml
vendored
Normal file
39
.github/prepare-test/action.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: "Prepare test"
|
||||||
|
description: Performs some preparation to run tests
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
required: true
|
||||||
|
outputs:
|
||||||
|
tools-url:
|
||||||
|
value: ${{ steps.get-url.outputs.tools-url }}
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Move codeql-action
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir ../action
|
||||||
|
mv * .github ../action/
|
||||||
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
|
mv ../action/.github/workflows .github
|
||||||
|
- id: get-url
|
||||||
|
name: Determine URL
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
|
||||||
|
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
|
||||||
|
echo "::set-output name=tools-url::https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz"
|
||||||
|
elif [[ ${{ inputs.version }} == *"nightly"* ]]; then
|
||||||
|
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
|
||||||
|
echo "::set-output name=tools-url::https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$VERSION-manual/codeql-bundle.tar.gz"
|
||||||
|
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
|
||||||
|
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
|
||||||
|
echo "Hello $VERSION"
|
||||||
|
echo "::set-output name=tools-url::https://github.com/github/codeql-action/releases/download/codeql-bundle-$VERSION/codeql-bundle.tar.gz"
|
||||||
|
elif [[ ${{ inputs.version }} == "latest" ]]; then
|
||||||
|
echo "::set-output name=tools-url::latest"
|
||||||
|
elif [[ ${{ inputs.version }} == "cached" ]]; then
|
||||||
|
echo "::set-output name=tools-url::"
|
||||||
|
else
|
||||||
|
echo "::error Unrecognized version specified!"
|
||||||
|
fi
|
||||||
15
.github/pull_request_template.md
vendored
15
.github/pull_request_template.md
vendored
@@ -1,14 +1,5 @@
|
|||||||
<!-- For GitHub staff: Remember that this is a public repository. -->
|
|
||||||
|
|
||||||
### Risk assessment
|
|
||||||
|
|
||||||
For internal use only. Please select the risk level of this change:
|
|
||||||
|
|
||||||
- **Low risk:** Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.
|
|
||||||
- **High risk:** Changes are not fully under feature flags, have limited visibility and/or cannot be tested outside of production.
|
|
||||||
|
|
||||||
### Merge / deployment checklist
|
### Merge / deployment checklist
|
||||||
|
|
||||||
- Confirm this change is backwards compatible with existing workflows.
|
- [ ] Confirm this change is backwards compatible with existing workflows.
|
||||||
- Consider adding a [changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) entry for this change.
|
- [ ] Confirm the [readme](https://github.com/github/codeql-action/blob/main/README.md) has been updated if necessary.
|
||||||
- Confirm the [readme](https://github.com/github/codeql-action/blob/main/README.md) and docs have been updated if necessary.
|
- [ ] Confirm the [changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) has been updated if necessary.
|
||||||
|
|||||||
1
.github/releases.ini
vendored
1
.github/releases.ini
vendored
@@ -1 +0,0 @@
|
|||||||
OLDEST_SUPPORTED_MAJOR_VERSION=3
|
|
||||||
357
.github/update-release-branch.py
vendored
357
.github/update-release-branch.py
vendored
@@ -1,13 +1,14 @@
|
|||||||
import argparse
|
|
||||||
import datetime
|
import datetime
|
||||||
import fileinput
|
|
||||||
import re
|
|
||||||
from github import Github
|
from github import Github
|
||||||
import json
|
import random
|
||||||
import os
|
import requests
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import datetime
|
||||||
|
import os
|
||||||
|
|
||||||
EMPTY_CHANGELOG = """# CodeQL Action Changelog
|
EMPTY_CHANGELOG = """# CodeQL Action and CodeQL Runner Changelog
|
||||||
|
|
||||||
## [UNRELEASED]
|
## [UNRELEASED]
|
||||||
|
|
||||||
@@ -15,45 +16,44 @@ No user facing changes.
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# NB: This exact commit message is used to find commits for reverting during backports.
|
# The branch being merged from.
|
||||||
# Changing it requires a transition period where both old and new versions are supported.
|
# This is the one that contains day-to-day development work.
|
||||||
BACKPORT_COMMIT_MESSAGE = 'Update version and changelog for v'
|
MAIN_BRANCH = 'main'
|
||||||
|
# The branch being merged into.
|
||||||
|
# This is the release branch that users reference.
|
||||||
|
LATEST_RELEASE_BRANCH = 'v1'
|
||||||
# Name of the remote
|
# Name of the remote
|
||||||
ORIGIN = 'origin'
|
ORIGIN = 'origin'
|
||||||
|
|
||||||
# Runs git with the given args and returns the stdout.
|
# Runs git with the given args and returns the stdout.
|
||||||
# Raises an error if git does not exit successfully (unless passed
|
# Raises an error if git does not exit successfully.
|
||||||
# allow_non_zero_exit_code=True).
|
def run_git(*args):
|
||||||
def run_git(*args, allow_non_zero_exit_code=False):
|
|
||||||
cmd = ['git', *args]
|
cmd = ['git', *args]
|
||||||
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if not allow_non_zero_exit_code and p.returncode != 0:
|
if (p.returncode != 0):
|
||||||
raise Exception(f'Call to {" ".join(cmd)} exited with code {p.returncode} stderr: {p.stderr.decode("ascii")}.')
|
raise Exception('Call to ' + ' '.join(cmd) + ' exited with code ' + str(p.returncode) + ' stderr:' + p.stderr.decode('ascii'))
|
||||||
return p.stdout.decode('ascii')
|
return p.stdout.decode('ascii')
|
||||||
|
|
||||||
# Returns true if the given branch exists on the origin remote
|
# Returns true if the given branch exists on the origin remote
|
||||||
def branch_exists_on_remote(branch_name):
|
def branch_exists_on_remote(branch_name):
|
||||||
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''
|
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''
|
||||||
|
|
||||||
# Opens a PR from the given branch to the target branch
|
# Opens a PR from the given branch to the release branch
|
||||||
def open_pr(
|
def open_pr(repo, all_commits, short_main_sha, branch_name):
|
||||||
repo, all_commits, source_branch_short_sha, new_branch_name, source_branch, target_branch,
|
|
||||||
conductor, is_primary_release, conflicted_files):
|
|
||||||
# Sort the commits into the pull requests that introduced them,
|
# Sort the commits into the pull requests that introduced them,
|
||||||
# and any commits that don't have a pull request
|
# and any commits that don't have a pull request
|
||||||
pull_requests = []
|
pull_requests = []
|
||||||
commits_without_pull_requests = []
|
commits_without_pull_requests = []
|
||||||
for commit in all_commits:
|
for commit in all_commits:
|
||||||
pr = get_pr_for_commit(commit)
|
pr = get_pr_for_commit(repo, commit)
|
||||||
|
|
||||||
if pr is None:
|
if pr is None:
|
||||||
commits_without_pull_requests.append(commit)
|
commits_without_pull_requests.append(commit)
|
||||||
elif not any(p for p in pull_requests if p.number == pr.number):
|
elif not any(p for p in pull_requests if p.number == pr.number):
|
||||||
pull_requests.append(pr)
|
pull_requests.append(pr)
|
||||||
|
|
||||||
print(f'Found {len(pull_requests)} pull requests.')
|
print('Found ' + str(len(pull_requests)) + ' pull requests')
|
||||||
print(f'Found {len(commits_without_pull_requests)} commits not in a pull request.')
|
print('Found ' + str(len(commits_without_pull_requests)) + ' commits not in a pull request')
|
||||||
|
|
||||||
# Sort PRs and commits by age
|
# Sort PRs and commits by age
|
||||||
pull_requests = sorted(pull_requests, key=lambda pr: pr.number)
|
pull_requests = sorted(pull_requests, key=lambda pr: pr.number)
|
||||||
@@ -61,10 +61,11 @@ def open_pr(
|
|||||||
|
|
||||||
# Start constructing the body text
|
# Start constructing the body text
|
||||||
body = []
|
body = []
|
||||||
body.append(f'Merging {source_branch_short_sha} into `{target_branch}`.')
|
body.append('Merging ' + short_main_sha + ' into ' + LATEST_RELEASE_BRANCH)
|
||||||
|
|
||||||
|
conductor = get_conductor(repo, pull_requests, commits_without_pull_requests)
|
||||||
body.append('')
|
body.append('')
|
||||||
body.append(f'Conductor for this PR is @{conductor}.')
|
body.append('Conductor for this PR is @' + conductor)
|
||||||
|
|
||||||
# List all PRs merged
|
# List all PRs merged
|
||||||
if len(pull_requests) > 0:
|
if len(pull_requests) > 0:
|
||||||
@@ -72,63 +73,50 @@ def open_pr(
|
|||||||
body.append('Contains the following pull requests:')
|
body.append('Contains the following pull requests:')
|
||||||
for pr in pull_requests:
|
for pr in pull_requests:
|
||||||
merger = get_merger_of_pr(repo, pr)
|
merger = get_merger_of_pr(repo, pr)
|
||||||
body.append(f'- #{pr.number} (@{merger})')
|
body.append('- #' + str(pr.number) + ' - ' + pr.title +' (@' + merger + ')')
|
||||||
|
|
||||||
# List all commits not part of a PR
|
# List all commits not part of a PR
|
||||||
if len(commits_without_pull_requests) > 0:
|
if len(commits_without_pull_requests) > 0:
|
||||||
body.append('')
|
body.append('')
|
||||||
body.append('Contains the following commits not from a pull request:')
|
body.append('Contains the following commits not from a pull request:')
|
||||||
for commit in commits_without_pull_requests:
|
for commit in commits_without_pull_requests:
|
||||||
author_description = f' (@{commit.author.login})' if commit.author is not None else ''
|
body.append('- ' + commit.sha + ' - ' + get_truncated_commit_message(commit) + ' (@' + commit.author.login + ')')
|
||||||
body.append(f'- {commit.sha} - {get_truncated_commit_message(commit)}{author_description}')
|
|
||||||
|
|
||||||
body.append('')
|
body.append('')
|
||||||
body.append('Please do the following:')
|
body.append('Please review the following:')
|
||||||
if len(conflicted_files) > 0:
|
body.append(' - [ ] The CHANGELOG displays the correct version and date.')
|
||||||
body.append(' - [ ] Ensure `package.json` file contains the correct version.')
|
body.append(' - [ ] The CHANGELOG includes all relevant, user-facing changes since the last release.')
|
||||||
body.append(' - [ ] Add commits to this branch to resolve the merge conflicts ' +
|
body.append(' - [ ] There are no unexpected commits being merged into the ' + LATEST_RELEASE_BRANCH + ' branch.')
|
||||||
'in the following files:')
|
body.append(' - [ ] The docs team is aware of any documentation changes that need to be released.')
|
||||||
body.extend([f' - [ ] `{file}`' for file in conflicted_files])
|
body.append(' - [ ] The mergeback PR is merged back into ' + MAIN_BRANCH + ' after this PR is merged.')
|
||||||
body.append(' - [ ] Ensure another maintainer has reviewed the additional commits you added to this ' +
|
|
||||||
'branch to resolve the merge conflicts.')
|
|
||||||
body.append(' - [ ] Ensure the CHANGELOG displays the correct version and date.')
|
|
||||||
body.append(' - [ ] Ensure the CHANGELOG includes all relevant, user-facing changes since the last release.')
|
|
||||||
body.append(f' - [ ] Check that there are not any unexpected commits being merged into the `{target_branch}` branch.')
|
|
||||||
body.append(' - [ ] Ensure the docs team is aware of any documentation changes that need to be released.')
|
|
||||||
|
|
||||||
if not is_primary_release:
|
title = 'Merge ' + MAIN_BRANCH + ' into ' + LATEST_RELEASE_BRANCH
|
||||||
body.append(' - [ ] Remove and re-add the "Rebuild" label to the PR to trigger just this workflow.')
|
|
||||||
body.append(' - [ ] Wait for the "Rebuild" workflow to push a commit updating the distribution files.')
|
|
||||||
|
|
||||||
body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.')
|
|
||||||
body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.')
|
|
||||||
|
|
||||||
if is_primary_release:
|
|
||||||
body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.')
|
|
||||||
body.append(' - [ ] Merge all backport PRs to older release branches, that will automatically be created once this PR is merged.')
|
|
||||||
|
|
||||||
title = f'Merge {source_branch} into {target_branch}'
|
|
||||||
labels = ['Rebuild'] if not is_primary_release else []
|
|
||||||
|
|
||||||
# Create the pull request
|
# Create the pull request
|
||||||
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that
|
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that
|
||||||
# a maintainer can take the PR out of draft, thereby triggering the PR checks.
|
# a maintainer can take the PR out of draft, thereby triggering the PR checks.
|
||||||
pr = repo.create_pull(title=title, body='\n'.join(body), head=new_branch_name, base=target_branch, draft=True)
|
pr = repo.create_pull(title=title, body='\n'.join(body), head=branch_name, base=LATEST_RELEASE_BRANCH, draft=True)
|
||||||
pr.add_to_labels(*labels)
|
print('Created PR #' + str(pr.number))
|
||||||
print(f'Created PR #{str(pr.number)}')
|
|
||||||
|
|
||||||
# Assign the conductor
|
# Assign the conductor
|
||||||
pr.add_to_assignees(conductor)
|
pr.add_to_assignees(conductor)
|
||||||
print(f'Assigned PR to {conductor}')
|
print('Assigned PR to ' + conductor)
|
||||||
|
|
||||||
# Gets a list of the SHAs of all commits that have happened on the source branch
|
# Gets the person who should be in charge of the mergeback PR
|
||||||
# since the last release to the target branch.
|
def get_conductor(repo, pull_requests, other_commits):
|
||||||
# This will not include any commits that exist on the target branch
|
# If there are any PRs then use whoever merged the last one
|
||||||
# that aren't on the source branch.
|
if len(pull_requests) > 0:
|
||||||
def get_commit_difference(repo, source_branch, target_branch):
|
return get_merger_of_pr(repo, pull_requests[-1])
|
||||||
# Passing split nothing means that the empty string splits to nothing: compare `''.split() == []`
|
|
||||||
# to `''.split('\n') == ['']`.
|
# Otherwise take the author of the latest commit
|
||||||
commits = run_git('log', '--pretty=format:%H', f'{ORIGIN}/{target_branch}..{ORIGIN}/{source_branch}').strip().split()
|
return other_commits[-1].author.login
|
||||||
|
|
||||||
|
# Gets a list of the SHAs of all commits that have happened on main
|
||||||
|
# since the release branched off.
|
||||||
|
# This will not include any commits that exist on the release branch
|
||||||
|
# that aren't on main.
|
||||||
|
def get_commit_difference(repo):
|
||||||
|
commits = run_git('log', '--pretty=format:%H', ORIGIN + '/' + LATEST_RELEASE_BRANCH + '..' + ORIGIN + '/' + MAIN_BRANCH).strip().split('\n')
|
||||||
|
|
||||||
# Convert to full-fledged commit objects
|
# Convert to full-fledged commit objects
|
||||||
commits = [repo.get_commit(c) for c in commits]
|
commits = [repo.get_commit(c) for c in commits]
|
||||||
@@ -144,13 +132,13 @@ def is_pr_merge_commit(commit):
|
|||||||
def get_truncated_commit_message(commit):
|
def get_truncated_commit_message(commit):
|
||||||
message = commit.commit.message.split('\n')[0]
|
message = commit.commit.message.split('\n')[0]
|
||||||
if len(message) > 60:
|
if len(message) > 60:
|
||||||
return f'{message[:57]}...'
|
return message[:57] + '...'
|
||||||
else:
|
else:
|
||||||
return message
|
return message
|
||||||
|
|
||||||
# Converts a commit into the PR that introduced it to the source branch.
|
# Converts a commit into the PR that introduced it to the main branch.
|
||||||
# Returns the PR object, or None if no PR could be found.
|
# Returns the PR object, or None if no PR could be found.
|
||||||
def get_pr_for_commit(commit):
|
def get_pr_for_commit(repo, commit):
|
||||||
prs = commit.get_pulls()
|
prs = commit.get_pulls()
|
||||||
|
|
||||||
if prs.totalCount > 0:
|
if prs.totalCount > 0:
|
||||||
@@ -172,78 +160,10 @@ def get_current_version():
|
|||||||
with open('package.json', 'r') as f:
|
with open('package.json', 'r') as f:
|
||||||
return json.load(f)['version']
|
return json.load(f)['version']
|
||||||
|
|
||||||
# `npm version` doesn't always work because of merge conflicts, so we
|
|
||||||
# replace the version in package.json textually.
|
|
||||||
def replace_version_package_json(prev_version, new_version):
|
|
||||||
prev_line_is_codeql = False
|
|
||||||
for line in fileinput.input('package.json', inplace = True, encoding='utf-8'):
|
|
||||||
if prev_line_is_codeql and f'\"version\": \"{prev_version}\"' in line:
|
|
||||||
print(line.replace(prev_version, new_version), end='')
|
|
||||||
else:
|
|
||||||
prev_line_is_codeql = False
|
|
||||||
print(line, end='')
|
|
||||||
if '\"name\": \"codeql\",' in line:
|
|
||||||
prev_line_is_codeql = True
|
|
||||||
|
|
||||||
def get_today_string():
|
def get_today_string():
|
||||||
today = datetime.datetime.today()
|
today = datetime.datetime.today()
|
||||||
return '{:%d %b %Y}'.format(today)
|
return '{:%d %b %Y}'.format(today)
|
||||||
|
|
||||||
def process_changelog_for_backports(source_branch_major_version, target_branch_major_version):
|
|
||||||
|
|
||||||
# changelog entries can use the following format to indicate
|
|
||||||
# that they only apply to newer versions
|
|
||||||
some_versions_only_regex = re.compile(r'\[v(\d+)\+ only\]')
|
|
||||||
|
|
||||||
output = ''
|
|
||||||
|
|
||||||
with open('CHANGELOG.md', 'r') as f:
|
|
||||||
|
|
||||||
# until we find the first section, just duplicate all lines
|
|
||||||
found_first_section = False
|
|
||||||
while not found_first_section:
|
|
||||||
line = f.readline()
|
|
||||||
if not line:
|
|
||||||
raise Exception('Could not find any change sections in CHANGELOG.md') # EOF
|
|
||||||
|
|
||||||
if line.startswith('## '):
|
|
||||||
line = line.replace(f'## {source_branch_major_version}', f'## {target_branch_major_version}')
|
|
||||||
found_first_section = True
|
|
||||||
|
|
||||||
output += line
|
|
||||||
|
|
||||||
# found_content tracks whether we hit two headings in a row
|
|
||||||
found_content = False
|
|
||||||
output += '\n'
|
|
||||||
while True:
|
|
||||||
line = f.readline()
|
|
||||||
if not line:
|
|
||||||
break # EOF
|
|
||||||
line = line.rstrip('\n')
|
|
||||||
|
|
||||||
# filter out changenote entries that apply only to newer versions
|
|
||||||
match = some_versions_only_regex.search(line)
|
|
||||||
if match:
|
|
||||||
if int(target_branch_major_version) < int(match.group(1)):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if line.startswith('## '):
|
|
||||||
line = line.replace(f'## {source_branch_major_version}', f'## {target_branch_major_version}')
|
|
||||||
if found_content == False:
|
|
||||||
# we have found two headings in a row, so we need to add the placeholder message.
|
|
||||||
output += 'No user facing changes.\n'
|
|
||||||
found_content = False
|
|
||||||
output += f'\n{line}\n\n'
|
|
||||||
else:
|
|
||||||
if line.strip() != '':
|
|
||||||
found_content = True
|
|
||||||
# we use the original line here, rather than the stripped version
|
|
||||||
# so that we preserve indentation
|
|
||||||
output += line + '\n'
|
|
||||||
|
|
||||||
with open('CHANGELOG.md', 'w') as f:
|
|
||||||
f.write(output)
|
|
||||||
|
|
||||||
def update_changelog(version):
|
def update_changelog(version):
|
||||||
if (os.path.exists('CHANGELOG.md')):
|
if (os.path.exists('CHANGELOG.md')):
|
||||||
content = ''
|
content = ''
|
||||||
@@ -252,180 +172,59 @@ def update_changelog(version):
|
|||||||
else:
|
else:
|
||||||
content = EMPTY_CHANGELOG
|
content = EMPTY_CHANGELOG
|
||||||
|
|
||||||
newContent = content.replace('[UNRELEASED]', f'{version} - {get_today_string()}', 1)
|
newContent = content.replace('[UNRELEASED]', version + ' - ' + get_today_string(), 1)
|
||||||
|
|
||||||
with open('CHANGELOG.md', 'w') as f:
|
with open('CHANGELOG.md', 'w') as f:
|
||||||
f.write(newContent)
|
f.write(newContent)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser('update-release-branch.py')
|
if len(sys.argv) != 3:
|
||||||
|
raise Exception('Usage: update-release.branch.py <github token> <repository nwo>')
|
||||||
|
github_token = sys.argv[1]
|
||||||
|
repository_nwo = sys.argv[2]
|
||||||
|
|
||||||
parser.add_argument(
|
repo = Github(github_token).get_repo(repository_nwo)
|
||||||
'--github-token',
|
version = get_current_version()
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help='GitHub token, typically from GitHub Actions.'
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
'--repository-nwo',
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help='The nwo of the repository, for example github/codeql-action.'
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
'--source-branch',
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help='Source branch for release branch update.'
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
'--target-branch',
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help='Target branch for release branch update.'
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
'--is-primary-release',
|
|
||||||
action='store_true',
|
|
||||||
default=False,
|
|
||||||
help='Whether this update is the primary release for the current major version.'
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
'--conductor',
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
help='The GitHub handle of the person who is conducting the release process.'
|
|
||||||
)
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
source_branch = args.source_branch
|
|
||||||
target_branch = args.target_branch
|
|
||||||
is_primary_release = args.is_primary_release
|
|
||||||
|
|
||||||
repo = Github(args.github_token).get_repo(args.repository_nwo)
|
|
||||||
|
|
||||||
# the target branch will be of the form releases/vN, where N is the major version number
|
|
||||||
target_branch_major_version = target_branch.strip('releases/v')
|
|
||||||
|
|
||||||
# split version into major, minor, patch
|
|
||||||
_, v_minor, v_patch = get_current_version().split('.')
|
|
||||||
|
|
||||||
version = f"{target_branch_major_version}.{v_minor}.{v_patch}"
|
|
||||||
|
|
||||||
# Print what we intend to go
|
# Print what we intend to go
|
||||||
print(f'Considering difference between {source_branch} and {target_branch}...')
|
print('Considering difference between ' + MAIN_BRANCH + ' and ' + LATEST_RELEASE_BRANCH)
|
||||||
source_branch_short_sha = run_git('rev-parse', '--short', f'{ORIGIN}/{source_branch}').strip()
|
short_main_sha = run_git('rev-parse', '--short', ORIGIN + '/' + MAIN_BRANCH).strip()
|
||||||
print(f'Current head of {source_branch} is {source_branch_short_sha}.')
|
print('Current head of ' + MAIN_BRANCH + ' is ' + short_main_sha)
|
||||||
|
|
||||||
# See if there are any commits to merge in
|
# See if there are any commits to merge in
|
||||||
commits = get_commit_difference(repo=repo, source_branch=source_branch, target_branch=target_branch)
|
commits = get_commit_difference(repo)
|
||||||
if len(commits) == 0:
|
if len(commits) == 0:
|
||||||
print(f'No commits to merge from {source_branch} to {target_branch}.')
|
print('No commits to merge from ' + MAIN_BRANCH + ' to ' + LATEST_RELEASE_BRANCH)
|
||||||
return
|
return
|
||||||
|
|
||||||
# define distinct prefix in order to support specific pr checks on backports
|
|
||||||
branch_prefix = 'update' if is_primary_release else 'backport'
|
|
||||||
|
|
||||||
# The branch name is based off of the name of branch being merged into
|
# The branch name is based off of the name of branch being merged into
|
||||||
# and the SHA of the branch being merged from. Thus if the branch already
|
# and the SHA of the branch being merged from. Thus if the branch already
|
||||||
# exists we can assume we don't need to recreate it.
|
# exists we can assume we don't need to recreate it.
|
||||||
new_branch_name = f'{branch_prefix}-v{version}-{source_branch_short_sha}'
|
new_branch_name = 'update-v' + version + '-' + short_main_sha
|
||||||
print(f'Branch name is {new_branch_name}.')
|
print('Branch name is ' + new_branch_name)
|
||||||
|
|
||||||
# Check if the branch already exists. If so we can abort as this script
|
# Check if the branch already exists. If so we can abort as this script
|
||||||
# has already run on this combination of branches.
|
# has already run on this combination of branches.
|
||||||
if branch_exists_on_remote(new_branch_name):
|
if branch_exists_on_remote(new_branch_name):
|
||||||
print(f'Branch {new_branch_name} already exists. Nothing to do.')
|
print('Branch ' + new_branch_name + ' already exists. Nothing to do.')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Create the new branch and push it to the remote
|
# Create the new branch and push it to the remote
|
||||||
print(f'Creating branch {new_branch_name}.')
|
print('Creating branch ' + new_branch_name)
|
||||||
|
run_git('checkout', '-b', new_branch_name, ORIGIN + '/' + MAIN_BRANCH)
|
||||||
|
|
||||||
# The process of creating the v{Older} release can run into merge conflicts. We commit the unresolved
|
print('Updating changelog')
|
||||||
# conflicts so a maintainer can easily resolve them (vs erroring and requiring maintainers to
|
update_changelog(version)
|
||||||
# reconstruct the release manually)
|
|
||||||
conflicted_files = []
|
|
||||||
|
|
||||||
if not is_primary_release:
|
# Create a commit that updates the CHANGELOG
|
||||||
|
run_git('add', 'CHANGELOG.md')
|
||||||
# the source branch will be of the form releases/vN, where N is the major version number
|
run_git('commit', '-m', version)
|
||||||
source_branch_major_version = source_branch.strip('releases/v')
|
|
||||||
|
|
||||||
# If we're performing a backport, start from the target branch
|
|
||||||
print(f'Creating {new_branch_name} from the {ORIGIN}/{target_branch} branch')
|
|
||||||
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{target_branch}')
|
|
||||||
|
|
||||||
# Revert the commit that we made as part of the last release that updated the version number and
|
|
||||||
# changelog to refer to {older}.x.x variants. This avoids merge conflicts in the changelog and
|
|
||||||
# package.json files when we merge in the v{latest} branch.
|
|
||||||
# This commit will not exist the first time we release the v{N-1} branch from the v{N} branch, so we
|
|
||||||
# use `git log --grep` to conditionally revert the commit.
|
|
||||||
print('Reverting the version number and changelog updates from the last release to avoid conflicts')
|
|
||||||
vOlder_update_commits = run_git('log', '--grep', f'^{BACKPORT_COMMIT_MESSAGE}', '--format=%H').split()
|
|
||||||
|
|
||||||
if len(vOlder_update_commits) > 0:
|
|
||||||
print(f' Reverting {vOlder_update_commits[0]}')
|
|
||||||
# Only revert the newest commit as older ones will already have been reverted in previous
|
|
||||||
# releases.
|
|
||||||
run_git('revert', vOlder_update_commits[0], '--no-edit')
|
|
||||||
|
|
||||||
# Also revert the "Update checked-in dependencies" commit created by Actions.
|
|
||||||
update_dependencies_commit = run_git('log', '--grep', '^Update checked-in dependencies', '--format=%H').split()[0]
|
|
||||||
print(f' Reverting {update_dependencies_commit}')
|
|
||||||
run_git('revert', update_dependencies_commit, '--no-edit')
|
|
||||||
|
|
||||||
else:
|
|
||||||
print(' Nothing to revert.')
|
|
||||||
|
|
||||||
print(f'Merging {ORIGIN}/{source_branch} into the release prep branch')
|
|
||||||
# Commit any conflicts (see the comment for `conflicted_files`)
|
|
||||||
run_git('merge', f'{ORIGIN}/{source_branch}', allow_non_zero_exit_code=True)
|
|
||||||
conflicted_files = run_git('diff', '--name-only', '--diff-filter', 'U').splitlines()
|
|
||||||
if len(conflicted_files) > 0:
|
|
||||||
run_git('add', '.')
|
|
||||||
run_git('commit', '--no-edit')
|
|
||||||
|
|
||||||
# Migrate the package version number from a vLatest version number to a vOlder version number
|
|
||||||
print(f'Setting version number to {version} in package.json')
|
|
||||||
replace_version_package_json(get_current_version(), version) # We rely on the `Rebuild` workflow to update package-lock.json
|
|
||||||
run_git('add', 'package.json')
|
|
||||||
|
|
||||||
# Migrate the changelog notes from vLatest version numbers to vOlder version numbers
|
|
||||||
print(f'Migrating changelog notes from v{source_branch_major_version} to v{target_branch_major_version}')
|
|
||||||
process_changelog_for_backports(source_branch_major_version, target_branch_major_version)
|
|
||||||
|
|
||||||
# Amend the commit generated by `npm version` to update the CHANGELOG
|
|
||||||
run_git('add', 'CHANGELOG.md')
|
|
||||||
run_git('commit', '-m', f'{BACKPORT_COMMIT_MESSAGE}{version}')
|
|
||||||
else:
|
|
||||||
# If we're performing a standard release, there won't be any new commits on the target branch,
|
|
||||||
# as these will have already been merged back into the source branch. Therefore we can just
|
|
||||||
# start from the source branch.
|
|
||||||
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{source_branch}')
|
|
||||||
|
|
||||||
print('Updating changelog')
|
|
||||||
update_changelog(version)
|
|
||||||
|
|
||||||
# Create a commit that updates the CHANGELOG
|
|
||||||
run_git('add', 'CHANGELOG.md')
|
|
||||||
run_git('commit', '-m', f'Update changelog for v{version}')
|
|
||||||
|
|
||||||
run_git('push', ORIGIN, new_branch_name)
|
run_git('push', ORIGIN, new_branch_name)
|
||||||
|
|
||||||
# Open a PR to update the branch
|
# Open a PR to update the branch
|
||||||
open_pr(
|
open_pr(repo, commits, short_main_sha, new_branch_name)
|
||||||
repo,
|
|
||||||
commits,
|
|
||||||
source_branch_short_sha,
|
|
||||||
new_branch_name,
|
|
||||||
source_branch=source_branch,
|
|
||||||
target_branch=target_branch,
|
|
||||||
conductor=args.conductor,
|
|
||||||
is_primary_release=is_primary_release,
|
|
||||||
conflicted_files=conflicted_files
|
|
||||||
)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
79
.github/workflows/__all-platform-bundle.yml
generated
vendored
79
.github/workflows/__all-platform-bundle.yml
generated
vendored
@@ -1,79 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - All-platform bundle
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
all-platform-bundle:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: All-platform bundle
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'true'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- id: init
|
|
||||||
uses: ./../action/init
|
|
||||||
with:
|
|
||||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
|
||||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
86
.github/workflows/__analyze-ref-input.yml
generated
vendored
86
.github/workflows/__analyze-ref-input.yml
generated
vendored
@@ -1,86 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: "PR Check - Analyze: 'ref' and 'sha' from inputs"
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
analyze-ref-input:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
name: "Analyze: 'ref' and 'sha' from inputs"
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
languages: cpp,csharp,java,javascript,python
|
|
||||||
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
|
||||||
github.sha }}
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
ref: refs/heads/main
|
|
||||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
80
.github/workflows/__autobuild-action.yml
generated
vendored
80
.github/workflows/__autobuild-action.yml
generated
vendored
@@ -1,80 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - autobuild-action
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
autobuild-action:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
name: autobuild-action
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: csharp
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
env:
|
|
||||||
# Explicitly disable the CLR tracer.
|
|
||||||
COR_ENABLE_PROFILING: ''
|
|
||||||
COR_PROFILER: ''
|
|
||||||
COR_PROFILER_PATH_64: ''
|
|
||||||
CORECLR_ENABLE_PROFILING: ''
|
|
||||||
CORECLR_PROFILER: ''
|
|
||||||
CORECLR_PROFILER_PATH_64: ''
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
- name: Check database
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
|
||||||
if [[ ! -d csharp ]]; then
|
|
||||||
echo "Did not find a C# database"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
99
.github/workflows/__autobuild-direct-tracing-with-working-dir.yml
generated
vendored
99
.github/workflows/__autobuild-direct-tracing-with-working-dir.yml
generated
vendored
@@ -1,99 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Autobuild direct tracing (custom working directory)
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
java-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Java to install
|
|
||||||
required: false
|
|
||||||
default: '17'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
java-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Java to install
|
|
||||||
required: false
|
|
||||||
default: '17'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
autobuild-direct-tracing-with-working-dir:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Autobuild direct tracing (custom working directory)
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Java
|
|
||||||
uses: actions/setup-java@v5
|
|
||||||
with:
|
|
||||||
java-version: ${{ inputs.java-version || '17' }}
|
|
||||||
distribution: temurin
|
|
||||||
- name: Test setup
|
|
||||||
run: |
|
|
||||||
# Make sure that Gradle build succeeds in autobuild-dir ...
|
|
||||||
cp -a ../action/tests/java-repo autobuild-dir
|
|
||||||
# ... and fails if attempted in the current directory
|
|
||||||
echo > build.gradle
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
build-mode: autobuild
|
|
||||||
languages: java
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Check that indirect tracing is disabled
|
|
||||||
run: |
|
|
||||||
if [[ ! -z "${CODEQL_RUNNER}" ]]; then
|
|
||||||
echo "Expected indirect tracing to be disabled, but the" \
|
|
||||||
"CODEQL_RUNNER environment variable is set."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
with:
|
|
||||||
working-directory: autobuild-dir
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING: true
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
100
.github/workflows/__autobuild-direct-tracing.yml
generated
vendored
100
.github/workflows/__autobuild-direct-tracing.yml
generated
vendored
@@ -1,100 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Autobuild direct tracing
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
java-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Java to install
|
|
||||||
required: false
|
|
||||||
default: '17'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
java-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Java to install
|
|
||||||
required: false
|
|
||||||
default: '17'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
autobuild-direct-tracing:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Autobuild direct tracing
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Java
|
|
||||||
uses: actions/setup-java@v5
|
|
||||||
with:
|
|
||||||
java-version: ${{ inputs.java-version || '17' }}
|
|
||||||
distribution: temurin
|
|
||||||
- name: Set up Java test repo configuration
|
|
||||||
run: |
|
|
||||||
mv * .github ../action/tests/multi-language-repo/
|
|
||||||
mv ../action/tests/multi-language-repo/.github/workflows .github
|
|
||||||
mv ../action/tests/java-repo/* .
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
build-mode: autobuild
|
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
|
||||||
languages: java
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Check that indirect tracing is disabled
|
|
||||||
run: |
|
|
||||||
if [[ ! -z "${CODEQL_RUNNER}" ]]; then
|
|
||||||
echo "Expected indirect tracing to be disabled, but the" \
|
|
||||||
"CODEQL_RUNNER environment variable is set."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING: true
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
79
.github/workflows/__build-mode-autobuild.yml
generated
vendored
79
.github/workflows/__build-mode-autobuild.yml
generated
vendored
@@ -1,79 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Build mode autobuild
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
build-mode-autobuild:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Build mode autobuild
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Set up Java test repo configuration
|
|
||||||
run: |
|
|
||||||
mv * .github ../action/tests/multi-language-repo/
|
|
||||||
mv ../action/tests/multi-language-repo/.github/workflows .github
|
|
||||||
mv ../action/tests/java-repo/* .
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
build-mode: autobuild
|
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
|
||||||
languages: java
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Validate database build mode
|
|
||||||
run: |
|
|
||||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
|
||||||
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
|
||||||
if [[ "$build_mode" != "autobuild" ]]; then
|
|
||||||
echo "Expected build mode to be 'autobuild' but was $build_mode"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
91
.github/workflows/__build-mode-manual.yml
generated
vendored
91
.github/workflows/__build-mode-manual.yml
generated
vendored
@@ -1,91 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Build mode manual
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
build-mode-manual:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Build mode manual
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
build-mode: manual
|
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
|
||||||
languages: java
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Validate database build mode
|
|
||||||
run: |
|
|
||||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
|
||||||
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
|
||||||
if [[ "$build_mode" != "manual" ]]; then
|
|
||||||
echo "Expected build mode to be 'manual' but was $build_mode"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
79
.github/workflows/__build-mode-none.yml
generated
vendored
79
.github/workflows/__build-mode-none.yml
generated
vendored
@@ -1,79 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Build mode none
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
build-mode-none:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Build mode none
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
build-mode: none
|
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
|
||||||
languages: java
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Validate database build mode
|
|
||||||
run: |
|
|
||||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
|
||||||
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
|
||||||
if [[ "$build_mode" != "none" ]]; then
|
|
||||||
echo "Expected build mode to be 'none' but was $build_mode"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# The latest nightly supports omitting the autobuild Action when the build mode is specified.
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
if: matrix.version != 'nightly-latest'
|
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
80
.github/workflows/__build-mode-rollback.yml
generated
vendored
80
.github/workflows/__build-mode-rollback.yml
generated
vendored
@@ -1,80 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Build mode rollback
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
build-mode-rollback:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Build mode rollback
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Set up Java test repo configuration
|
|
||||||
run: |
|
|
||||||
mv * .github ../action/tests/multi-language-repo/
|
|
||||||
mv ../action/tests/multi-language-repo/.github/workflows .github
|
|
||||||
mv ../action/tests/java-repo/* .
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
build-mode: none
|
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
|
||||||
languages: java
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Validate database build mode
|
|
||||||
run: |
|
|
||||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
|
||||||
build_mode=$(yq eval '.buildMode' "$metadata_path")
|
|
||||||
if [[ "$build_mode" != "autobuild" ]]; then
|
|
||||||
echo "Expected build mode to be 'autobuild' but was $build_mode"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_DISABLE_JAVA_BUILDLESS: true
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
101
.github/workflows/__bundle-toolcache.yml
generated
vendored
101
.github/workflows/__bundle-toolcache.yml
generated
vendored
@@ -1,101 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Bundle: Caching checks'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
bundle-toolcache:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
name: 'Bundle: Caching checks'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Remove CodeQL from toolcache
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
|
|
||||||
fs.rmdirSync(codeqlPath, { recursive: true });
|
|
||||||
- name: Install @actions/tool-cache
|
|
||||||
run: npm install @actions/tool-cache
|
|
||||||
- name: Check toolcache does not contain CodeQL
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const toolcache = require('@actions/tool-cache');
|
|
||||||
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
|
||||||
if (allCodeqlVersions.length !== 0) {
|
|
||||||
throw new Error(`CodeQL should not be found in the toolcache, but found ${allCodeqlVersions}`);
|
|
||||||
}
|
|
||||||
console.log('No versions of CodeQL found in the toolcache');
|
|
||||||
- id: init
|
|
||||||
uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Check CodeQL is installed within the toolcache
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const toolcache = require('@actions/tool-cache');
|
|
||||||
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
|
||||||
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
|
|
||||||
if (allCodeqlVersions.length === 0) {
|
|
||||||
throw new Error('CodeQL not found in toolcache');
|
|
||||||
}
|
|
||||||
if (allCodeqlVersions.length > 1) {
|
|
||||||
throw new Error('Multiple CodeQL versions found in toolcache');
|
|
||||||
}
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
118
.github/workflows/__bundle-zstd.yml
generated
vendored
118
.github/workflows/__bundle-zstd.yml
generated
vendored
@@ -1,118 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Bundle: Zstandard checks'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
bundle-zstd:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
name: 'Bundle: Zstandard checks'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Remove CodeQL from toolcache
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
|
|
||||||
if (codeqlPath !== undefined) {
|
|
||||||
fs.rmdirSync(codeqlPath, { recursive: true });
|
|
||||||
}
|
|
||||||
- id: init
|
|
||||||
uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Upload SARIF
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.os }}-zstd-bundle.sarif
|
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
retention-days: 7
|
|
||||||
- name: Check diagnostic with expected tools URL appears in SARIF
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
|
|
||||||
const run = sarif.runs[0];
|
|
||||||
|
|
||||||
const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
|
|
||||||
const downloadTelemetryNotifications = toolExecutionNotifications.filter(n =>
|
|
||||||
n.descriptor.id === 'codeql-action/bundle-download-telemetry'
|
|
||||||
);
|
|
||||||
if (downloadTelemetryNotifications.length !== 1) {
|
|
||||||
core.setFailed(
|
|
||||||
'Expected exactly one reporting descriptor in the ' +
|
|
||||||
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
|
||||||
`${downloadTelemetryNotifications.length}. All notification reporting descriptors: ` +
|
|
||||||
`${JSON.stringify(toolExecutionNotifications)}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const toolsUrl = downloadTelemetryNotifications[0].properties.attributes.toolsUrl;
|
|
||||||
console.log(`Found tools URL: ${toolsUrl}`);
|
|
||||||
|
|
||||||
const expectedExtension = process.env['RUNNER_OS'] === 'Windows' ? '.tar.gz' : '.tar.zst';
|
|
||||||
|
|
||||||
if (!toolsUrl.endsWith(expectedExtension)) {
|
|
||||||
core.setFailed(
|
|
||||||
`Expected the tools URL to be a ${expectedExtension} file, but found ${toolsUrl}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
75
.github/workflows/__cleanup-db-cluster-dir.yml
generated
vendored
75
.github/workflows/__cleanup-db-cluster-dir.yml
generated
vendored
@@ -1,75 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Clean up database cluster directory
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
cleanup-db-cluster-dir:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
name: Clean up database cluster directory
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Add a file to the database cluster directory
|
|
||||||
run: |
|
|
||||||
mkdir -p "${{ runner.temp }}/customDbLocation/javascript"
|
|
||||||
touch "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt"
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
build-mode: none
|
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Validate file cleaned up
|
|
||||||
run: |
|
|
||||||
if [[ -f "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" ]]; then
|
|
||||||
echo "File was not cleaned up"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "File was cleaned up"
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
106
.github/workflows/__config-export.yml
generated
vendored
106
.github/workflows/__config-export.yml
generated
vendored
@@ -1,106 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Config export
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
config-export:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Config export
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
queries: security-extended
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Upload SARIF
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
retention-days: 7
|
|
||||||
- name: Check config properties appear in SARIF
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
|
|
||||||
const run = sarif.runs[0];
|
|
||||||
const configSummary = run.properties.codeqlConfigSummary;
|
|
||||||
|
|
||||||
if (configSummary === undefined) {
|
|
||||||
core.setFailed('`codeqlConfigSummary` property not found in the SARIF run property bag.');
|
|
||||||
}
|
|
||||||
if (configSummary.disableDefaultQueries !== false) {
|
|
||||||
core.setFailed('`disableDefaultQueries` property incorrect: expected false, got ' +
|
|
||||||
`${JSON.stringify(configSummary.disableDefaultQueries)}.`);
|
|
||||||
}
|
|
||||||
const expectedQueries = [{ type: 'builtinSuite', uses: 'security-extended' }];
|
|
||||||
// Use JSON.stringify to deep-equal the arrays.
|
|
||||||
if (JSON.stringify(configSummary.queries) !== JSON.stringify(expectedQueries)) {
|
|
||||||
core.setFailed(`\`queries\` property incorrect: expected ${JSON.stringify(expectedQueries)}, got ` +
|
|
||||||
`${JSON.stringify(configSummary.queries)}.`);
|
|
||||||
}
|
|
||||||
core.info('Finished config export tests.');
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
90
.github/workflows/__config-input.yml
generated
vendored
90
.github/workflows/__config-input.yml
generated
vendored
@@ -1,90 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Config input
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
config-input:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
name: Config input
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20.x
|
|
||||||
cache: npm
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Copy queries into workspace
|
|
||||||
run: |
|
|
||||||
cp -a ../action/queries .
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
languages: javascript
|
|
||||||
build-mode: none
|
|
||||||
config: |
|
|
||||||
disable-default-queries: true
|
|
||||||
queries:
|
|
||||||
- name: Run custom query
|
|
||||||
uses: ./queries/default-setup-environment-variables.ql
|
|
||||||
paths-ignore:
|
|
||||||
- tests
|
|
||||||
- lib
|
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
|
|
||||||
- name: Check SARIF
|
|
||||||
uses: ./../action/.github/actions/check-sarif
|
|
||||||
with:
|
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
queries-run: javascript/codeql-action/default-setup-env-vars
|
|
||||||
queries-not-run: javascript/codeql-action/default-setup-context-properties
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
77
.github/workflows/__cpp-deptrace-disabled.yml
generated
vendored
77
.github/workflows/__cpp-deptrace-disabled.yml
generated
vendored
@@ -1,77 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - C/C++: disabling autoinstalling dependencies (Linux)'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
cpp-deptrace-disabled:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'C/C++: disabling autoinstalling dependencies (Linux)'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Test setup
|
|
||||||
run: |
|
|
||||||
cp -a ../action/tests/cpp-autobuild autobuild-dir
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: cpp
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
with:
|
|
||||||
working-directory: autobuild-dir
|
|
||||||
env:
|
|
||||||
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false
|
|
||||||
- run: |
|
|
||||||
if ls /usr/bin/errno; then
|
|
||||||
echo "C/C++ autobuild installed errno, but it should not have since auto-install dependencies is disabled."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
77
.github/workflows/__cpp-deptrace-enabled-on-macos.yml
generated
vendored
77
.github/workflows/__cpp-deptrace-enabled-on-macos.yml
generated
vendored
@@ -1,77 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - C/C++: autoinstalling dependencies is skipped (macOS)'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
cpp-deptrace-enabled-on-macos:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'C/C++: autoinstalling dependencies is skipped (macOS)'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Test setup
|
|
||||||
run: |
|
|
||||||
cp -a ../action/tests/cpp-autobuild autobuild-dir
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: cpp
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
with:
|
|
||||||
working-directory: autobuild-dir
|
|
||||||
env:
|
|
||||||
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true
|
|
||||||
- run: |
|
|
||||||
if ! ls /usr/bin/errno; then
|
|
||||||
echo "As expected, CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES is a no-op on macOS"
|
|
||||||
else
|
|
||||||
echo "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES should not have had any effect on macOS"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
77
.github/workflows/__cpp-deptrace-enabled.yml
generated
vendored
77
.github/workflows/__cpp-deptrace-enabled.yml
generated
vendored
@@ -1,77 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - C/C++: autoinstalling dependencies (Linux)'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
cpp-deptrace-enabled:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'C/C++: autoinstalling dependencies (Linux)'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Test setup
|
|
||||||
run: |
|
|
||||||
cp -a ../action/tests/cpp-autobuild autobuild-dir
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: cpp
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
with:
|
|
||||||
working-directory: autobuild-dir
|
|
||||||
env:
|
|
||||||
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true
|
|
||||||
- run: |
|
|
||||||
if ! ls /usr/bin/errno; then
|
|
||||||
echo "Did not autoinstall errno"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
75
.github/workflows/__debug-artifacts.yml
generated
vendored
Normal file
75
.github/workflows/__debug-artifacts.yml
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Debug artifact upload
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v1
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
debug-artifacts:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version:
|
||||||
|
- stable-20201028
|
||||||
|
- stable-20210319
|
||||||
|
- stable-20210809
|
||||||
|
- cached
|
||||||
|
- latest
|
||||||
|
- nightly-latest
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
name: Debug artifact upload
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
- uses: ./../action/init
|
||||||
|
with:
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
debug: true
|
||||||
|
- name: Build code
|
||||||
|
shell: bash
|
||||||
|
run: ./build.sh
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
id: analysis
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: debug-artifacts-${{ matrix.os }}-${{ matrix.version }}
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
LANGUAGES="cpp csharp go java javascript python"
|
||||||
|
for language in $LANGUAGES; do
|
||||||
|
echo "Checking $language"
|
||||||
|
if [[ ! -f "$language.sarif" ]] ; then
|
||||||
|
echo "Missing a SARIF file for $language"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ ! -f "$language.zip" ]] ; then
|
||||||
|
echo "Missing a database bundle for $language"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ ! -d "$language/log" ]] ; then
|
||||||
|
echo "Missing logs for $language"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
env:
|
||||||
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
142
.github/workflows/__diagnostics-export.yml
generated
vendored
142
.github/workflows/__diagnostics-export.yml
generated
vendored
@@ -1,142 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Diagnostic export
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
diagnostics-export:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Diagnostic export
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Add test diagnostics
|
|
||||||
env:
|
|
||||||
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
|
|
||||||
run: |
|
|
||||||
"$CODEQL_PATH" database add-diagnostic \
|
|
||||||
"$RUNNER_TEMP/codeql_databases/javascript" \
|
|
||||||
--file-path /path/to/file \
|
|
||||||
--plaintext-message "Plaintext message" \
|
|
||||||
--source-id "lang/diagnostics/example" \
|
|
||||||
--source-name "Diagnostic name" \
|
|
||||||
--ready-for-status-page
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Upload SARIF
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
retention-days: 7
|
|
||||||
- name: Check diagnostics appear in SARIF
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
function checkStatusPageNotification(n) {
|
|
||||||
const expectedMessage = 'Plaintext message';
|
|
||||||
if (n.message.text !== expectedMessage) {
|
|
||||||
core.setFailed(`Expected the status page diagnostic to have the message '${expectedMessage}', but found '${n.message.text}'.`);
|
|
||||||
}
|
|
||||||
if (n.locations.length !== 1) {
|
|
||||||
core.setFailed(`Expected the status page diagnostic to have exactly 1 location, but found ${n.locations.length}.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
|
|
||||||
const run = sarif.runs[0];
|
|
||||||
|
|
||||||
const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
|
|
||||||
const statusPageNotifications = toolExecutionNotifications.filter(n =>
|
|
||||||
n.descriptor.id === 'lang/diagnostics/example' && n.properties?.visibility?.statusPage
|
|
||||||
);
|
|
||||||
if (statusPageNotifications.length !== 1) {
|
|
||||||
core.setFailed(
|
|
||||||
'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
|
|
||||||
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
|
||||||
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
|
|
||||||
`${JSON.stringify(toolExecutionNotifications)}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
checkStatusPageNotification(statusPageNotifications[0]);
|
|
||||||
|
|
||||||
const notifications = run.tool.driver.notifications;
|
|
||||||
const diagnosticNotification = notifications.filter(n =>
|
|
||||||
n.id === 'lang/diagnostics/example' && n.name === 'lang/diagnostics/example' &&
|
|
||||||
n.fullDescription.text === 'Diagnostic name'
|
|
||||||
);
|
|
||||||
if (diagnosticNotification.length !== 1) {
|
|
||||||
core.setFailed(
|
|
||||||
'Expected exactly one notification for this diagnostic in the ' +
|
|
||||||
`'runs[].tool.driver.notifications[]' SARIF property, but found ` +
|
|
||||||
`${diagnosticNotification.length}. All notifications: ` +
|
|
||||||
`${JSON.stringify(notifications)}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
core.info('Finished diagnostic export test');
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_EXPORT_DIAGNOSTICS: true
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
110
.github/workflows/__export-file-baseline-information.yml
generated
vendored
110
.github/workflows/__export-file-baseline-information.yml
generated
vendored
@@ -1,110 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Export file baseline information
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
export-file-baseline-information:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Export file baseline information
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
- name: Upload SARIF
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
retention-days: 7
|
|
||||||
- name: Check results
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/results"
|
|
||||||
expected_baseline_languages="c csharp go java kotlin javascript python ruby"
|
|
||||||
if [[ $RUNNER_OS == "macOS" ]]; then
|
|
||||||
expected_baseline_languages+=" swift"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for lang in ${expected_baseline_languages}; do
|
|
||||||
rule_name="cli/expected-extracted-files/${lang}"
|
|
||||||
found_notification=$(jq --arg rule_name "${rule_name}" '[.runs[0].tool.driver.notifications |
|
|
||||||
select(. != null) | flatten | .[].id] | any(. == $rule_name)' javascript.sarif)
|
|
||||||
if [[ "${found_notification}" != "true" ]]; then
|
|
||||||
echo "Expected SARIF output to contain notification '${rule_name}', but found no such notification."
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Found notification '${rule_name}'."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE: true
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
99
.github/workflows/__extractor-ram-threads.yml
generated
vendored
99
.github/workflows/__extractor-ram-threads.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Extractor ram and threads options test
|
name: PR Check - Extractor ram and threads options test
|
||||||
@@ -10,69 +10,54 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
extractor-ram-threads:
|
extractor-ram-threads:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [latest]
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest]
|
||||||
version: linked
|
|
||||||
name: Extractor ram and threads options test
|
name: Extractor ram and threads options test
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- uses: ./../action/init
|
||||||
setup-kotlin: 'true'
|
with:
|
||||||
- uses: ./../action/init
|
languages: java
|
||||||
with:
|
ram: 230
|
||||||
languages: java
|
threads: 1
|
||||||
ram: 230
|
- name: Assert Results
|
||||||
threads: 1
|
shell: bash
|
||||||
- name: Assert Results
|
run: |
|
||||||
run: |
|
if [ "${CODEQL_RAM}" != "230" ]; then
|
||||||
if [ "${CODEQL_RAM}" != "230" ]; then
|
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
|
||||||
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
|
||||||
if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
|
echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
|
||||||
echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [ "${CODEQL_THREADS}" != "1" ]; then
|
||||||
if [ "${CODEQL_THREADS}" != "1" ]; then
|
echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
|
||||||
echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
|
||||||
if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
|
echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
|
||||||
echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
101
.github/workflows/__go-custom-queries.yml
generated
vendored
101
.github/workflows/__go-custom-queries.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: 'PR Check - Go: Custom queries'
|
name: 'PR Check - Go: Custom queries'
|
||||||
@@ -10,72 +10,53 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
go-custom-queries:
|
go-custom-queries:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version:
|
||||||
- os: ubuntu-latest
|
- stable-20201028
|
||||||
version: linked
|
- stable-20210319
|
||||||
- os: ubuntu-latest
|
- stable-20210809
|
||||||
version: nightly-latest
|
- cached
|
||||||
|
- latest
|
||||||
|
- nightly-latest
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
- windows-latest
|
||||||
name: 'Go: Custom queries'
|
name: 'Go: Custom queries'
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- uses: actions/setup-go@v2
|
||||||
setup-kotlin: 'true'
|
with:
|
||||||
- name: Install Go
|
go-version: ^1.13.1
|
||||||
uses: actions/setup-go@v5
|
- uses: ./../action/init
|
||||||
with:
|
with:
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
languages: go
|
||||||
cache: false
|
config-file: ./.github/codeql/custom-queries.yml
|
||||||
- uses: ./../action/init
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
with:
|
- name: Build code
|
||||||
languages: go
|
shell: bash
|
||||||
config-file: ./.github/codeql/custom-queries.yml
|
run: ./build.sh
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
- uses: ./../action/analyze
|
||||||
- name: Build code
|
env:
|
||||||
run: ./build.sh
|
TEST_MODE: true
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
env:
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
|
|||||||
64
.github/workflows/__go-custom-tracing-autobuild.yml
generated
vendored
Normal file
64
.github/workflows/__go-custom-tracing-autobuild.yml
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: 'PR Check - Go: Autobuild custom tracing'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v1
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
go-custom-tracing-autobuild:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version:
|
||||||
|
- stable-20201028
|
||||||
|
- stable-20210319
|
||||||
|
- stable-20210809
|
||||||
|
- cached
|
||||||
|
- latest
|
||||||
|
- nightly-latest
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
name: 'Go: Autobuild custom tracing'
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ^1.13.1
|
||||||
|
- uses: ./../action/init
|
||||||
|
with:
|
||||||
|
languages: go
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/autobuild
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
cd "$RUNNER_TEMP/codeql_databases"
|
||||||
|
if [[ ! -d go ]]; then
|
||||||
|
echo "Did not find a Go database"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
env:
|
||||||
|
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'true'
|
||||||
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
62
.github/workflows/__go-custom-tracing.yml
generated
vendored
Normal file
62
.github/workflows/__go-custom-tracing.yml
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: 'PR Check - Go: Custom tracing'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v1
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
go-custom-tracing:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version:
|
||||||
|
- stable-20201028
|
||||||
|
- stable-20210319
|
||||||
|
- stable-20210809
|
||||||
|
- cached
|
||||||
|
- latest
|
||||||
|
- nightly-latest
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
- windows-latest
|
||||||
|
name: 'Go: Custom tracing'
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ^1.13.1
|
||||||
|
- uses: ./../action/init
|
||||||
|
with:
|
||||||
|
languages: go
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- name: Build code
|
||||||
|
shell: bash
|
||||||
|
run: go build main.go
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
env:
|
||||||
|
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'true'
|
||||||
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
107
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
107
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
generated
vendored
@@ -1,107 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Go: diagnostic when Go is changed after init step'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
go-indirect-tracing-workaround-diagnostic:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
name: 'Go: diagnostic when Go is changed after init step'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: go
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
# Deliberately change Go after the `init` step
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.20'
|
|
||||||
- name: Build code
|
|
||||||
run: go build main.go
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Check diagnostic appears in SARIF
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
SARIF_PATH: ${{ runner.temp }}/results/go.sarif
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
|
|
||||||
const run = sarif.runs[0];
|
|
||||||
|
|
||||||
const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
|
|
||||||
const statusPageNotifications = toolExecutionNotifications.filter(n =>
|
|
||||||
n.descriptor.id === 'go/workflow/go-installed-after-codeql-init' && n.properties?.visibility?.statusPage
|
|
||||||
);
|
|
||||||
if (statusPageNotifications.length !== 1) {
|
|
||||||
core.setFailed(
|
|
||||||
'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
|
|
||||||
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
|
||||||
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
|
|
||||||
`${JSON.stringify(toolExecutionNotifications)}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
108
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
108
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
generated
vendored
@@ -1,108 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Go: diagnostic when `file` is not installed'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
go-indirect-tracing-workaround-no-file-program:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
name: 'Go: diagnostic when `file` is not installed'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- name: Remove `file` program
|
|
||||||
run: |
|
|
||||||
echo $(which file)
|
|
||||||
sudo rm -rf $(which file)
|
|
||||||
echo $(which file)
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: go
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Build code
|
|
||||||
run: go build main.go
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Check diagnostic appears in SARIF
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
SARIF_PATH: ${{ runner.temp }}/results/go.sarif
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
|
|
||||||
const run = sarif.runs[0];
|
|
||||||
|
|
||||||
const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
|
|
||||||
const statusPageNotifications = toolExecutionNotifications.filter(n =>
|
|
||||||
n.descriptor.id === 'go/workflow/file-program-unavailable' && n.properties?.visibility?.statusPage
|
|
||||||
);
|
|
||||||
if (statusPageNotifications.length !== 1) {
|
|
||||||
core.setFailed(
|
|
||||||
'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
|
|
||||||
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
|
|
||||||
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
|
|
||||||
`${JSON.stringify(toolExecutionNotifications)}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
102
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
102
.github/workflows/__go-indirect-tracing-workaround.yml
generated
vendored
@@ -1,102 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Go: workaround for indirect tracing'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
go-indirect-tracing-workaround:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
name: 'Go: workaround for indirect tracing'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: go
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Build code
|
|
||||||
run: go build main.go
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
- run: |
|
|
||||||
if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then
|
|
||||||
echo "Expected the workaround for indirect tracing of static binaries to trigger, but the" \
|
|
||||||
"CODEQL_ACTION_GO_BINARY environment variable is not set."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -f "${CODEQL_ACTION_GO_BINARY}" ]]; then
|
|
||||||
echo "CODEQL_ACTION_GO_BINARY is set, but the corresponding script does not exist."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Once we start running Bash 4.2 in all environments, we can replace the
|
|
||||||
# `! -z` flag with the more elegant `-v` which confirms that the variable
|
|
||||||
# is actually unset and not potentially set to a blank value.
|
|
||||||
if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
|
|
||||||
echo "Expected the Go autobuilder not to be run, but the" \
|
|
||||||
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
|
||||||
if [[ ! -d go ]]; then
|
|
||||||
echo "Did not find a Go database"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
118
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
118
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
@@ -1,118 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Go: tracing with autobuilder step'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
go-tracing-autobuilder:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.17.6
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.17.6
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.18.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.18.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Go: tracing with autobuilder step'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: go
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
- run: |
|
|
||||||
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
|
|
||||||
echo "Expected the Go autobuilder to be run, but the" \
|
|
||||||
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
|
||||||
if [[ ! -d go ]]; then
|
|
||||||
echo "Did not find a Go database"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
121
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
121
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
@@ -1,121 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Go: tracing with custom build steps'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
go-tracing-custom-build-steps:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.17.6
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.17.6
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.18.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.18.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Go: tracing with custom build steps'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: go
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Build code
|
|
||||||
run: go build main.go
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
- run: |
|
|
||||||
# Once we start running Bash 4.2 in all environments, we can replace the
|
|
||||||
# `! -z` flag with the more elegant `-v` which confirms that the variable
|
|
||||||
# is actually unset and not potentially set to a blank value.
|
|
||||||
if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
|
|
||||||
echo "Expected the Go autobuilder not to be run, but the" \
|
|
||||||
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
|
||||||
if [[ ! -d go ]]; then
|
|
||||||
echo "Did not find a Go database"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
112
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
112
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
@@ -1,112 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Go: tracing with legacy workflow'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
go-tracing-legacy-workflow:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.17.6
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.17.6
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.18.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.18.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Go: tracing with legacy workflow'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: go
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
- run: |
|
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
|
||||||
if [[ ! -d go ]]; then
|
|
||||||
echo "Did not find a Go database"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
77
.github/workflows/__go.yml
generated
vendored
77
.github/workflows/__go.yml
generated
vendored
@@ -1,77 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: Manual Check - go
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/__go.yml
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
jobs:
|
|
||||||
go-custom-queries:
|
|
||||||
name: 'Go: Custom queries'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
uses: ./.github/workflows/__go-custom-queries.yml
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version }}
|
|
||||||
go-indirect-tracing-workaround-diagnostic:
|
|
||||||
name: 'Go: diagnostic when Go is changed after init step'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
uses: ./.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version }}
|
|
||||||
go-indirect-tracing-workaround-no-file-program:
|
|
||||||
name: 'Go: diagnostic when `file` is not installed'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
uses: ./.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version }}
|
|
||||||
go-indirect-tracing-workaround:
|
|
||||||
name: 'Go: workaround for indirect tracing'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
uses: ./.github/workflows/__go-indirect-tracing-workaround.yml
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version }}
|
|
||||||
go-tracing-autobuilder:
|
|
||||||
name: 'Go: tracing with autobuilder step'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
uses: ./.github/workflows/__go-tracing-autobuilder.yml
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version }}
|
|
||||||
go-tracing-custom-build-steps:
|
|
||||||
name: 'Go: tracing with custom build steps'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
uses: ./.github/workflows/__go-tracing-custom-build-steps.yml
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version }}
|
|
||||||
go-tracing-legacy-workflow:
|
|
||||||
name: 'Go: tracing with legacy workflow'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
uses: ./.github/workflows/__go-tracing-legacy-workflow.yml
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version }}
|
|
||||||
132
.github/workflows/__init-with-registries.yml
generated
vendored
132
.github/workflows/__init-with-registries.yml
generated
vendored
@@ -1,132 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Packaging: Download using registries'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
init-with-registries:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Packaging: Download using registries'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: read
|
|
||||||
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Init with registries
|
|
||||||
uses: ./../action/init
|
|
||||||
with:
|
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
config-file: ./.github/codeql/codeql-config-registries.yml
|
|
||||||
languages: javascript
|
|
||||||
registries: |
|
|
||||||
- url: "https://ghcr.io/v2/"
|
|
||||||
packages: "*/*"
|
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
|
|
||||||
- name: Verify packages installed
|
|
||||||
run: |
|
|
||||||
PRIVATE_PACK="$HOME/.codeql/packages/codeql-testing/private-pack"
|
|
||||||
CODEQL_PACK1="$HOME/.codeql/packages/codeql-testing/codeql-pack1"
|
|
||||||
|
|
||||||
if [[ -d $PRIVATE_PACK ]]
|
|
||||||
then
|
|
||||||
echo "$PRIVATE_PACK was installed."
|
|
||||||
else
|
|
||||||
echo "::error $PRIVATE_PACK pack was not installed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -d $CODEQL_PACK1 ]]
|
|
||||||
then
|
|
||||||
echo "$CODEQL_PACK1 was installed."
|
|
||||||
else
|
|
||||||
echo "::error $CODEQL_PACK1 pack was not installed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Verify qlconfig.yml file was created
|
|
||||||
run: |
|
|
||||||
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
|
|
||||||
echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH"
|
|
||||||
if [[ -f $QLCONFIG_PATH ]]
|
|
||||||
then
|
|
||||||
echo "qlconfig.yml file was created."
|
|
||||||
else
|
|
||||||
echo "::error qlconfig.yml file was not created."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Verify contents of qlconfig.yml
|
|
||||||
# yq is not available on windows
|
|
||||||
if: runner.os != 'Windows'
|
|
||||||
run: |
|
|
||||||
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
|
|
||||||
cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")'
|
|
||||||
if [[ $? -eq 0 ]]
|
|
||||||
then
|
|
||||||
echo "Registry was added to qlconfig.yml file."
|
|
||||||
else
|
|
||||||
echo "::error Registry was not added to qlconfig.yml file."
|
|
||||||
echo "Contents of qlconfig.yml file:"
|
|
||||||
cat $QLCONFIG_PATH
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
97
.github/workflows/__javascript-source-root.yml
generated
vendored
97
.github/workflows/__javascript-source-root.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Custom source root
|
name: PR Check - Custom source root
|
||||||
@@ -10,69 +10,52 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
javascript-source-root:
|
javascript-source-root:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [latest, cached, nightly-latest] # This feature is not compatible with old CLIs
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest]
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Custom source root
|
name: Custom source root
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- name: Move codeql-action
|
||||||
setup-kotlin: 'true'
|
shell: bash
|
||||||
- name: Move codeql-action
|
run: |
|
||||||
run: |
|
mkdir ../new-source-root
|
||||||
mkdir ../new-source-root
|
mv * ../new-source-root
|
||||||
mv * ../new-source-root
|
- uses: ./../action/init
|
||||||
- uses: ./../action/init
|
with:
|
||||||
with:
|
languages: javascript
|
||||||
languages: javascript
|
source-root: ../new-source-root
|
||||||
source-root: ../new-source-root
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
- uses: ./../action/analyze
|
||||||
- uses: ./../action/analyze
|
with:
|
||||||
with:
|
skip-queries: true
|
||||||
skip-queries: true
|
upload: false
|
||||||
- name: Assert database exists
|
- name: Assert database exists
|
||||||
run: |
|
shell: bash
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
run: |
|
||||||
if [[ ! -d javascript ]]; then
|
cd "$RUNNER_TEMP/codeql_databases"
|
||||||
echo "Did not find a JavaScript database"
|
if [[ ! -d javascript ]]; then
|
||||||
exit 1
|
echo "Did not find a JavaScript database"
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
79
.github/workflows/__job-run-uuid-sarif.yml
generated
vendored
79
.github/workflows/__job-run-uuid-sarif.yml
generated
vendored
@@ -1,79 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Job run UUID added to SARIF
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
job-run-uuid-sarif:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Job run UUID added to SARIF
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
- name: Upload SARIF
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
|
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
retention-days: 7
|
|
||||||
- name: Check results
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/results"
|
|
||||||
actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif)
|
|
||||||
if [[ "$actual" != "$JOB_RUN_UUID" ]]; then
|
|
||||||
echo "Expected SARIF output to contain job run UUID '$JOB_RUN_UUID', but found '$actual'."
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Found job run UUID '$actual'."
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
70
.github/workflows/__language-aliases.yml
generated
vendored
70
.github/workflows/__language-aliases.yml
generated
vendored
@@ -1,70 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Language aliases
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
language-aliases:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
name: Language aliases
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: C#,java-kotlin,swift,typescript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Check languages
|
|
||||||
run: |
|
|
||||||
expected_languages="csharp,java,swift,javascript"
|
|
||||||
actual_languages=$(jq -r '.languages | join(",")' "$RUNNER_TEMP"/config)
|
|
||||||
|
|
||||||
if [ "$expected_languages" != "$actual_languages" ]; then
|
|
||||||
echo "Resolved languages did not match expected list. " \
|
|
||||||
"Expected languages: $expected_languages. Actual languages: $actual_languages."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
213
.github/workflows/__multi-language-autodetect.yml
generated
vendored
213
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Multi-language repository
|
name: PR Check - Multi-language repository
|
||||||
@@ -10,158 +10,79 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
multi-language-autodetect:
|
multi-language-autodetect:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version:
|
||||||
- os: macos-latest
|
- stable-20201028
|
||||||
version: stable-v2.17.6
|
- stable-20210319
|
||||||
- os: ubuntu-latest
|
- stable-20210809
|
||||||
version: stable-v2.17.6
|
- cached
|
||||||
- os: macos-latest
|
- latest
|
||||||
version: stable-v2.18.4
|
- nightly-latest
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest, macos-latest]
|
||||||
version: stable-v2.18.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.19.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.20.7
|
|
||||||
- os: macos-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.21.4
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Multi-language repository
|
name: Multi-language repository
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- uses: ./../action/init
|
||||||
setup-kotlin: 'true'
|
with:
|
||||||
- name: Install Go
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
uses: actions/setup-go@v5
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
with:
|
- name: Build code
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
shell: bash
|
||||||
cache: false
|
run: ./build.sh
|
||||||
- name: Use Xcode 16
|
- uses: ./../action/analyze
|
||||||
if: runner.os == 'macOS' && matrix.version != 'nightly-latest'
|
id: analysis
|
||||||
run: sudo xcode-select -s "/Applications/Xcode_16.app"
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
- uses: ./../action/init
|
- shell: bash
|
||||||
id: init
|
run: |
|
||||||
with:
|
CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby'
|
echo "Did not create a database for CPP, or created it in the wrong location."
|
||||||
|| '' }}
|
exit 1
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
fi
|
||||||
|
CSHARP_DB=${{ fromJson(steps.analysis.outputs.db-locations).csharp }}
|
||||||
- name: Build code
|
if [[ ! -d $CSHARP_DB ]] || [[ ! $CSHARP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
run: ./build.sh
|
echo "Did not create a database for C Sharp, or created it in the wrong location."
|
||||||
|
exit 1
|
||||||
- uses: ./../action/analyze
|
fi
|
||||||
id: analysis
|
GO_DB=${{ fromJson(steps.analysis.outputs.db-locations).go }}
|
||||||
with:
|
if [[ ! -d $GO_DB ]] || [[ ! $GO_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
upload-database: false
|
echo "Did not create a database for Go, or created it in the wrong location."
|
||||||
|
exit 1
|
||||||
- name: Check language autodetect for all languages excluding Swift
|
fi
|
||||||
run: |
|
JAVA_DB=${{ fromJson(steps.analysis.outputs.db-locations).java }}
|
||||||
CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
|
if [[ ! -d $JAVA_DB ]] || [[ ! $JAVA_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
echo "Did not create a database for Java, or created it in the wrong location."
|
||||||
echo "Did not create a database for CPP, or created it in the wrong location."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
JAVASCRIPT_DB=${{ fromJson(steps.analysis.outputs.db-locations).javascript }}
|
||||||
CSHARP_DB=${{ fromJson(steps.analysis.outputs.db-locations).csharp }}
|
if [[ ! -d $JAVASCRIPT_DB ]] || [[ ! $JAVASCRIPT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
if [[ ! -d $CSHARP_DB ]] || [[ ! $CSHARP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
echo "Did not create a database for Javascript, or created it in the wrong location."
|
||||||
echo "Did not create a database for C Sharp, or created it in the wrong location."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
PYTHON_DB=${{ fromJson(steps.analysis.outputs.db-locations).python }}
|
||||||
GO_DB=${{ fromJson(steps.analysis.outputs.db-locations).go }}
|
if [[ ! -d $PYTHON_DB ]] || [[ ! $PYTHON_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
if [[ ! -d $GO_DB ]] || [[ ! $GO_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
echo "Did not create a database for Python, or created it in the wrong location."
|
||||||
echo "Did not create a database for Go, or created it in the wrong location."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
JAVA_DB=${{ fromJson(steps.analysis.outputs.db-locations).java }}
|
|
||||||
if [[ ! -d $JAVA_DB ]] || [[ ! $JAVA_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
|
||||||
echo "Did not create a database for Java, or created it in the wrong location."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
JAVASCRIPT_DB=${{ fromJson(steps.analysis.outputs.db-locations).javascript }}
|
|
||||||
if [[ ! -d $JAVASCRIPT_DB ]] || [[ ! $JAVASCRIPT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
|
||||||
echo "Did not create a database for Javascript, or created it in the wrong location."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
PYTHON_DB=${{ fromJson(steps.analysis.outputs.db-locations).python }}
|
|
||||||
if [[ ! -d $PYTHON_DB ]] || [[ ! $PYTHON_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
|
||||||
echo "Did not create a database for Python, or created it in the wrong location."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }}
|
|
||||||
if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
|
||||||
echo "Did not create a database for Ruby, or created it in the wrong location."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check language autodetect for Swift on macOS
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
|
||||||
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
|
|
||||||
if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
|
||||||
echo "Did not create a database for Swift, or created it in the wrong location."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
|
|||||||
74
.github/workflows/__overlay-init-fallback.yml
generated
vendored
74
.github/workflows/__overlay-init-fallback.yml
generated
vendored
@@ -1,74 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Overlay database init fallback
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
overlay-init-fallback:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Overlay database init fallback
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: actions # Any language without overlay support will do
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
env:
|
|
||||||
CODEQL_OVERLAY_DATABASE_MODE: overlay-base
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
with:
|
|
||||||
upload-database: false
|
|
||||||
- name: Check database
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/codeql_databases/actions"
|
|
||||||
if ! grep -q 'overlayBaseDatabase: false' codeql-database.yml ; then
|
|
||||||
echo "This test needs to be updated to use a non-overlay language."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
127
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
127
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
@@ -1,127 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Packaging: Config and input passed to the CLI'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
packaging-codescanning-config-inputs-js:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Packaging: Config and input passed to the CLI'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20.x
|
|
||||||
cache: npm
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
config-file: .github/codeql/codeql-config-packaging3.yml
|
|
||||||
packs: +codeql-testing/codeql-pack1@1.0.0
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
|
|
||||||
- name: Check results
|
|
||||||
uses: ./../action/.github/actions/check-sarif
|
|
||||||
with:
|
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
queries-run:
|
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
|
||||||
queries-not-run: foo,bar
|
|
||||||
|
|
||||||
- name: Assert Results
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/results"
|
|
||||||
# We should have 4 hits from these rules
|
|
||||||
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
|
|
||||||
|
|
||||||
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
|
||||||
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
|
|
||||||
echo "Found matching rules '$RULES'"
|
|
||||||
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
|
||||||
echo "Did not match expected rules '$EXPECTED_RULES'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
150
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
150
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: 'PR Check - Packaging: Config and input'
|
name: 'PR Check - Packaging: Config and input'
|
||||||
@@ -10,118 +10,58 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
packaging-config-inputs-js:
|
packaging-config-inputs-js:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [nightly-20210831] # This CLI version is known to work with package used in this test
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest, macos-latest]
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Packaging: Config and input'
|
name: 'Packaging: Config and input'
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Install Node.js
|
- name: Prepare test
|
||||||
uses: actions/setup-node@v4
|
id: prepare-test
|
||||||
with:
|
uses: ./.github/prepare-test
|
||||||
node-version: 20.x
|
with:
|
||||||
cache: npm
|
version: ${{ matrix.version }}
|
||||||
- name: Install dependencies
|
- uses: ./../action/init
|
||||||
run: npm ci
|
with:
|
||||||
- name: Prepare test
|
config-file: .github/codeql/codeql-config-packaging3.yml
|
||||||
id: prepare-test
|
packs: +dsp-testing/codeql-pack1@0.1.0
|
||||||
uses: ./.github/actions/prepare-test
|
languages: javascript
|
||||||
with:
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
version: ${{ matrix.version }}
|
- name: Build code
|
||||||
use-all-platform-bundle: 'false'
|
shell: bash
|
||||||
setup-kotlin: 'true'
|
run: ./build.sh
|
||||||
- name: Install Go
|
- uses: ./../action/analyze
|
||||||
uses: actions/setup-go@v5
|
with:
|
||||||
with:
|
output: ${{ runner.temp }}/results
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
env:
|
||||||
cache: false
|
TEST_MODE: true
|
||||||
- uses: ./../action/init
|
- name: Assert Results
|
||||||
with:
|
shell: bash
|
||||||
config-file: .github/codeql/codeql-config-packaging3.yml
|
run: |
|
||||||
packs: +codeql-testing/codeql-pack1@1.0.0
|
cd "$RUNNER_TEMP/results"
|
||||||
languages: javascript
|
# We should have 3 hits from these rules
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
|
|
||||||
- name: Check results
|
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
||||||
uses: ./../action/.github/actions/check-sarif
|
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
|
||||||
with:
|
echo "Found matching rules '$RULES'"
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
||||||
queries-run:
|
echo "Did not match expected rules '$EXPECTED_RULES'."
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
exit 1
|
||||||
queries-not-run: foo,bar
|
fi
|
||||||
|
|
||||||
- name: Assert Results
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/results"
|
|
||||||
# We should have 4 hits from these rules
|
|
||||||
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
|
|
||||||
|
|
||||||
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
|
||||||
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
|
|
||||||
echo "Found matching rules '$RULES'"
|
|
||||||
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
|
||||||
echo "Did not match expected rules '$EXPECTED_RULES'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
148
.github/workflows/__packaging-config-js.yml
generated
vendored
148
.github/workflows/__packaging-config-js.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: 'PR Check - Packaging: Config file'
|
name: 'PR Check - Packaging: Config file'
|
||||||
@@ -10,117 +10,57 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
packaging-config-js:
|
packaging-config-js:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [nightly-20210831] # This CLI version is known to work with package used in this test
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest, macos-latest]
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Packaging: Config file'
|
name: 'Packaging: Config file'
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Install Node.js
|
- name: Prepare test
|
||||||
uses: actions/setup-node@v4
|
id: prepare-test
|
||||||
with:
|
uses: ./.github/prepare-test
|
||||||
node-version: 20.x
|
with:
|
||||||
cache: npm
|
version: ${{ matrix.version }}
|
||||||
- name: Install dependencies
|
- uses: ./../action/init
|
||||||
run: npm ci
|
with:
|
||||||
- name: Prepare test
|
config-file: .github/codeql/codeql-config-packaging.yml
|
||||||
id: prepare-test
|
languages: javascript
|
||||||
uses: ./.github/actions/prepare-test
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
with:
|
- name: Build code
|
||||||
version: ${{ matrix.version }}
|
shell: bash
|
||||||
use-all-platform-bundle: 'false'
|
run: ./build.sh
|
||||||
setup-kotlin: 'true'
|
- uses: ./../action/analyze
|
||||||
- name: Install Go
|
with:
|
||||||
uses: actions/setup-go@v5
|
output: ${{ runner.temp }}/results
|
||||||
with:
|
env:
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
TEST_MODE: true
|
||||||
cache: false
|
- name: Assert Results
|
||||||
- uses: ./../action/init
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
config-file: .github/codeql/codeql-config-packaging.yml
|
cd "$RUNNER_TEMP/results"
|
||||||
languages: javascript
|
# We should have 3 hits from these rules
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
|
|
||||||
- name: Check results
|
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
||||||
uses: ./../action/.github/actions/check-sarif
|
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
|
||||||
with:
|
echo "Found matching rules '$RULES'"
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
||||||
queries-run:
|
echo "Did not match expected rules '$EXPECTED_RULES'."
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
exit 1
|
||||||
queries-not-run: foo,bar
|
fi
|
||||||
|
|
||||||
- name: Assert Results
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/results"
|
|
||||||
# We should have 4 hits from these rules
|
|
||||||
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
|
|
||||||
|
|
||||||
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
|
||||||
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
|
|
||||||
echo "Found matching rules '$RULES'"
|
|
||||||
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
|
||||||
echo "Did not match expected rules '$EXPECTED_RULES'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
149
.github/workflows/__packaging-inputs-js.yml
generated
vendored
149
.github/workflows/__packaging-inputs-js.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: 'PR Check - Packaging: Action input'
|
name: 'PR Check - Packaging: Action input'
|
||||||
@@ -10,117 +10,58 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
packaging-inputs-js:
|
packaging-inputs-js:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [nightly-20210831] # This CLI version is known to work with package used in this test
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest, macos-latest]
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: 'Packaging: Action input'
|
name: 'Packaging: Action input'
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Install Node.js
|
- name: Prepare test
|
||||||
uses: actions/setup-node@v4
|
id: prepare-test
|
||||||
with:
|
uses: ./.github/prepare-test
|
||||||
node-version: 20.x
|
with:
|
||||||
cache: npm
|
version: ${{ matrix.version }}
|
||||||
- name: Install dependencies
|
- uses: ./../action/init
|
||||||
run: npm ci
|
with:
|
||||||
- name: Prepare test
|
config-file: .github/codeql/codeql-config-packaging2.yml
|
||||||
id: prepare-test
|
languages: javascript
|
||||||
uses: ./.github/actions/prepare-test
|
packs: dsp-testing/codeql-pack1@0.1.0, dsp-testing/codeql-pack2
|
||||||
with:
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
version: ${{ matrix.version }}
|
- name: Build code
|
||||||
use-all-platform-bundle: 'false'
|
shell: bash
|
||||||
setup-kotlin: 'true'
|
run: ./build.sh
|
||||||
- name: Install Go
|
- uses: ./../action/analyze
|
||||||
uses: actions/setup-go@v5
|
with:
|
||||||
with:
|
output: ${{ runner.temp }}/results
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
env:
|
||||||
cache: false
|
TEST_MODE: true
|
||||||
- uses: ./../action/init
|
- name: Assert Results
|
||||||
with:
|
shell: bash
|
||||||
config-file: .github/codeql/codeql-config-packaging2.yml
|
run: |
|
||||||
languages: javascript
|
cd "$RUNNER_TEMP/results"
|
||||||
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2, codeql-testing/codeql-pack3:other-query.ql
|
# We should have 3 hits from these rules
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
|
|
||||||
- name: Check results
|
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
||||||
uses: ./../action/.github/actions/check-sarif
|
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
|
||||||
with:
|
echo "Found matching rules '$RULES'"
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
||||||
queries-run:
|
echo "Did not match expected rules '$EXPECTED_RULES'."
|
||||||
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
|
exit 1
|
||||||
queries-not-run: foo,bar
|
fi
|
||||||
|
|
||||||
- name: Assert Results
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/results"
|
|
||||||
# We should have 4 hits from these rules
|
|
||||||
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
|
|
||||||
|
|
||||||
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
|
||||||
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
|
|
||||||
echo "Found matching rules '$RULES'"
|
|
||||||
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
|
||||||
echo "Did not match expected rules '$EXPECTED_RULES'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
171
.github/workflows/__quality-queries.yml
generated
vendored
171
.github/workflows/__quality-queries.yml
generated
vendored
@@ -1,171 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Quality queries input
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
quality-queries:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-scanning
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-quality
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-scanning,code-quality
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-scanning
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-quality
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-scanning,code-quality
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-scanning
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-quality
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
analysis-kinds: code-scanning,code-quality
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-scanning
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-quality
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-scanning,code-quality
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-scanning
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-quality
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-scanning,code-quality
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-scanning
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-quality
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
analysis-kinds: code-scanning,code-quality
|
|
||||||
name: Quality queries input
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
analysis-kinds: ${{ matrix.analysis-kinds }}
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Upload security SARIF
|
|
||||||
if: contains(matrix.analysis-kinds, 'code-scanning')
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: |
|
|
||||||
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json
|
|
||||||
path: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
retention-days: 7
|
|
||||||
- name: Upload quality SARIF
|
|
||||||
if: contains(matrix.analysis-kinds, 'code-quality')
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: |
|
|
||||||
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.quality.sarif.json
|
|
||||||
path: ${{ runner.temp }}/results/javascript.quality.sarif
|
|
||||||
retention-days: 7
|
|
||||||
- name: Check quality query does not appear in security SARIF
|
|
||||||
if: contains(matrix.analysis-kinds, 'code-scanning')
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
EXPECT_PRESENT: 'false'
|
|
||||||
with:
|
|
||||||
script: ${{ env.CHECK_SCRIPT }}
|
|
||||||
- name: Check quality query appears in quality SARIF
|
|
||||||
if: contains(matrix.analysis-kinds, 'code-quality')
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
SARIF_PATH: ${{ runner.temp }}/results/javascript.quality.sarif
|
|
||||||
EXPECT_PRESENT: 'true'
|
|
||||||
with:
|
|
||||||
script: ${{ env.CHECK_SCRIPT }}
|
|
||||||
env:
|
|
||||||
CHECK_SCRIPT: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
|
|
||||||
const expectPresent = JSON.parse(process.env['EXPECT_PRESENT']);
|
|
||||||
const run = sarif.runs[0];
|
|
||||||
const extensions = run.tool.extensions;
|
|
||||||
|
|
||||||
if (extensions === undefined) {
|
|
||||||
core.setFailed('`extensions` property not found in the SARIF run property bag.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// ID of a query we want to check the presence for
|
|
||||||
const targetId = 'js/regex/always-matches';
|
|
||||||
const found = extensions.find(extension => extension.rules && extension.rules.find(rule => rule.id === targetId));
|
|
||||||
|
|
||||||
if (found && expectPresent) {
|
|
||||||
console.log(`Found rule with id '${targetId}'.`);
|
|
||||||
} else if (!found && !expectPresent) {
|
|
||||||
console.log(`Rule with id '${targetId}' was not found.`);
|
|
||||||
} else {
|
|
||||||
core.setFailed(`${ found ? "Found" : "Didn't find" } rule ${targetId}`);
|
|
||||||
}
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
99
.github/workflows/__remote-config.yml
generated
vendored
99
.github/workflows/__remote-config.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Remote config file
|
name: PR Check - Remote config file
|
||||||
@@ -10,72 +10,51 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
remote-config:
|
remote-config:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version:
|
||||||
- os: ubuntu-latest
|
- stable-20201028
|
||||||
version: linked
|
- stable-20210319
|
||||||
- os: ubuntu-latest
|
- stable-20210809
|
||||||
version: nightly-latest
|
- cached
|
||||||
|
- latest
|
||||||
|
- nightly-latest
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
- windows-latest
|
||||||
name: Remote config file
|
name: Remote config file
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- uses: ./../action/init
|
||||||
setup-kotlin: 'true'
|
with:
|
||||||
- name: Install Go
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
uses: actions/setup-go@v5
|
languages: cpp,csharp,java,javascript,python
|
||||||
with:
|
config-file: github/codeql-action/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
github.sha }}
|
||||||
cache: false
|
- name: Build code
|
||||||
- uses: ./../action/init
|
shell: bash
|
||||||
with:
|
run: ./build.sh
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
- uses: ./../action/analyze
|
||||||
languages: cpp,csharp,java,javascript,python
|
env:
|
||||||
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
TEST_MODE: true
|
||||||
github.sha }}
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
96
.github/workflows/__resolve-environment-action.yml
generated
vendored
96
.github/workflows/__resolve-environment-action.yml
generated
vendored
@@ -1,96 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Resolve environment
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
resolve-environment-action:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: windows-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Resolve environment
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: go,javascript-typescript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Resolve environment for Go
|
|
||||||
uses: ./../action/resolve-environment
|
|
||||||
id: resolve-environment-go
|
|
||||||
with:
|
|
||||||
language: go
|
|
||||||
|
|
||||||
- name: Fail if Go configuration missing
|
|
||||||
if: (!fromJSON(steps.resolve-environment-go.outputs.environment).configuration.go)
|
|
||||||
run: exit 1
|
|
||||||
|
|
||||||
- name: Resolve environment for JavaScript/TypeScript
|
|
||||||
uses: ./../action/resolve-environment
|
|
||||||
id: resolve-environment-js
|
|
||||||
with:
|
|
||||||
language: javascript-typescript
|
|
||||||
|
|
||||||
- name: Fail if JavaScript/TypeScript configuration present
|
|
||||||
if:
|
|
||||||
fromJSON(steps.resolve-environment-js.outputs.environment).configuration.javascript
|
|
||||||
run: exit 1
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
97
.github/workflows/__rubocop-multi-language.yml
generated
vendored
97
.github/workflows/__rubocop-multi-language.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - RuboCop multi-language
|
name: PR Check - RuboCop multi-language
|
||||||
@@ -10,63 +10,58 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
rubocop-multi-language:
|
rubocop-multi-language:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version:
|
||||||
- os: ubuntu-latest
|
- stable-20201028
|
||||||
version: default
|
- stable-20210319
|
||||||
|
- stable-20210809
|
||||||
|
- cached
|
||||||
|
- latest
|
||||||
|
- nightly-latest
|
||||||
|
os: [ubuntu-latest]
|
||||||
name: RuboCop multi-language
|
name: RuboCop multi-language
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- name: Set up Ruby
|
||||||
setup-kotlin: 'true'
|
uses: ruby/setup-ruby@v1
|
||||||
- name: Set up Ruby
|
with:
|
||||||
uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
|
ruby-version: 2.6
|
||||||
with:
|
- name: Install Code Scanning integration
|
||||||
ruby-version: 2.6
|
shell: bash
|
||||||
- name: Install Code Scanning integration
|
run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install
|
||||||
run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install
|
- name: Install dependencies
|
||||||
- name: Install dependencies
|
shell: bash
|
||||||
run: bundle install
|
run: bundle install
|
||||||
- name: RuboCop run
|
- name: RuboCop run
|
||||||
run: |
|
shell: bash
|
||||||
bash -c "
|
run: |
|
||||||
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
|
bash -c "
|
||||||
[[ $? -ne 2 ]]
|
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
|
||||||
"
|
[[ $? -ne 2 ]]
|
||||||
- uses: ./../action/upload-sarif
|
"
|
||||||
with:
|
- uses: ./../action/upload-sarif
|
||||||
sarif_file: rubocop.sarif
|
with:
|
||||||
|
sarif_file: rubocop.sarif
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
80
.github/workflows/__ruby.yml
generated
vendored
80
.github/workflows/__ruby.yml
generated
vendored
@@ -1,80 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Ruby analysis
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
ruby:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Ruby analysis
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: ruby
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
with:
|
|
||||||
upload-database: false
|
|
||||||
- name: Check database
|
|
||||||
run: |
|
|
||||||
RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}"
|
|
||||||
if [[ ! -d "$RUBY_DB" ]]; then
|
|
||||||
echo "Did not create a database for Ruby."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
78
.github/workflows/__rust.yml
generated
vendored
78
.github/workflows/__rust.yml
generated
vendored
@@ -1,78 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Rust analysis
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
rust:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.19.3
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: stable-v2.22.1
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Rust analysis
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: rust
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
with:
|
|
||||||
upload-database: false
|
|
||||||
- name: Check database
|
|
||||||
run: |
|
|
||||||
RUST_DB="${{ fromJson(steps.analysis.outputs.db-locations).rust }}"
|
|
||||||
if [[ ! -d "$RUST_DB" ]]; then
|
|
||||||
echo "Did not create a database for Rust."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
154
.github/workflows/__split-workflow.yml
generated
vendored
154
.github/workflows/__split-workflow.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Split workflow
|
name: PR Check - Split workflow
|
||||||
@@ -10,108 +10,72 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
split-workflow:
|
split-workflow:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [nightly-20210831] # This CLI version is known to work with package used in this test
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest, macos-latest]
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Split workflow
|
name: Split workflow
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- uses: ./../action/init
|
||||||
setup-kotlin: 'true'
|
with:
|
||||||
- name: Install Go
|
config-file: .github/codeql/codeql-config-packaging3.yml
|
||||||
uses: actions/setup-go@v5
|
packs: +dsp-testing/codeql-pack1@0.1.0
|
||||||
with:
|
languages: javascript
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
cache: false
|
- name: Build code
|
||||||
- uses: ./../action/init
|
shell: bash
|
||||||
with:
|
run: ./build.sh
|
||||||
config-file: .github/codeql/codeql-config-packaging3.yml
|
- uses: ./../action/analyze
|
||||||
packs: +codeql-testing/codeql-pack1@1.0.0
|
with:
|
||||||
languages: javascript
|
skip-queries: true
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
output: ${{ runner.temp }}/results
|
||||||
- name: Build code
|
env:
|
||||||
run: ./build.sh
|
TEST_MODE: true
|
||||||
- uses: ./../action/analyze
|
- name: Assert No Results
|
||||||
with:
|
shell: bash
|
||||||
skip-queries: true
|
run: |
|
||||||
output: ${{ runner.temp }}/results
|
if [ "$(ls -A $RUNNER_TEMP/results)" ]; then
|
||||||
upload-database: false
|
echo "Expected results directory to be empty after skipping query execution!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
with:
|
||||||
|
output: ${{ runner.temp }}/results
|
||||||
|
upload-database: false
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
- name: Assert Results
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd "$RUNNER_TEMP/results"
|
||||||
|
# We should have 3 hits from these rules
|
||||||
|
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
|
||||||
|
|
||||||
- name: Assert No Results
|
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
||||||
run: |
|
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
|
||||||
if [ "$(ls -A $RUNNER_TEMP/results)" ]; then
|
echo "Found matching rules '$RULES'"
|
||||||
echo "Expected results directory to be empty after skipping query execution!"
|
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
||||||
exit 1
|
echo "Did not match expected rules '$EXPECTED_RULES'."
|
||||||
fi
|
exit 1
|
||||||
- uses: ./../action/analyze
|
fi
|
||||||
with:
|
|
||||||
output: ${{ runner.temp }}/results
|
|
||||||
upload-database: false
|
|
||||||
- name: Assert Results
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/results"
|
|
||||||
# We should have 4 hits from these rules
|
|
||||||
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"
|
|
||||||
|
|
||||||
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
|
|
||||||
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n\r" " " | xargs)"
|
|
||||||
echo "Found matching rules '$RULES'"
|
|
||||||
if [ "$RULES" != "$EXPECTED_RULES" ]; then
|
|
||||||
echo "Did not match expected rules '$EXPECTED_RULES'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
81
.github/workflows/__start-proxy.yml
generated
vendored
81
.github/workflows/__start-proxy.yml
generated
vendored
@@ -1,81 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Start proxy
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
start-proxy:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
name: Start proxy
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: csharp
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Setup proxy for registries
|
|
||||||
id: proxy
|
|
||||||
uses: ./../action/start-proxy
|
|
||||||
with:
|
|
||||||
registry_secrets: '[{ "type": "nuget_feed", "url": "https://api.nuget.org/v3/index.json"
|
|
||||||
}]'
|
|
||||||
|
|
||||||
- name: Print proxy outputs
|
|
||||||
run: |
|
|
||||||
echo "${{ steps.proxy.outputs.proxy_host }}"
|
|
||||||
echo "${{ steps.proxy.outputs.proxy_port }}"
|
|
||||||
echo "${{ steps.proxy.outputs.proxy_urls }}"
|
|
||||||
|
|
||||||
- name: Fail if proxy outputs are not set
|
|
||||||
if: (!steps.proxy.outputs.proxy_host) || (!steps.proxy.outputs.proxy_port)
|
|
||||||
|| (!steps.proxy.outputs.proxy_ca_certificate) || (!steps.proxy.outputs.proxy_urls)
|
|
||||||
run: exit 1
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
87
.github/workflows/__submit-sarif-failure.yml
generated
vendored
87
.github/workflows/__submit-sarif-failure.yml
generated
vendored
@@ -1,87 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Submit SARIF after failure
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
submit-sarif-failure:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Submit SARIF after failure
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: write # needed to upload the SARIF file
|
|
||||||
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: ./init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Fail
|
|
||||||
# We want this job to pass if the Action correctly uploads the SARIF file for
|
|
||||||
# the failed run.
|
|
||||||
# Setting this step to continue on error means that it is marked as completing
|
|
||||||
# successfully, so will not fail the job.
|
|
||||||
continue-on-error: true
|
|
||||||
run: exit 1
|
|
||||||
- uses: ./analyze
|
|
||||||
# In a real workflow, this step wouldn't run. Since we used `continue-on-error`
|
|
||||||
# above, we manually disable it with an `if` condition.
|
|
||||||
if: false
|
|
||||||
with:
|
|
||||||
category: /test-codeql-version:${{ matrix.version }}
|
|
||||||
env:
|
|
||||||
# Internal-only environment variable used to indicate that the post-init Action
|
|
||||||
# should expect to upload a SARIF file for the failed run.
|
|
||||||
CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF: true
|
|
||||||
# Make sure the uploading SARIF files feature is enabled.
|
|
||||||
CODEQL_ACTION_UPLOAD_FAILED_SARIF: true
|
|
||||||
# Upload the failed SARIF file as an integration test of the API endpoint.
|
|
||||||
CODEQL_ACTION_TEST_MODE: false
|
|
||||||
# Mark telemetry for this workflow so it can be treated separately.
|
|
||||||
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
|
||||||
|
|
||||||
76
.github/workflows/__swift-autobuild.yml
generated
vendored
76
.github/workflows/__swift-autobuild.yml
generated
vendored
@@ -1,76 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Swift analysis using autobuild
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
swift-autobuild:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Swift analysis using autobuild
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
languages: swift
|
|
||||||
build-mode: autobuild
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Check working directory
|
|
||||||
run: pwd
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
timeout-minutes: 30
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
with:
|
|
||||||
upload-database: false
|
|
||||||
- name: Check database
|
|
||||||
run: |
|
|
||||||
SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
|
|
||||||
if [[ ! -d "$SWIFT_DB" ]]; then
|
|
||||||
echo "Did not create a database for Swift."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
98
.github/workflows/__swift-custom-build.yml
generated
vendored
98
.github/workflows/__swift-custom-build.yml
generated
vendored
@@ -1,98 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Swift analysis using a custom build command
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
swift-custom-build:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Swift analysis using a custom build command
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- name: Use Xcode 16
|
|
||||||
if: runner.os == 'macOS' && matrix.version != 'nightly-latest'
|
|
||||||
run: sudo xcode-select -s "/Applications/Xcode_16.app"
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
languages: swift
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- name: Check working directory
|
|
||||||
run: pwd
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
with:
|
|
||||||
upload-database: false
|
|
||||||
- name: Check database
|
|
||||||
run: |
|
|
||||||
SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
|
|
||||||
if [[ ! -d "$SWIFT_DB" ]]; then
|
|
||||||
echo "Did not create a database for Swift."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
76
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
76
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
@@ -1,76 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Autobuild working directory
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
test-autobuild-working-dir:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
name: Autobuild working directory
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Test setup
|
|
||||||
run: |
|
|
||||||
# Make sure that Gradle build succeeds in autobuild-dir ...
|
|
||||||
cp -a ../action/tests/java-repo autobuild-dir
|
|
||||||
# ... and fails if attempted in the current directory
|
|
||||||
echo > build.gradle
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: java
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/autobuild
|
|
||||||
with:
|
|
||||||
working-directory: autobuild-dir
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
- name: Check database
|
|
||||||
run: |
|
|
||||||
cd "$RUNNER_TEMP/codeql_databases"
|
|
||||||
if [[ ! -d java ]]; then
|
|
||||||
echo "Did not find a Java database"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
96
.github/workflows/__test-local-codeql.yml
generated
vendored
96
.github/workflows/__test-local-codeql.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Local CodeQL bundle
|
name: PR Check - Local CodeQL bundle
|
||||||
@@ -10,75 +10,45 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
test-local-codeql:
|
test-local-codeql:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [nightly-latest]
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest]
|
||||||
version: nightly-latest
|
|
||||||
name: Local CodeQL bundle
|
name: Local CodeQL bundle
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- name: Fetch a CodeQL bundle
|
||||||
setup-kotlin: 'true'
|
shell: bash
|
||||||
- name: Install Go
|
env:
|
||||||
uses: actions/setup-go@v5
|
CODEQL_URL: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
with:
|
run: |
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
wget "$CODEQL_URL"
|
||||||
cache: false
|
- uses: ./../action/init
|
||||||
- name: Fetch a CodeQL bundle
|
with:
|
||||||
env:
|
tools: ./codeql-bundle.tar.gz
|
||||||
CODEQL_URL: ${{ steps.prepare-test.outputs.tools-url }}
|
- name: Build code
|
||||||
run: |
|
shell: bash
|
||||||
wget "$CODEQL_URL"
|
run: ./build.sh
|
||||||
- id: init
|
- uses: ./../action/analyze
|
||||||
uses: ./../action/init
|
env:
|
||||||
with:
|
TEST_MODE: true
|
||||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
|
||||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
|
||||||
tools: ./codeql-bundle-linux64.tar.zst
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
85
.github/workflows/__test-proxy.yml
generated
vendored
85
.github/workflows/__test-proxy.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Proxy test
|
name: PR Check - Proxy test
|
||||||
@@ -10,73 +10,46 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs: {}
|
|
||||||
workflow_call:
|
|
||||||
inputs: {}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
test-proxy:
|
test-proxy:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version: [latest]
|
||||||
- os: ubuntu-latest
|
os: [ubuntu-latest]
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
name: Proxy test
|
name: Proxy test
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
# These steps are required to initialise the `gh` cli in a container that doesn't
|
- name: Check out repository
|
||||||
# come pre-installed with it. The reason for that is that this is later
|
uses: actions/checkout@v2
|
||||||
# needed by the `prepare-test` workflow to find the latest release of CodeQL.
|
- name: Prepare test
|
||||||
- name: Set up GitHub CLI
|
id: prepare-test
|
||||||
run: |
|
uses: ./.github/prepare-test
|
||||||
apt update
|
with:
|
||||||
apt install -y curl libreadline8 gnupg2 software-properties-common zstd
|
version: ${{ matrix.version }}
|
||||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
|
- uses: ./../action/init
|
||||||
apt-key add /usr/share/keyrings/githubcli-archive-keyring.gpg
|
with:
|
||||||
apt-add-repository https://cli.github.com/packages
|
languages: javascript
|
||||||
apt install -y gh
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
env: {}
|
- uses: ./../action/analyze
|
||||||
- name: Check out repository
|
env:
|
||||||
uses: actions/checkout@v5
|
TEST_MODE: true
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'false'
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
env:
|
env:
|
||||||
https_proxy: http://squid-proxy:3128
|
https_proxy: http://squid-proxy:3128
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
container:
|
container:
|
||||||
image: ubuntu:22.04
|
image: ubuntu:18.04
|
||||||
|
options: --dns 127.0.0.1
|
||||||
services:
|
services:
|
||||||
squid-proxy:
|
squid-proxy:
|
||||||
image: ubuntu/squid:latest
|
image: datadog/squid:latest
|
||||||
ports:
|
ports:
|
||||||
- 3128:3128
|
- 3128:3128
|
||||||
|
|||||||
56
.github/workflows/__test-ruby.yml
generated
vendored
Normal file
56
.github/workflows/__test-ruby.yml
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
|
# to regenerate this file.
|
||||||
|
|
||||||
|
name: PR Check - Ruby analysis
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GO111MODULE: auto
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v1
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- ready_for_review
|
||||||
|
workflow_dispatch: {}
|
||||||
|
jobs:
|
||||||
|
test-ruby:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version: [latest, cached, nightly-latest]
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
name: Ruby analysis
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Prepare test
|
||||||
|
id: prepare-test
|
||||||
|
uses: ./.github/prepare-test
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
- uses: ./../action/init
|
||||||
|
with:
|
||||||
|
languages: ruby
|
||||||
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
|
- uses: ./../action/analyze
|
||||||
|
id: analysis
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
- name: Check database
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}"
|
||||||
|
if [[ ! -d "$RUBY_DB" ]]; then
|
||||||
|
echo "Did not create a database for Ruby."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
env:
|
||||||
|
CODEQL_ENABLE_EXPERIMENTAL_FEATURES: 'true'
|
||||||
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
168
.github/workflows/__unset-environment.yml
generated
vendored
168
.github/workflows/__unset-environment.yml
generated
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
# Warning: This file is generated automatically, and should not be modified.
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
# Instead, please modify the template in the pr-checks directory and run:
|
||||||
# pr-checks/sync.sh
|
# pip install ruamel.yaml && python3 sync.py
|
||||||
# to regenerate this file.
|
# to regenerate this file.
|
||||||
|
|
||||||
name: PR Check - Test unsetting environment variables
|
name: PR Check - Test unsetting environment variables
|
||||||
@@ -10,113 +10,79 @@ env:
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/v*
|
- v1
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
schedule:
|
workflow_dispatch: {}
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
jobs:
|
||||||
unset-environment:
|
unset-environment:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
version:
|
||||||
- os: ubuntu-latest
|
- stable-20201028
|
||||||
version: linked
|
- stable-20210319
|
||||||
- os: ubuntu-latest
|
- stable-20210809
|
||||||
version: nightly-latest
|
- cached
|
||||||
|
- latest
|
||||||
|
- nightly-latest
|
||||||
|
os: [ubuntu-latest]
|
||||||
name: Test unsetting environment variables
|
name: Test unsetting environment variables
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Prepare test
|
- name: Prepare test
|
||||||
id: prepare-test
|
id: prepare-test
|
||||||
uses: ./.github/actions/prepare-test
|
uses: ./.github/prepare-test
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
use-all-platform-bundle: 'false'
|
- uses: ./../action/init
|
||||||
setup-kotlin: 'true'
|
with:
|
||||||
- name: Install Go
|
db-location: ${{ runner.temp }}/customDbLocation
|
||||||
uses: actions/setup-go@v5
|
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||||
with:
|
- name: Build code
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
shell: bash
|
||||||
cache: false
|
run: env -i PATH="$PATH" HOME="$HOME" ./build.sh
|
||||||
- uses: ./../action/init
|
- uses: ./../action/analyze
|
||||||
id: init
|
id: analysis
|
||||||
with:
|
env:
|
||||||
db-location: ${{ runner.temp }}/customDbLocation
|
TEST_MODE: true
|
||||||
# Swift is not supported on Ubuntu so we manually exclude it from the list here
|
- shell: bash
|
||||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
run: |
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
|
||||||
- name: Build code
|
if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
run: env -i PATH="$PATH" HOME="$HOME" ./build.sh
|
echo "Did not create a database for CPP, or created it in the wrong location."
|
||||||
- uses: ./../action/analyze
|
exit 1
|
||||||
id: analysis
|
fi
|
||||||
with:
|
CSHARP_DB=${{ fromJson(steps.analysis.outputs.db-locations).csharp }}
|
||||||
upload-database: false
|
if [[ ! -d $CSHARP_DB ]] || [[ ! $CSHARP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
- run: |
|
echo "Did not create a database for C Sharp, or created it in the wrong location."
|
||||||
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
|
exit 1
|
||||||
if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then
|
fi
|
||||||
echo "::error::Did not create a database for CPP, or created it in the wrong location." \
|
GO_DB=${{ fromJson(steps.analysis.outputs.db-locations).go }}
|
||||||
"Expected location was '${RUNNER_TEMP}/customDbLocation/cpp' but actual was '${CPP_DB}'"
|
if [[ ! -d $GO_DB ]] || [[ ! $GO_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
exit 1
|
echo "Did not create a database for Go, or created it in the wrong location."
|
||||||
fi
|
exit 1
|
||||||
CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}"
|
fi
|
||||||
if [[ ! -d "$CSHARP_DB" ]] || [[ ! "$CSHARP_DB" == "${RUNNER_TEMP}/customDbLocation/csharp" ]]; then
|
JAVA_DB=${{ fromJson(steps.analysis.outputs.db-locations).java }}
|
||||||
echo "::error::Did not create a database for C Sharp, or created it in the wrong location." \
|
if [[ ! -d $JAVA_DB ]] || [[ ! $JAVA_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
"Expected location was '${RUNNER_TEMP}/customDbLocation/csharp' but actual was '${CSHARP_DB}'"
|
echo "Did not create a database for Java, or created it in the wrong location."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
|
JAVASCRIPT_DB=${{ fromJson(steps.analysis.outputs.db-locations).javascript }}
|
||||||
if [[ ! -d "$GO_DB" ]] || [[ ! "$GO_DB" == "${RUNNER_TEMP}/customDbLocation/go" ]]; then
|
if [[ ! -d $JAVASCRIPT_DB ]] || [[ ! $JAVASCRIPT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
echo "::error::Did not create a database for Go, or created it in the wrong location." \
|
echo "Did not create a database for Javascript, or created it in the wrong location."
|
||||||
"Expected location was '${RUNNER_TEMP}/customDbLocation/go' but actual was '${GO_DB}'"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
PYTHON_DB=${{ fromJson(steps.analysis.outputs.db-locations).python }}
|
||||||
JAVA_DB="${{ fromJson(steps.analysis.outputs.db-locations).java }}"
|
if [[ ! -d $PYTHON_DB ]] || [[ ! $PYTHON_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
|
||||||
if [[ ! -d "$JAVA_DB" ]] || [[ ! "$JAVA_DB" == "${RUNNER_TEMP}/customDbLocation/java" ]]; then
|
echo "Did not create a database for Python, or created it in the wrong location."
|
||||||
echo "::error::Did not create a database for Java, or created it in the wrong location." \
|
exit 1
|
||||||
"Expected location was '${RUNNER_TEMP}/customDbLocation/java' but actual was '${JAVA_DB}'"
|
fi
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}"
|
|
||||||
if [[ ! -d "$JAVASCRIPT_DB" ]] || [[ ! "$JAVASCRIPT_DB" == "${RUNNER_TEMP}/customDbLocation/javascript" ]]; then
|
|
||||||
echo "::error::Did not create a database for Javascript, or created it in the wrong location." \
|
|
||||||
"Expected location was '${RUNNER_TEMP}/customDbLocation/javascript' but actual was '${JAVASCRIPT_DB}'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}"
|
|
||||||
if [[ ! -d "$PYTHON_DB" ]] || [[ ! "$PYTHON_DB" == "${RUNNER_TEMP}/customDbLocation/python" ]]; then
|
|
||||||
echo "::error::Did not create a database for Python, or created it in the wrong location." \
|
|
||||||
"Expected location was '${RUNNER_TEMP}/customDbLocation/python' but actual was '${PYTHON_DB}'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||||
|
|||||||
93
.github/workflows/__upload-quality-sarif.yml
generated
vendored
93
.github/workflows/__upload-quality-sarif.yml
generated
vendored
@@ -1,93 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: 'PR Check - Upload-sarif: code quality endpoint'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
upload-quality-sarif:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
name: 'Upload-sarif: code quality endpoint'
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
languages: cpp,csharp,java,javascript,python
|
|
||||||
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
|
||||||
github.sha }}
|
|
||||||
analysis-kinds: code-scanning,code-quality
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
# Generate some SARIF we can upload with the upload-sarif step
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
ref: refs/heads/main
|
|
||||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
|
||||||
upload: never
|
|
||||||
- uses: ./../action/upload-sarif
|
|
||||||
with:
|
|
||||||
ref: refs/heads/main
|
|
||||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
92
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
92
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
@@ -1,92 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: "PR Check - Upload-sarif: 'ref' and 'sha' from inputs"
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
upload-ref-sha-input:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: windows-latest
|
|
||||||
version: default
|
|
||||||
name: "Upload-sarif: 'ref' and 'sha' from inputs"
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
languages: cpp,csharp,java,javascript,python
|
|
||||||
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
|
||||||
github.sha }}
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
# Generate some SARIF we can upload with the upload-sarif step
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
ref: refs/heads/main
|
|
||||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
|
||||||
upload: never
|
|
||||||
- uses: ./../action/upload-sarif
|
|
||||||
with:
|
|
||||||
ref: refs/heads/main
|
|
||||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
132
.github/workflows/__with-checkout-path.yml
generated
vendored
132
.github/workflows/__with-checkout-path.yml
generated
vendored
@@ -1,132 +0,0 @@
|
|||||||
# Warning: This file is generated automatically, and should not be modified.
|
|
||||||
# Instead, please modify the template in the pr-checks directory and run:
|
|
||||||
# pr-checks/sync.sh
|
|
||||||
# to regenerate this file.
|
|
||||||
|
|
||||||
name: PR Check - Use a custom `checkout_path`
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GO111MODULE: auto
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
go-version:
|
|
||||||
type: string
|
|
||||||
description: The version of Go to install
|
|
||||||
required: false
|
|
||||||
default: '>=1.21.0'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
jobs:
|
|
||||||
with-checkout-path:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: windows-latest
|
|
||||||
version: linked
|
|
||||||
name: Use a custom `checkout_path`
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
use-all-platform-bundle: 'false'
|
|
||||||
setup-kotlin: 'true'
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ inputs.go-version || '>=1.21.0' }}
|
|
||||||
cache: false
|
|
||||||
- name: Delete original checkout
|
|
||||||
run: |
|
|
||||||
# delete the original checkout so we don't accidentally use it.
|
|
||||||
# Actions does not support deleting the current working directory, so we
|
|
||||||
# delete the contents of the directory instead.
|
|
||||||
rm -rf ./* .github .git
|
|
||||||
# Check out the actions repo again, but at a different location.
|
|
||||||
# choose an arbitrary SHA so that we can later test that the commit_oid is not from main
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
|
|
||||||
path: x/y/z/some-path
|
|
||||||
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
# it's enough to test one compiled language and one interpreted language
|
|
||||||
languages: csharp,javascript
|
|
||||||
source-root: x/y/z/some-path/tests/multi-language-repo
|
|
||||||
|
|
||||||
- name: Build code
|
|
||||||
working-directory: x/y/z/some-path/tests/multi-language-repo
|
|
||||||
run: |
|
|
||||||
./build.sh
|
|
||||||
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
with:
|
|
||||||
checkout_path: x/y/z/some-path/tests/multi-language-repo
|
|
||||||
ref: v1.1.0
|
|
||||||
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
|
|
||||||
|
|
||||||
- name: Verify SARIF after upload
|
|
||||||
run: |
|
|
||||||
EXPECTED_COMMIT_OID="474bbf07f9247ffe1856c6a0f94aeeb10e7afee6"
|
|
||||||
EXPECTED_REF="v1.1.0"
|
|
||||||
EXPECTED_CHECKOUT_URI_SUFFIX="/x/y/z/some-path/tests/multi-language-repo"
|
|
||||||
|
|
||||||
ACTUAL_COMMIT_OID="$(cat "$RUNNER_TEMP/payload.json" | jq -r .commit_oid)"
|
|
||||||
ACTUAL_REF="$(cat "$RUNNER_TEMP/payload.json" | jq -r .ref)"
|
|
||||||
ACTUAL_CHECKOUT_URI="$(cat "$RUNNER_TEMP/payload.json" | jq -r .checkout_uri)"
|
|
||||||
|
|
||||||
if [[ "$EXPECTED_COMMIT_OID" != "$ACTUAL_COMMIT_OID" ]]; then
|
|
||||||
echo "::error Invalid commit oid. Expected: $EXPECTED_COMMIT_OID Actual: $ACTUAL_COMMIT_OID"
|
|
||||||
echo "$RUNNER_TEMP/payload.json"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$EXPECTED_REF" != "$ACTUAL_REF" ]]; then
|
|
||||||
echo "::error Invalid ref. Expected: '$EXPECTED_REF' Actual: '$ACTUAL_REF'"
|
|
||||||
echo "$RUNNER_TEMP/payload.json"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$ACTUAL_CHECKOUT_URI" != *$EXPECTED_CHECKOUT_URI_SUFFIX ]]; then
|
|
||||||
echo "::error Invalid checkout URI suffix. Expected suffix: $EXPECTED_CHECKOUT_URI_SUFFIX Actual uri: $ACTUAL_CHECKOUT_URI"
|
|
||||||
echo "$RUNNER_TEMP/payload.json"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
@@ -9,24 +9,17 @@ on:
|
|||||||
# by other workflows.
|
# by other workflows.
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-expected-release-files:
|
check-expected-release-files:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout CodeQL Action
|
- name: Checkout CodeQL Action
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v2
|
||||||
- name: Check Expected Release Files
|
- name: Check Expected Release Files
|
||||||
run: |
|
run: |
|
||||||
bundle_version="$(cat "./src/defaults.json" | jq -r ".bundleVersion")"
|
bundle_version="$(cat "./src/defaults.json" | jq -r ".bundleVersion")"
|
||||||
set -x
|
set -x
|
||||||
for expected_file in "codeql-bundle.tar.gz" "codeql-bundle-linux64.tar.gz" "codeql-bundle-osx64.tar.gz" "codeql-bundle-win64.tar.gz"; do
|
for expected_file in "codeql-bundle.tar.gz" "codeql-bundle-linux64.tar.gz" "codeql-bundle-osx64.tar.gz" "codeql-bundle-win64.tar.gz" "codeql-runner-linux" "codeql-runner-macos" "codeql-runner-win.exe"; do
|
||||||
curl --location --fail --head --request GET "https://github.com/github/codeql-action/releases/download/$bundle_version/$expected_file" > /dev/null
|
curl --location --fail --head --request GET "https://github.com/github/codeql-action/releases/download/$bundle_version/$expected_file" > /dev/null
|
||||||
done
|
done
|
||||||
|
|||||||
98
.github/workflows/codeql.yml
vendored
98
.github/workflows/codeql.yml
vendored
@@ -2,23 +2,12 @@ name: "CodeQL action"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, releases/v*]
|
branches: [main, v1]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, releases/v*]
|
branches: [main, v1]
|
||||||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
||||||
# by other workflows.
|
# by other workflows.
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
schedule:
|
|
||||||
# Weekly on Sunday.
|
|
||||||
- cron: '30 1 * * 0'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Identify the CodeQL tool versions to use in the analysis job.
|
# Identify the CodeQL tool versions to use in the analysis job.
|
||||||
@@ -28,10 +17,10 @@ jobs:
|
|||||||
versions: ${{ steps.compare.outputs.versions }}
|
versions: ${{ steps.compare.outputs.versions }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
security-events: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v2
|
||||||
- name: Init with default CodeQL bundle from the VM image
|
- name: Init with default CodeQL bundle from the VM image
|
||||||
id: init-default
|
id: init-default
|
||||||
uses: ./init
|
uses: ./init
|
||||||
@@ -45,7 +34,7 @@ jobs:
|
|||||||
id: init-latest
|
id: init-latest
|
||||||
uses: ./init
|
uses: ./init
|
||||||
with:
|
with:
|
||||||
tools: linked
|
tools: latest
|
||||||
languages: javascript
|
languages: javascript
|
||||||
- name: Compare default and latest CodeQL bundle versions
|
- name: Compare default and latest CodeQL bundle versions
|
||||||
id: compare
|
id: compare
|
||||||
@@ -58,40 +47,36 @@ jobs:
|
|||||||
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
|
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
|
||||||
echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST"
|
echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST"
|
||||||
|
|
||||||
# If we're running on a pull request, run with both bundles, even if `tools: linked` would
|
# If we're running on a pull request, run with both bundles, even if `tools: latest` would
|
||||||
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
|
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
|
||||||
# required status check.
|
# required status check.
|
||||||
#
|
#
|
||||||
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be
|
# If we're running on push, then we can skip running with `tools: latest` when it would be
|
||||||
# the same as running with `tools: null`.
|
# the same as running with `tools: null`.
|
||||||
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
|
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
|
||||||
VERSIONS_JSON='[null]'
|
VERSIONS_JSON='[null]'
|
||||||
else
|
else
|
||||||
VERSIONS_JSON='[null, "linked"]'
|
VERSIONS_JSON='[null, "latest"]'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Output a JSON-encoded list with the distinct versions to test against.
|
# Output a JSON-encoded list with the distinct versions to test against.
|
||||||
echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
|
echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
|
||||||
echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT
|
echo "::set-output name=versions::${VERSIONS_JSON}"
|
||||||
|
|
||||||
analyze-javascript:
|
build:
|
||||||
needs: [check-codeql-versions]
|
needs: [check-codeql-versions]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-13,macos-14,macos-15]
|
os: [ubuntu-latest,windows-latest,macos-latest]
|
||||||
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
|
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
|
||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v5
|
- uses: ./init
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: ./init
|
|
||||||
id: init
|
id: init
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
@@ -99,58 +84,5 @@ jobs:
|
|||||||
tools: ${{ matrix.tools }}
|
tools: ${{ matrix.tools }}
|
||||||
# confirm steps.init.outputs.codeql-path points to the codeql binary
|
# confirm steps.init.outputs.codeql-path points to the codeql binary
|
||||||
- name: Print CodeQL Version
|
- name: Print CodeQL Version
|
||||||
run: >
|
run: ${{steps.init.outputs.codeql-path}} version --format=json
|
||||||
"$CODEQL" version --format=json
|
- uses: ./analyze
|
||||||
env:
|
|
||||||
CODEQL: ${{steps.init.outputs.codeql-path}}
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: ./analyze
|
|
||||||
with:
|
|
||||||
category: "/language:javascript"
|
|
||||||
|
|
||||||
|
|
||||||
analyze-actions:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: ./init
|
|
||||||
with:
|
|
||||||
languages: actions
|
|
||||||
config-file: ./.github/codeql/codeql-actions-config.yml
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: ./analyze
|
|
||||||
with:
|
|
||||||
category: "/language:actions"
|
|
||||||
|
|
||||||
analyze-python:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: ./init
|
|
||||||
with:
|
|
||||||
languages: python
|
|
||||||
config-file: ./.github/codeql/codeql-actions-config.yml
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: ./analyze
|
|
||||||
with:
|
|
||||||
category: "/language:python"
|
|
||||||
|
|||||||
230
.github/workflows/codescanning-config-cli.yml
vendored
230
.github/workflows/codescanning-config-cli.yml
vendored
@@ -1,230 +0,0 @@
|
|||||||
# Tests that the generated code scanning config file contains the expected contents
|
|
||||||
|
|
||||||
name: Code-Scanning config CLI tests
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# Diff informed queries add an additional query filter which is not yet
|
|
||||||
# taken into account by these tests.
|
|
||||||
CODEQL_ACTION_DIFF_INFORMED_QUERIES: false
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
code-scanning-config-tests:
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: read
|
|
||||||
security-events: read
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: linked
|
|
||||||
- os: macos-latest
|
|
||||||
version: linked
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: default
|
|
||||||
- os: macos-latest
|
|
||||||
version: default
|
|
||||||
- os: ubuntu-latest
|
|
||||||
version: nightly-latest
|
|
||||||
- os: macos-latest
|
|
||||||
version: nightly-latest
|
|
||||||
|
|
||||||
# Code-Scanning config not created because environment variable is not set
|
|
||||||
name: Code Scanning Configuration tests
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
|
|
||||||
- name: Empty file
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: "{}"
|
|
||||||
languages: javascript
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Packs from input
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Packs from input with +
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Queries from input
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }]
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Queries from input with +
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }]
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Queries and packs from input with +
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }],
|
|
||||||
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
|
|
||||||
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Queries and packs from config
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }],
|
|
||||||
"packs": {
|
|
||||||
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
config-file-test: .github/codeql/queries-and-packs-config.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Queries and packs from config overriden by input
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }],
|
|
||||||
"packs": ["codeql/javascript-queries"]
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
queries: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
|
|
||||||
packs: codeql/javascript-queries
|
|
||||||
config-file-test: .github/codeql/queries-and-packs-config.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Queries and packs from config merging with input
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"queries": [
|
|
||||||
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" },
|
|
||||||
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }
|
|
||||||
],
|
|
||||||
"packs": {
|
|
||||||
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2", "codeql/javascript-queries" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
|
|
||||||
packs: + codeql/javascript-queries
|
|
||||||
config-file-test: .github/codeql/queries-and-packs-config.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Multi-language packs from config
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"packs": {
|
|
||||||
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ],
|
|
||||||
"ruby": ["codeql/ruby-queries"]
|
|
||||||
},
|
|
||||||
"queries": [
|
|
||||||
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
languages: javascript,ruby
|
|
||||||
config-file-test: .github/codeql/multi-language-packs-config.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Other config properties
|
|
||||||
if: success() || failure()
|
|
||||||
uses: ./../action/.github/actions/check-codescanning-config
|
|
||||||
with:
|
|
||||||
expected-config-file-contents: |
|
|
||||||
{
|
|
||||||
"name": "Config using all properties",
|
|
||||||
"packs": ["codeql/javascript-queries" ],
|
|
||||||
"disable-default-queries": true,
|
|
||||||
"paths-ignore": ["xxx"],
|
|
||||||
"paths": ["yyy"]
|
|
||||||
}
|
|
||||||
languages: javascript
|
|
||||||
packs: + codeql/javascript-queries
|
|
||||||
config-file-test: .github/codeql/other-config-properties.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
105
.github/workflows/debug-artifacts-failure-safe.yml
vendored
105
.github/workflows/debug-artifacts-failure-safe.yml
vendored
@@ -1,105 +0,0 @@
|
|||||||
# Checks logs, SARIF, and database bundle debug artifacts exist
|
|
||||||
# when the analyze step fails.
|
|
||||||
name: PR Check - Debug artifacts after failure
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload-artifacts:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
version:
|
|
||||||
- stable-v2.20.3
|
|
||||||
- default
|
|
||||||
- linked
|
|
||||||
- nightly-latest
|
|
||||||
name: Upload debug artifacts after failure in analyze
|
|
||||||
continue-on-error: true
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Dump GitHub event
|
|
||||||
run: cat "${GITHUB_EVENT_PATH}"
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ^1.13.1
|
|
||||||
- uses: ./../action/init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
debug: true
|
|
||||||
debug-artifact-name: my-debug-artifacts
|
|
||||||
debug-database-name: my-db
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
env:
|
|
||||||
# Forces a failure in this step.
|
|
||||||
CODEQL_ACTION_EXTRA_OPTIONS: '{ "database": { "finalize": ["--invalid-option"] } }'
|
|
||||||
with:
|
|
||||||
expect-error: true
|
|
||||||
download-and-check-artifacts:
|
|
||||||
name: Download and check debug artifacts after failure in analyze
|
|
||||||
needs: upload-artifacts
|
|
||||||
timeout-minutes: 45
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v5
|
|
||||||
- name: Check expected artifacts exist
|
|
||||||
run: |
|
|
||||||
LANGUAGES="cpp csharp go java javascript python"
|
|
||||||
for version in $VERSIONS; do
|
|
||||||
echo "Artifacts from version $version:"
|
|
||||||
pushd "./my-debug-artifacts-${version//./}"
|
|
||||||
for language in $LANGUAGES; do
|
|
||||||
echo "- Checking $language"
|
|
||||||
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
|
|
||||||
echo "Missing a partial database bundle for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -d "log" ]] ; then
|
|
||||||
echo "Missing database initialization logs"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then
|
|
||||||
echo "Missing logs for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
env:
|
|
||||||
GO111MODULE: auto
|
|
||||||
100
.github/workflows/debug-artifacts-safe.yml
vendored
100
.github/workflows/debug-artifacts-safe.yml
vendored
@@ -1,100 +0,0 @@
|
|||||||
# Checks logs, SARIF, and database bundle debug artifacts exist.
|
|
||||||
name: PR Check - Debug artifact upload
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload-artifacts:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
version:
|
|
||||||
- stable-v2.20.3
|
|
||||||
- default
|
|
||||||
- linked
|
|
||||||
- nightly-latest
|
|
||||||
name: Upload debug artifacts
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
timeout-minutes: 45
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ^1.13.1
|
|
||||||
- uses: ./../action/init
|
|
||||||
id: init
|
|
||||||
with:
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
debug: true
|
|
||||||
debug-artifact-name: my-debug-artifacts
|
|
||||||
debug-database-name: my-db
|
|
||||||
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
|
|
||||||
languages: cpp,csharp,go,java,javascript,python,ruby
|
|
||||||
- name: Build code
|
|
||||||
run: ./build.sh
|
|
||||||
- uses: ./../action/analyze
|
|
||||||
id: analysis
|
|
||||||
download-and-check-artifacts:
|
|
||||||
name: Download and check debug artifacts
|
|
||||||
needs: upload-artifacts
|
|
||||||
timeout-minutes: 45
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v5
|
|
||||||
- name: Check expected artifacts exist
|
|
||||||
run: |
|
|
||||||
VERSIONS="stable-v2.20.3 default linked nightly-latest"
|
|
||||||
LANGUAGES="cpp csharp go java javascript python"
|
|
||||||
for version in $VERSIONS; do
|
|
||||||
pushd "./my-debug-artifacts-${version//./}"
|
|
||||||
echo "Artifacts from version $version:"
|
|
||||||
for language in $LANGUAGES; do
|
|
||||||
echo "- Checking $language"
|
|
||||||
if [[ ! -f "$language.sarif" ]] ; then
|
|
||||||
echo "Missing a SARIF file for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -f "my-db-$language.zip" ]] ; then
|
|
||||||
echo "Missing a database bundle for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -d "$language/log" ]] ; then
|
|
||||||
echo "Missing logs for $language"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
env:
|
|
||||||
GO111MODULE: auto
|
|
||||||
142
.github/workflows/post-release-mergeback.yml
vendored
142
.github/workflows/post-release-mergeback.yml
vendored
@@ -1,9 +1,7 @@
|
|||||||
# This workflow runs after a merge to any release branch of the action. It:
|
# This workflow runs after a release of the action.
|
||||||
# 1. Tags the merge commit on the release branch that represents the new release with an `vN.x.y`
|
# It merges any changes from the release back into the
|
||||||
# tag
|
# main branch. Typically, this is just a single commit
|
||||||
# 2. Updates the `vN` tag to refer to this merge commit.
|
# that updates the changelog.
|
||||||
# 3. Iff vN == vLatest, merges any changes from the release back into the main branch.
|
|
||||||
# Typically, this is two commits – one to update the version number and one to rebuild.
|
|
||||||
name: Tag release and merge back
|
name: Tag release and merge back
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -16,70 +14,53 @@ on:
|
|||||||
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- releases/v*
|
- v1
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
merge-back:
|
merge-back:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: Automation
|
|
||||||
if: github.repository == 'github/codeql-action'
|
if: github.repository == 'github/codeql-action'
|
||||||
env:
|
env:
|
||||||
BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}"
|
BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}"
|
||||||
HEAD_BRANCH: "${{ github.head_ref || github.ref }}"
|
HEAD_BRANCH: "${{ github.head_ref || github.ref }}"
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # needed to create tags and push commits
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Dump environment
|
- name: Dump GitHub Event context
|
||||||
run: env
|
|
||||||
|
|
||||||
- name: Dump GitHub context
|
|
||||||
env:
|
env:
|
||||||
GITHUB_CONTEXT: '${{ toJson(github) }}'
|
GITHUB_EVENT_CONTEXT: "${{ toJson(github.event) }}"
|
||||||
run: echo "${GITHUB_CONTEXT}"
|
run: echo "$GITHUB_EVENT_CONTEXT"
|
||||||
|
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v2
|
||||||
with:
|
- uses: actions/setup-node@v2
|
||||||
fetch-depth: 0 # ensure we have all tags and can push commits
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
|
|
||||||
- name: Update git config
|
- name: Update git config
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions@github.com"
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
|
|
||||||
- name: Get version and new branch
|
- name: Get version and new branch
|
||||||
id: getVersion
|
id: getVersion
|
||||||
run: |
|
run: |
|
||||||
VERSION="v$(jq '.version' -r 'package.json')"
|
VERSION="v$(jq '.version' -r 'package.json')"
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
SHORT_SHA="${GITHUB_SHA:0:8}"
|
||||||
short_sha="${GITHUB_SHA:0:8}"
|
echo "::set-output name=version::$VERSION"
|
||||||
NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${short_sha}"
|
NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${SHORT_SHA}"
|
||||||
echo "newBranch=${NEW_BRANCH}" >> $GITHUB_OUTPUT
|
echo "::set-output name=newBranch::$NEW_BRANCH"
|
||||||
LATEST_RELEASE_BRANCH=$(git branch -r | grep -E "origin/releases/v[0-9]+$" | sed 's/origin\///g' | sort -V | tail -1 | xargs)
|
|
||||||
echo "latest_release_branch=${LATEST_RELEASE_BRANCH}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Dump branches
|
- name: Dump branches
|
||||||
env:
|
env:
|
||||||
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
|
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
|
||||||
run: |
|
run: |
|
||||||
echo "BASE_BRANCH ${BASE_BRANCH}"
|
echo "BASE_BRANCH $BASE_BRANCH"
|
||||||
echo "HEAD_BRANCH ${HEAD_BRANCH}"
|
echo "HEAD_BRANCH $HEAD_BRANCH"
|
||||||
echo "NEW_BRANCH ${NEW_BRANCH}"
|
echo "NEW_BRANCH $NEW_BRANCH"
|
||||||
echo "LATEST_RELEASE_BRANCH ${LATEST_RELEASE_BRANCH}"
|
|
||||||
echo "GITHUB_REF ${GITHUB_REF}"
|
|
||||||
|
|
||||||
- name: Create mergeback branch
|
- name: Create mergeback branch
|
||||||
env:
|
env:
|
||||||
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
|
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
|
||||||
run: |
|
run: |
|
||||||
git checkout -b "${NEW_BRANCH}"
|
git checkout -b "$NEW_BRANCH"
|
||||||
|
|
||||||
- name: Check for tag
|
- name: Check for tag
|
||||||
id: check
|
id: check
|
||||||
@@ -87,13 +68,13 @@ jobs:
|
|||||||
VERSION: "${{ steps.getVersion.outputs.version }}"
|
VERSION: "${{ steps.getVersion.outputs.version }}"
|
||||||
run: |
|
run: |
|
||||||
set +e # don't fail on an errored command
|
set +e # don't fail on an errored command
|
||||||
git ls-remote --tags origin | grep "${VERSION}"
|
git ls-remote --tags origin | grep "$VERSION"
|
||||||
exists="$?"
|
EXISTS="$?"
|
||||||
if [ "${exists}" -eq 0 ]; then
|
if [ "$EXISTS" -eq 0 ]; then
|
||||||
echo "Tag ${VERSION} exists. Not going to re-release."
|
echo "Tag $TAG exists. Not going to re-release."
|
||||||
echo "exists=true" >> $GITHUB_OUTPUT
|
echo "::set-output name=exists::true"
|
||||||
else
|
else
|
||||||
echo "Tag ${VERSION} does not exist yet."
|
echo "Tag $TAG does not exist yet."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# we didn't tag the release during the update-release-branch workflow because the
|
# we didn't tag the release during the update-release-branch workflow because the
|
||||||
@@ -104,56 +85,35 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.getVersion.outputs.version }}
|
VERSION: ${{ steps.getVersion.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
# Create the `vx.y.z` tag
|
git tag -a "$VERSION" -m "$VERSION"
|
||||||
git tag --annotate "${VERSION}" --message "${VERSION}"
|
git fetch --unshallow # unshallow the repo in order to allow pushes
|
||||||
# Update the `vx` tag
|
git push origin --follow-tags "$VERSION"
|
||||||
major_version_tag=$(cut -d '.' -f1 <<< "${VERSION}")
|
|
||||||
# Use `--force` to overwrite the major version tag
|
|
||||||
git tag --annotate "${major_version_tag}" --message "${major_version_tag}" --force
|
|
||||||
# Push the tags, using:
|
|
||||||
# - `--atomic` to make sure we either update both tags or neither (an intermediate state,
|
|
||||||
# e.g. where we update the vN.x.y tag on the remote but not the vN tag, could result in
|
|
||||||
# unwanted Dependabot updates, e.g. from vN to vN.x.y)
|
|
||||||
# - `--force` since we're overwriting the `vN` tag
|
|
||||||
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}"
|
|
||||||
|
|
||||||
- name: Prepare partial Changelog
|
- name: Create mergeback branch
|
||||||
|
if: steps.check.outputs.exists != 'true'
|
||||||
env:
|
env:
|
||||||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
|
|
||||||
VERSION: "${{ steps.getVersion.outputs.version }}"
|
VERSION: "${{ steps.getVersion.outputs.version }}"
|
||||||
|
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
|
||||||
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
run: |
|
run: |
|
||||||
python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION" > $PARTIAL_CHANGELOG
|
set -exu
|
||||||
|
PR_TITLE="Mergeback $VERSION $HEAD_BRANCH into $BASE_BRANCH"
|
||||||
|
PR_BODY="Updates version and changelog."
|
||||||
|
|
||||||
echo "::group::Partial CHANGELOG"
|
# Update the changelog
|
||||||
cat $PARTIAL_CHANGELOG
|
perl -i -pe 's/^/## \[UNRELEASED\]\n\nNo user facing changes.\n\n/ if($.==3)' CHANGELOG.md
|
||||||
echo "::endgroup::"
|
git add .
|
||||||
|
git commit -m "Update changelog and version after $VERSION"
|
||||||
|
npm version patch
|
||||||
|
|
||||||
- name: Create mergeback branch and PR
|
git push origin "$NEW_BRANCH"
|
||||||
if: ${{ steps.check.outputs.exists != 'true' && endsWith(github.ref_name, steps.getVersion.outputs.latest_release_branch) }}
|
|
||||||
uses: ./.github/actions/prepare-mergeback-branch
|
|
||||||
with:
|
|
||||||
base: "${{ env.BASE_BRANCH }}"
|
|
||||||
head: "${{ env.HEAD_BRANCH }}"
|
|
||||||
branch: "${{ steps.getVersion.outputs.newBranch }}"
|
|
||||||
version: "${{ steps.getVersion.outputs.version }}"
|
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
|
|
||||||
- name: Generate token
|
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
|
||||||
uses: actions/create-github-app-token@v2.1.1
|
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
|
||||||
id: app-token
|
gh pr create \
|
||||||
with:
|
--head "$NEW_BRANCH" \
|
||||||
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
--base "$BASE_BRANCH" \
|
||||||
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
|
--title "$PR_TITLE" \
|
||||||
|
--label "Update dependencies" \
|
||||||
- name: Create the GitHub release
|
--body "$PR_BODY" \
|
||||||
env:
|
--draft
|
||||||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
|
|
||||||
VERSION: "${{ steps.getVersion.outputs.version }}"
|
|
||||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
||||||
run: |
|
|
||||||
# Do not mark this release as latest. The most recent CLI release must be marked as latest.
|
|
||||||
gh release create \
|
|
||||||
"$VERSION" \
|
|
||||||
--latest=false \
|
|
||||||
--title "$VERSION" \
|
|
||||||
--notes-file "$PARTIAL_CHANGELOG"
|
|
||||||
|
|||||||
493
.github/workflows/pr-checks.yml
vendored
493
.github/workflows/pr-checks.yml
vendored
@@ -1,115 +1,434 @@
|
|||||||
name: PR Checks
|
name: PR Checks (Basic Checks and Runner)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches: [main, v1]
|
||||||
pull_request:
|
pull_request:
|
||||||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
||||||
# by other workflows.
|
# by other workflows.
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
lint-js:
|
||||||
name: Unit Tests
|
name: Lint
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: write # needed to upload ESLint results
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
timeout-minutes: 45
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare git (Windows)
|
- uses: actions/checkout@v2
|
||||||
if: runner.os == 'Windows'
|
- name: Run Lint
|
||||||
run: git config --global core.autocrlf false
|
run: npm run-script lint
|
||||||
|
|
||||||
- uses: actions/checkout@v5
|
check-js:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20.x'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Set up Python
|
steps:
|
||||||
uses: actions/setup-python@v5
|
- uses: actions/checkout@v2
|
||||||
with:
|
- name: Check generated JS
|
||||||
python-version: 3.11
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
# Use the system Bash shell to ensure we can run commands like `npm ci`
|
|
||||||
# that are not available in the default shell on Windows.
|
|
||||||
npm config set script-shell bash
|
|
||||||
npm ci
|
|
||||||
|
|
||||||
- name: Verify compiled JS up to date
|
|
||||||
run: .github/workflows/script/check-js.sh
|
run: .github/workflows/script/check-js.sh
|
||||||
|
|
||||||
|
check-node-modules:
|
||||||
|
name: Check modules up to date
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Check node modules up to date
|
||||||
|
run: .github/workflows/script/check-node-modules.sh
|
||||||
|
|
||||||
|
verify-pr-checks:
|
||||||
|
name: Verify PR checks up to date
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install ruamel.yaml
|
||||||
- name: Verify PR checks up to date
|
- name: Verify PR checks up to date
|
||||||
run: .github/workflows/script/verify-pr-checks.sh
|
run: .github/workflows/script/verify-pr-checks.sh
|
||||||
|
|
||||||
- name: Run unit tests
|
npm-test:
|
||||||
run: npm test
|
name: Unit Test
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
- name: Lint
|
strategy:
|
||||||
if: matrix.os != 'windows-latest'
|
matrix:
|
||||||
run: npm run lint-ci
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
- name: Upload sarif
|
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
with:
|
|
||||||
sarif_file: eslint.sarif
|
|
||||||
category: eslint
|
|
||||||
|
|
||||||
check-node-version:
|
|
||||||
if: github.event.pull_request
|
|
||||||
name: Check Action Node versions
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 45
|
|
||||||
env:
|
|
||||||
BASE_REF: ${{ github.base_ref }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v2
|
||||||
- id: head-version
|
- name: npm run-script test
|
||||||
name: Verify all Actions use the same Node version
|
run: npm run-script test
|
||||||
|
|
||||||
|
runner-analyze-javascript-ubuntu:
|
||||||
|
name: Runner ubuntu JS analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
run: |
|
run: |
|
||||||
NODE_VERSION=$(find . -name "action.yml" -exec yq -e '.runs.using' {} \; | grep node | sort | uniq)
|
cd runner
|
||||||
echo "NODE_VERSION: ${NODE_VERSION}"
|
npm install
|
||||||
if [[ $(echo "$NODE_VERSION" | wc -l) -gt 1 ]]; then
|
npm run build-runner
|
||||||
echo "::error::More than one node version used in 'action.yml' files."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "node_version=${NODE_VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- id: checkout-base
|
- name: Run init
|
||||||
name: 'Backport: Check out base ref'
|
run: |
|
||||||
if: ${{ startsWith(github.head_ref, 'backport-') }}
|
# Pass --config-file here, but not for other jobs in this workflow.
|
||||||
uses: actions/checkout@v5
|
# This means we're testing the config file parsing in the runner
|
||||||
with:
|
# but not slowing down all jobs unnecessarily as it doesn't add much
|
||||||
ref: ${{ env.BASE_REF }}
|
# testing the parsing on different operating systems and languages.
|
||||||
|
runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
- name: 'Backport: Verify Node versions unchanged'
|
- name: Run analyze
|
||||||
if: steps.checkout-base.outcome == 'success'
|
run: |
|
||||||
|
runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
env:
|
env:
|
||||||
HEAD_VERSION: ${{ steps.head-version.outputs.node_version }}
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-javascript-windows:
|
||||||
|
name: Runner windows JS analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
run: |
|
run: |
|
||||||
BASE_VERSION=$(find . -name "action.yml" -exec yq -e '.runs.using' {} \; | grep node | sort | uniq)
|
cd runner
|
||||||
echo "HEAD_VERSION: ${HEAD_VERSION}"
|
npm install
|
||||||
echo "BASE_VERSION: ${BASE_VERSION}"
|
npm run build-runner
|
||||||
if [[ "$BASE_VERSION" != "$HEAD_VERSION" ]]; then
|
|
||||||
echo "::error::Cannot change the Node version of an Action in a backport PR."
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages javascript --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-javascript-macos:
|
||||||
|
name: Runner macos JS analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-csharp-ubuntu:
|
||||||
|
name: Runner ubuntu C# analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Move codeql-action
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir ../action
|
||||||
|
mv * .github ../action/
|
||||||
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
|
mv ../action/.github/workflows .github
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd ../action/runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Build code
|
||||||
|
run: |
|
||||||
|
. ./codeql-runner/codeql-env.sh
|
||||||
|
$CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-csharp-windows:
|
||||||
|
name: Runner windows C# analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Move codeql-action
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir ../action
|
||||||
|
mv * .github ../action/
|
||||||
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
|
mv ../action/.github/workflows .github
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd ../action/runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Build code
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
cat ./codeql-runner/codeql-env.sh | Invoke-Expression
|
||||||
|
$Env:CODEQL_EXTRACTOR_CSHARP_ROOT = "" # Unset an environment variable to make sure the tracer resists this
|
||||||
|
& $Env:CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
|
||||||
|
|
||||||
|
- name: Upload tracer logs
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: tracer-logs
|
||||||
|
path: ./codeql-runner/compound-build-tracer.log
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-csharp-macos:
|
||||||
|
name: Runner macos C# analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Move codeql-action
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir ../action
|
||||||
|
mv * .github ../action/
|
||||||
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
|
mv ../action/.github/workflows .github
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd ../action/runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Build code
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ./codeql-runner/codeql-env.sh
|
||||||
|
$CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-csharp-autobuild-ubuntu:
|
||||||
|
name: Runner ubuntu autobuild C# analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Move codeql-action
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir ../action
|
||||||
|
mv * .github ../action/
|
||||||
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
|
mv ../action/.github/workflows .github
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd ../action/runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Build code
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-linux autobuild
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-csharp-autobuild-windows:
|
||||||
|
name: Runner windows autobuild C# analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Move codeql-action
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir ../action
|
||||||
|
mv * .github ../action/
|
||||||
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
|
mv ../action/.github/workflows .github
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd ../action/runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Build code
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-win.exe autobuild
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-analyze-csharp-autobuild-macos:
|
||||||
|
name: Runner macos autobuild C# analyze
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Move codeql-action
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir ../action
|
||||||
|
mv * .github ../action/
|
||||||
|
mv ../action/tests/multi-language-repo/{*,.github} .
|
||||||
|
mv ../action/.github/workflows .github
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd ../action/runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Build code
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-macos autobuild
|
||||||
|
|
||||||
|
- name: Run analyze
|
||||||
|
run: |
|
||||||
|
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
env:
|
||||||
|
TEST_MODE: true
|
||||||
|
|
||||||
|
runner-upload-sarif:
|
||||||
|
name: Runner upload sarif
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Upload with runner
|
||||||
|
run: |
|
||||||
|
# Deliberately don't use TEST_MODE here. This is specifically testing
|
||||||
|
# the compatibility with the API.
|
||||||
|
runner/dist/codeql-runner-linux upload --sarif-file src/testdata/empty-sarif.sarif --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
runner-extractor-ram-threads-options:
|
||||||
|
name: Runner ubuntu extractor RAM and threads options
|
||||||
|
needs: [check-js, check-node-modules]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- name: Run init
|
||||||
|
run: |
|
||||||
|
runner/dist/codeql-runner-linux init --ram=230 --threads=1 --repository $GITHUB_REPOSITORY --languages java --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Assert Results
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
. ./codeql-runner/codeql-env.sh
|
||||||
|
if [ "${CODEQL_RAM}" != "230" ]; then
|
||||||
|
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
|
||||||
|
echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "${CODEQL_THREADS}" != "1" ]; then
|
||||||
|
echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
|
||||||
|
echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
77
.github/workflows/prepare-release.yml
vendored
77
.github/workflows/prepare-release.yml
vendored
@@ -1,77 +0,0 @@
|
|||||||
name: Prepare release
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
outputs:
|
|
||||||
version:
|
|
||||||
description: "The version that is being released."
|
|
||||||
value: ${{ jobs.prepare.outputs.version }}
|
|
||||||
major_version:
|
|
||||||
description: "The major version of the release."
|
|
||||||
value: ${{ jobs.prepare.outputs.major_version }}
|
|
||||||
latest_tag:
|
|
||||||
description: "The most recent, existing release tag."
|
|
||||||
value: ${{ jobs.prepare.outputs.latest_tag }}
|
|
||||||
backport_source_branch:
|
|
||||||
description: "The release branch for the given tag."
|
|
||||||
value: ${{ jobs.prepare.outputs.backport_source_branch }}
|
|
||||||
backport_target_branches:
|
|
||||||
description: "JSON encoded list of branches to target with backports."
|
|
||||||
value: ${{ jobs.prepare.outputs.backport_target_branches }}
|
|
||||||
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/prepare-release.yml
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
prepare:
|
|
||||||
name: "Prepare release"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'github/codeql-action'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
version: ${{ steps.versions.outputs.version }}
|
|
||||||
major_version: ${{ steps.versions.outputs.major_version }}
|
|
||||||
latest_tag: ${{ steps.versions.outputs.latest_tag }}
|
|
||||||
backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }}
|
|
||||||
backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Need full history for calculation of diffs
|
|
||||||
|
|
||||||
- name: Configure runner for release
|
|
||||||
uses: ./.github/actions/release-initialise
|
|
||||||
|
|
||||||
- name: Get version tags
|
|
||||||
id: versions
|
|
||||||
run: |
|
|
||||||
VERSION="v$(jq '.version' -r 'package.json')"
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
MAJOR_VERSION=$(cut -d '.' -f1 <<< "${VERSION}")
|
|
||||||
echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
|
|
||||||
echo "latest_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Determine older release branches
|
|
||||||
id: branches
|
|
||||||
uses: ./.github/actions/release-branches
|
|
||||||
with:
|
|
||||||
major_version: ${{ steps.versions.outputs.major_version }}
|
|
||||||
latest_tag: ${{ steps.versions.outputs.latest_tag }}
|
|
||||||
|
|
||||||
- name: Print release information
|
|
||||||
run: |
|
|
||||||
echo 'version: ${{ steps.versions.outputs.version }}'
|
|
||||||
echo 'major_version: ${{ steps.versions.outputs.major_version }}'
|
|
||||||
echo 'latest_tag: ${{ steps.versions.outputs.latest_tag }}'
|
|
||||||
echo 'backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }}'
|
|
||||||
echo 'backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }}'
|
|
||||||
39
.github/workflows/publish-immutable-action.yml
vendored
39
.github/workflows/publish-immutable-action.yml
vendored
@@ -1,39 +0,0 @@
|
|||||||
name: 'Publish Immutable Action Version'
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check release name
|
|
||||||
id: check
|
|
||||||
env:
|
|
||||||
RELEASE_NAME: ${{ github.event.release.name }}
|
|
||||||
run: |
|
|
||||||
echo "Release name: ${{ github.event.release.name }}"
|
|
||||||
if [[ $RELEASE_NAME == v* ]]; then
|
|
||||||
echo "This is a CodeQL Action release. Create an Immutable Action"
|
|
||||||
echo "is-action-release=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "This is a CodeQL Bundle release. Do not create an Immutable Action"
|
|
||||||
echo "is-action-release=false" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
- name: Checking out
|
|
||||||
if: steps.check.outputs.is-action-release == 'true'
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Publish
|
|
||||||
if: steps.check.outputs.is-action-release == 'true'
|
|
||||||
id: publish
|
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
|
||||||
157
.github/workflows/python-deps.yml
vendored
Normal file
157
.github/workflows/python-deps.yml
vendored
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
name: Test Python Package Installation on Linux and Mac
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, v1]
|
||||||
|
pull_request:
|
||||||
|
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
||||||
|
# by other workflows.
|
||||||
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-setup-python-scripts:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
||||||
|
python_version: [2, 3]
|
||||||
|
|
||||||
|
env:
|
||||||
|
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
|
||||||
|
PYTHON_VERSION: ${{ matrix.python_version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: ./init
|
||||||
|
id: init
|
||||||
|
with:
|
||||||
|
tools: latest
|
||||||
|
languages: python
|
||||||
|
setup-python-dependencies: false
|
||||||
|
|
||||||
|
- name: Test Auto Package Installation
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
$GITHUB_WORKSPACE/python-setup/install_tools.sh
|
||||||
|
|
||||||
|
cd $GITHUB_WORKSPACE/python-setup/tests/${PYTHON_DEPS_TYPE}/requests-${PYTHON_VERSION}
|
||||||
|
|
||||||
|
case ${{ matrix.os }} in
|
||||||
|
ubuntu-latest*) basePath="/opt";;
|
||||||
|
macos-latest*) basePath="/Users/runner";;
|
||||||
|
esac
|
||||||
|
echo ${basePath}
|
||||||
|
|
||||||
|
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
|
||||||
|
- name: Setup for extractor
|
||||||
|
run: |
|
||||||
|
echo $CODEQL_PYTHON
|
||||||
|
# only run if $CODEQL_PYTHON is set
|
||||||
|
if [ ! -z $CODEQL_PYTHON ]; then
|
||||||
|
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Verify packages installed
|
||||||
|
run: |
|
||||||
|
$GITHUB_WORKSPACE/python-setup/tests/check_requests_2_26_0.sh ${PYTHON_VERSION}
|
||||||
|
|
||||||
|
# This one shouldn't fail, but also won't install packages
|
||||||
|
test-setup-python-scripts-non-standard-location:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: ./init
|
||||||
|
id: init
|
||||||
|
with:
|
||||||
|
tools: latest
|
||||||
|
languages: python
|
||||||
|
setup-python-dependencies: false
|
||||||
|
|
||||||
|
- name: Test Auto Package Installation
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
$GITHUB_WORKSPACE/python-setup/install_tools.sh
|
||||||
|
|
||||||
|
cd $GITHUB_WORKSPACE/python-setup/tests/requirements/non-standard-location
|
||||||
|
|
||||||
|
case ${{ matrix.os }} in
|
||||||
|
ubuntu-latest*) basePath="/opt";;
|
||||||
|
macos-latest*) basePath="/Users/runner";;
|
||||||
|
esac
|
||||||
|
echo ${basePath}
|
||||||
|
|
||||||
|
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
|
||||||
|
|
||||||
|
- name: Setup for extractor
|
||||||
|
run: |
|
||||||
|
echo $CODEQL_PYTHON
|
||||||
|
# only run if $CODEQL_PYTHON is set
|
||||||
|
if [ ! -z $CODEQL_PYTHON ]; then
|
||||||
|
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Verify packages installed
|
||||||
|
run: |
|
||||||
|
test -z $LGTM_INDEX_IMPORT_PATH
|
||||||
|
|
||||||
|
test-setup-python-scripts-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python_deps_type: [pipenv, poetry, requirements, setup_py]
|
||||||
|
python_version: [2, 3]
|
||||||
|
|
||||||
|
env:
|
||||||
|
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
|
||||||
|
PYTHON_VERSION: ${{ matrix.python_version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: ./init
|
||||||
|
with:
|
||||||
|
tools: latest
|
||||||
|
languages: python
|
||||||
|
setup-python-dependencies: false
|
||||||
|
|
||||||
|
- name: Test Auto Package Installation
|
||||||
|
run: |
|
||||||
|
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
|
||||||
|
powershell -File $cmd
|
||||||
|
|
||||||
|
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/$Env:PYTHON_DEPS_TYPE/requests-$Env:PYTHON_VERSION
|
||||||
|
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
|
||||||
|
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
|
||||||
|
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
|
||||||
|
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
|
||||||
|
|
||||||
|
- name: Setup for extractor
|
||||||
|
run: |
|
||||||
|
echo $Env:CODEQL_PYTHON
|
||||||
|
|
||||||
|
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON
|
||||||
|
|
||||||
|
- name: Verify packages installed
|
||||||
|
run: |
|
||||||
|
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_2_26_0.ps1"
|
||||||
|
powershell -File $cmd $Env:PYTHON_VERSION
|
||||||
47
.github/workflows/python312-windows.yml
vendored
47
.github/workflows/python312-windows.yml
vendored
@@ -1,47 +0,0 @@
|
|||||||
name: Test that the workaround for python 3.12 on windows works
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, releases/v*]
|
|
||||||
pull_request:
|
|
||||||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
|
||||||
# by other workflows.
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
|
||||||
schedule:
|
|
||||||
# Weekly on Monday.
|
|
||||||
- cron: '0 0 * * 1'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-setup-python-scripts:
|
|
||||||
env:
|
|
||||||
CODEQL_ACTION_TEST_MODE: true
|
|
||||||
timeout-minutes: 45
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: 3.12
|
|
||||||
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Prepare test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: default
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: ./../action/init
|
|
||||||
with:
|
|
||||||
tools: linked
|
|
||||||
languages: python
|
|
||||||
|
|
||||||
- name: Analyze
|
|
||||||
uses: ./../action/analyze
|
|
||||||
73
.github/workflows/query-filters.yml
vendored
73
.github/workflows/query-filters.yml
vendored
@@ -1,73 +0,0 @@
|
|||||||
name: Query filters tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/v*
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
- ready_for_review
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * *'
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
query-filters:
|
|
||||||
name: Query Filters Tests
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read # This permission is needed to allow the GitHub Actions workflow to read the contents of the repository.
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20.x
|
|
||||||
cache: npm
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Prepare test
|
|
||||||
id: prepare-test
|
|
||||||
uses: ./.github/actions/prepare-test
|
|
||||||
with:
|
|
||||||
version: linked
|
|
||||||
|
|
||||||
- name: Check SARIF for default queries with Single include, Single exclude
|
|
||||||
uses: ./../action/.github/actions/query-filter-test
|
|
||||||
with:
|
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
queries-run: js/zipslip
|
|
||||||
queries-not-run: js/path-injection
|
|
||||||
config-file: ./.github/codeql/codeql-config-query-filters1.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Check SARIF for query packs with Single include, Single exclude
|
|
||||||
uses: ./../action/.github/actions/query-filter-test
|
|
||||||
with:
|
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
queries-run: js/zipslip,javascript/example/empty-or-one-block
|
|
||||||
queries-not-run: js/path-injection
|
|
||||||
config-file: ./.github/codeql/codeql-config-query-filters2.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
|
|
||||||
- name: Check SARIF for query packs and local queries with Single include, Single exclude
|
|
||||||
uses: ./../action/.github/actions/query-filter-test
|
|
||||||
with:
|
|
||||||
sarif-file: ${{ runner.temp }}/results/javascript.sarif
|
|
||||||
queries-run: js/zipslip,javascript/example/empty-or-one-block,inrepo-javascript-querypack/show-ifs
|
|
||||||
queries-not-run: js/path-injection,complex-python-querypack/show-ifs,complex-python-querypack/foo/bar/show-ifs
|
|
||||||
config-file: ./.github/codeql/codeql-config-query-filters3.yml
|
|
||||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
|
||||||
131
.github/workflows/rebuild.yml
vendored
131
.github/workflows/rebuild.yml
vendored
@@ -1,131 +0,0 @@
|
|||||||
name: Rebuild Action
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rebuild:
|
|
||||||
name: Rebuild Action
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.label.name == 'Rebuild' || github.event_name == 'workflow_dispatch'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # needed to push rebuilt commit
|
|
||||||
pull-requests: write # needed to comment on the PR
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ github.event.pull_request.head.ref || github.event.ref }}
|
|
||||||
|
|
||||||
- name: Remove label
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
||||||
run: |
|
|
||||||
gh pr edit --repo github/codeql-action "$PR_NUMBER" \
|
|
||||||
--remove-label "Rebuild"
|
|
||||||
|
|
||||||
- name: Configure git
|
|
||||||
run: |
|
|
||||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --global user.name "github-actions[bot]"
|
|
||||||
|
|
||||||
- name: Merge in changes from base branch
|
|
||||||
id: merge
|
|
||||||
env:
|
|
||||||
BASE_BRANCH: ${{ github.event.pull_request.base.ref || 'main' }}
|
|
||||||
run: |
|
|
||||||
git fetch origin "$BASE_BRANCH"
|
|
||||||
|
|
||||||
# Allow merge conflicts in `lib`, since rebuilding should resolve them.
|
|
||||||
git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected, continuing."
|
|
||||||
MERGE_RESULT=$?
|
|
||||||
|
|
||||||
if [ "$MERGE_RESULT" -ne 0 ]; then
|
|
||||||
echo "merge-in-progress=true" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check
|
|
||||||
# since `node_modules/@types/semver/README.md` fails it.
|
|
||||||
if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then
|
|
||||||
echo "Merge conflicts were detected outside of the lib directory. Please resolve them manually."
|
|
||||||
git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "No merge conflicts found outside the lib directory. We should be able to resolve all of" \
|
|
||||||
"these by rebuilding the Action."
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Compile TypeScript
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
npm run lint -- --fix
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: 3.11
|
|
||||||
|
|
||||||
- name: Generate workflows
|
|
||||||
run: |
|
|
||||||
cd pr-checks
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install ruamel.yaml==0.17.31
|
|
||||||
python3 sync.py
|
|
||||||
|
|
||||||
- name: "Merge in progress: Finish merge and push"
|
|
||||||
if: steps.merge.outputs.merge-in-progress == 'true'
|
|
||||||
run: |
|
|
||||||
echo "Finishing merge and pushing changes."
|
|
||||||
git add --all
|
|
||||||
git commit --no-edit
|
|
||||||
git push
|
|
||||||
|
|
||||||
- name: "No merge in progress: Check for changes and push"
|
|
||||||
if: steps.merge.outputs.merge-in-progress != 'true'
|
|
||||||
id: push
|
|
||||||
run: |
|
|
||||||
if [ ! -z "$(git status --porcelain)" ]; then
|
|
||||||
echo "Changes detected, committing and pushing."
|
|
||||||
git add --all
|
|
||||||
# If the merge originally had conflicts, finish the merge.
|
|
||||||
# Otherwise, just commit the changes.
|
|
||||||
if git rev-parse --verify MERGE_HEAD >/dev/null 2>&1; then
|
|
||||||
echo "In progress merge detected, finishing it up."
|
|
||||||
git merge --continue
|
|
||||||
else
|
|
||||||
echo "No in-progress merge detected, committing changes."
|
|
||||||
git commit -m "Rebuild"
|
|
||||||
fi
|
|
||||||
echo "Pushing changes"
|
|
||||||
git push
|
|
||||||
echo "changes=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "No changes detected, nothing to commit."
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Notify about rebuild
|
|
||||||
if: >-
|
|
||||||
github.event_name == 'pull_request' &&
|
|
||||||
(
|
|
||||||
steps.merge.outputs.merge-in-progress == 'true' ||
|
|
||||||
steps.push.outputs.changes == 'true'
|
|
||||||
)
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
||||||
run: |
|
|
||||||
echo "Pushed a commit to rebuild the Action." \
|
|
||||||
"Please mark the PR as ready for review to trigger PR checks." |
|
|
||||||
gh pr comment --body-file - --repo github/codeql-action "$PR_NUMBER"
|
|
||||||
gh pr ready --undo --repo github/codeql-action "$PR_NUMBER"
|
|
||||||
54
.github/workflows/release-runner.yml
vendored
Normal file
54
.github/workflows/release-runner.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
name: Release runner
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
bundle-tag:
|
||||||
|
description: 'Tag of the bundle release (e.g., "codeql-bundle-20200826")'
|
||||||
|
required: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-runner:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: "${{ github.event.inputs.bundle-tag }}"
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
extension: ["linux", "macos", "win.exe"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build runner
|
||||||
|
run: |
|
||||||
|
cd runner
|
||||||
|
npm install
|
||||||
|
npm run build-runner
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: codeql-runner-${{matrix.extension}}
|
||||||
|
path: runner/dist/codeql-runner-${{matrix.extension}}
|
||||||
|
|
||||||
|
- name: Resolve Upload URL for the release
|
||||||
|
if: ${{ github.event.inputs.bundle-tag != null }}
|
||||||
|
id: save_url
|
||||||
|
run: |
|
||||||
|
UPLOAD_URL=$(curl -sS \
|
||||||
|
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${RELEASE_TAG}" \
|
||||||
|
-H "Accept: application/json" \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq .upload_url | sed s/\"//g)
|
||||||
|
echo ${UPLOAD_URL}
|
||||||
|
echo "::set-output name=upload_url::${UPLOAD_URL}"
|
||||||
|
|
||||||
|
- name: Upload Platform Package
|
||||||
|
if: ${{ github.event.inputs.bundle-tag != null }}
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.save_url.outputs.upload_url }}
|
||||||
|
asset_path: runner/dist/codeql-runner-${{matrix.extension}}
|
||||||
|
asset_name: codeql-runner-${{matrix.extension}}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
182
.github/workflows/rollback-release.yml
vendored
182
.github/workflows/rollback-release.yml
vendored
@@ -1,182 +0,0 @@
|
|||||||
name: Rollback release
|
|
||||||
on:
|
|
||||||
# You can trigger this workflow via workflow dispatch to start a rollback.
|
|
||||||
# This will create a draft release that mirrors the release for `rollback-tag`.
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
rollback-tag:
|
|
||||||
type: string
|
|
||||||
description: "The tag of an old release to roll-back to."
|
|
||||||
required: true
|
|
||||||
# Only for dry-runs of changes to the workflow.
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/rollback-release.yml
|
|
||||||
- .github/actions/prepare-mergeback-branch/**
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
prepare:
|
|
||||||
name: "Prepare release"
|
|
||||||
if: github.repository == 'github/codeql-action'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
uses: ./.github/workflows/prepare-release.yml
|
|
||||||
|
|
||||||
rollback:
|
|
||||||
name: "Create rollback release"
|
|
||||||
if: github.repository == 'github/codeql-action'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 45
|
|
||||||
|
|
||||||
# Don't set the deployment environment for test runs
|
|
||||||
# The Actions token does not have permissions to push changes to workflow files.
|
|
||||||
# Since workflow files may change as part of a backport PR, we use the "Automation" environment for real runs to authenticate as a GitHub App and push these changes.
|
|
||||||
environment: ${{ github.event_name == 'workflow_dispatch' && 'Automation' || '' }}
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- prepare
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # needed to push to the repo (tags and releases)
|
|
||||||
pull-requests: write # needed to create the mergeback PR
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Need full history for calculation of diffs
|
|
||||||
|
|
||||||
- name: Configure runner for release
|
|
||||||
uses: ./.github/actions/release-initialise
|
|
||||||
|
|
||||||
- name: Create tag for testing
|
|
||||||
if: github.event_name != 'workflow_dispatch'
|
|
||||||
run: git tag v0.0.0
|
|
||||||
|
|
||||||
# We start by preparing the mergeback branch, mainly so that we have the updated changelog
|
|
||||||
# readily available for the partial changelog that's needed for the release.
|
|
||||||
- name: Prepare mergeback branch
|
|
||||||
id: mergeback-branch
|
|
||||||
env:
|
|
||||||
BASE_BRANCH: ${{ (github.event_name == 'workflow_dispatch' && 'main') || github.ref_name }}
|
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
|
||||||
run: |
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# Checkout the base branch, since we may be testing on a different branch
|
|
||||||
git checkout "$BASE_BRANCH"
|
|
||||||
|
|
||||||
# Generate a new branch name for the mergeback PR
|
|
||||||
short_sha="${GITHUB_SHA:0:8}"
|
|
||||||
NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${short_sha}"
|
|
||||||
echo "new-branch=${NEW_BRANCH}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Create the mergeback branch
|
|
||||||
git checkout -b "${NEW_BRANCH}"
|
|
||||||
|
|
||||||
- name: Prepare rollback changelog
|
|
||||||
env:
|
|
||||||
NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md"
|
|
||||||
# We usually expect to checkout `inputs.rollback-tag` (required for `workflow_dispatch`),
|
|
||||||
# but use `v0.0.0` for testing.
|
|
||||||
ROLLBACK_TAG: ${{ inputs.rollback-tag || 'v0.0.0' }}
|
|
||||||
LATEST_TAG: ${{ needs.prepare.outputs.latest_tag }}
|
|
||||||
VERSION: "${{ needs.prepare.outputs.version }}"
|
|
||||||
run: |
|
|
||||||
python .github/workflows/script/rollback_changelog.py \
|
|
||||||
--target-version "${ROLLBACK_TAG:1}" \
|
|
||||||
--rollback-version "${LATEST_TAG:1}" \
|
|
||||||
--new-version "$VERSION" > $NEW_CHANGELOG
|
|
||||||
|
|
||||||
echo "::group::New CHANGELOG"
|
|
||||||
cat $NEW_CHANGELOG
|
|
||||||
echo "::endgroup::"
|
|
||||||
|
|
||||||
- name: Create tags
|
|
||||||
env:
|
|
||||||
# We usually expect to checkout `inputs.rollback-tag` (required for `workflow_dispatch`),
|
|
||||||
# but use `v0.0.0` for testing.
|
|
||||||
ROLLBACK_TAG: ${{ inputs.rollback-tag || 'v0.0.0' }}
|
|
||||||
RELEASE_TAG: ${{ needs.prepare.outputs.version }}
|
|
||||||
MAJOR_VERSION_TAG: ${{ needs.prepare.outputs.major_version }}
|
|
||||||
run: |
|
|
||||||
git checkout "refs/tags/${ROLLBACK_TAG}"
|
|
||||||
git tag --annotate "${RELEASE_TAG}" --message "${RELEASE_TAG}"
|
|
||||||
git tag --annotate "${MAJOR_VERSION_TAG}" --message "${MAJOR_VERSION_TAG}" --force
|
|
||||||
|
|
||||||
- name: Push tags
|
|
||||||
# skip when testing
|
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
env:
|
|
||||||
RELEASE_TAG: ${{ needs.prepare.outputs.version }}
|
|
||||||
MAJOR_VERSION_TAG: ${{ needs.prepare.outputs.major_version }}
|
|
||||||
run: |
|
|
||||||
git push origin --atomic --force refs/tags/"${RELEASE_TAG}" refs/tags/"${MAJOR_VERSION_TAG}"
|
|
||||||
|
|
||||||
- name: Prepare partial Changelog
|
|
||||||
env:
|
|
||||||
NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md"
|
|
||||||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
|
|
||||||
VERSION: "${{ needs.prepare.outputs.version }}"
|
|
||||||
run: |
|
|
||||||
python .github/workflows/script/prepare_changelog.py $NEW_CHANGELOG "$VERSION" > $PARTIAL_CHANGELOG
|
|
||||||
|
|
||||||
echo "::group::Partial CHANGELOG"
|
|
||||||
cat $PARTIAL_CHANGELOG
|
|
||||||
echo "::endgroup::"
|
|
||||||
|
|
||||||
- name: Generate token
|
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
uses: actions/create-github-app-token@v2.1.1
|
|
||||||
id: app-token
|
|
||||||
with:
|
|
||||||
app-id: ${{ vars.AUTOMATION_APP_ID }}
|
|
||||||
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
|
|
||||||
|
|
||||||
- name: Create the rollback release
|
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
env:
|
|
||||||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
|
|
||||||
VERSION: "${{ needs.prepare.outputs.version }}"
|
|
||||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
||||||
RELEASE_URL: "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.version }}"
|
|
||||||
run: |
|
|
||||||
set -exu
|
|
||||||
|
|
||||||
# Do not mark this release as latest. The most recent bundle release must be marked as latest.
|
|
||||||
# Set as a draft to give us an opportunity to review the rollback release.
|
|
||||||
gh release create \
|
|
||||||
"$VERSION" \
|
|
||||||
--latest=false \
|
|
||||||
--draft \
|
|
||||||
--title "$VERSION" \
|
|
||||||
--notes-file "$PARTIAL_CHANGELOG"
|
|
||||||
|
|
||||||
echo "Created draft rollback release at $RELEASE_URL" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: Update changelog
|
|
||||||
env:
|
|
||||||
NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md"
|
|
||||||
NEW_BRANCH: "${{ steps.mergeback-branch.outputs.new-branch }}"
|
|
||||||
run: |
|
|
||||||
git checkout "${NEW_BRANCH}"
|
|
||||||
mv ${NEW_CHANGELOG} CHANGELOG.md
|
|
||||||
|
|
||||||
- name: Create mergeback branch and PR
|
|
||||||
uses: ./.github/actions/prepare-mergeback-branch
|
|
||||||
with:
|
|
||||||
base: "main"
|
|
||||||
head: ""
|
|
||||||
branch: "${{ steps.mergeback-branch.outputs.new-branch }}"
|
|
||||||
version: "${{ needs.prepare.outputs.version }}"
|
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
# Setting this to `true` for non-workflow_dispatch events will
|
|
||||||
# still push the `branch`, but won't create a corresponding PR
|
|
||||||
dry-run: "${{ github.event_name != 'workflow_dispatch' }}"
|
|
||||||
|
|
||||||
6
.github/workflows/script/check-js.sh
vendored
6
.github/workflows/script/check-js.sh
vendored
@@ -7,15 +7,15 @@ if [ ! -z "$(git status --porcelain)" ]; then
|
|||||||
>&2 echo "Failed: Repo should be clean before testing!"
|
>&2 echo "Failed: Repo should be clean before testing!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Wipe the lib directory in case there are extra unnecessary files in there
|
# Wipe the lib directory incase there are extra unnecessary files in there
|
||||||
rm -rf lib
|
rm -rf lib
|
||||||
# Generate the JavaScript files
|
# Generate the JavaScript files
|
||||||
npm run-script build
|
npm run-script build
|
||||||
# Check that repo is still clean
|
# Check that repo is still clean
|
||||||
if [ ! -z "$(git status --porcelain)" ]; then
|
if [ ! -z "$(git status --porcelain)" ]; then
|
||||||
# If we get a fail here then the PR needs attention
|
# If we get a fail here then the PR needs attention
|
||||||
>&2 echo "Failed: JavaScript files are not up to date. Run 'rm -rf lib && npm run-script build' to update"
|
>&2 echo "Failed: JavaScript files are not up to date. Run 'npm run-script build' to update"
|
||||||
git status
|
git status
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Success: JavaScript files are up to date"
|
echo "Success: JavaScript files are up to date"
|
||||||
22
.github/workflows/script/check-node-modules.sh
vendored
Executable file
22
.github/workflows/script/check-node-modules.sh
vendored
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# Sanity check that repo is clean to start with
|
||||||
|
if [ ! -z "$(git status --porcelain)" ]; then
|
||||||
|
# If we get a fail here then this workflow needs attention...
|
||||||
|
>&2 echo "Failed: Repo should be clean before testing!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sudo npm install --force -g npm@latest
|
||||||
|
# Reinstall modules and then clean to remove absolute paths
|
||||||
|
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
|
||||||
|
npm ci
|
||||||
|
npm run removeNPMAbsolutePaths
|
||||||
|
# Check that repo is still clean
|
||||||
|
if [ ! -z "$(git status --porcelain)" ]; then
|
||||||
|
# If we get a fail here then the PR needs attention
|
||||||
|
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci && npm run removeNPMAbsolutePaths' on a macOS machine to update. Note it is important this command is run on macOS and not any other operating system as there is one dependency (fsevents) that is needed for macOS and may not be installed if the command is run on a Windows or Linux machine."
|
||||||
|
git status
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Success: node_modules are up to date"
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user