Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1220ae5
Log a warning if the API version is not supported.
chrisgavin Oct 26, 2020
1f7bae7
Use an undefined check rather than `hasOwnProperty`.
chrisgavin Nov 2, 2020
865b4bd
Pass a logger in to `getApiClient()` rather than constructing one there.
chrisgavin Nov 2, 2020
1a4385d
Only log the version warning once on Actions even if the Action is in…
chrisgavin Nov 2, 2020
5e2fa08
Merge main into check-api-version.
chrisgavin Nov 2, 2020
efc3797
Disable gpg key signing in tests
Nov 3, 2020
b16110e
Log the version warning a second time if a request fails unexpectedly.
chrisgavin Nov 3, 2020
1364a74
Merge pull request #285 from github/check-api-version
chrisgavin Nov 3, 2020
beac9d5
Fix a copy and pasted job name.
chrisgavin Nov 3, 2020
4ffed26
Only increase the newest supported release, never reduce it.
chrisgavin Nov 3, 2020
d7bd6e3
Merge branch 'main' into disable-gpgsign-in-tests
Nov 3, 2020
a6c99e6
Merge pull request #287 from github/disable-gpgsign-in-tests
Nov 3, 2020
bc1ee16
Add the --threads config option to finalize db (#281)
aeisenberg Nov 3, 2020
813b523
Merge branch 'main' into tweak-bump-supported-versions
chrisgavin Nov 4, 2020
b6989db
Merge pull request #288 from github/tweak-bump-supported-versions
chrisgavin Nov 4, 2020
5c0e2f9
Fix invalid API call when running locally
Nov 4, 2020
1c8d72e
Remove unnecessary env manipulation
Nov 4, 2020
df843a2
Merge branch 'main' into simon-engledew/fix-act-local
Nov 4, 2020
0ed3207
Merge pull request #289 from github/simon-engledew/fix-act-local
Nov 4, 2020
854109f
Report the path of CodeQL as an output
Nov 4, 2020
c213a7c
Use codeql-path output in python-deps workflow
Nov 4, 2020
77f914a
Add codeql-path to README (wip)
Nov 4, 2020
ff6db59
Fix indentation for action output
Nov 4, 2020
54f3e52
Move setOutput into try block in case it errors
Nov 4, 2020
c87f302
Expand readme to include codeql-path output example
Nov 4, 2020
f761241
Remove output from README
Nov 5, 2020
f13bd45
Merge pull request #291 from github/simon-engledew/output-codeql-path
Nov 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./init
id: init
with:
languages: javascript
config-file: ./.github/codeql/codeql-config.yml
# confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version
run: ${{steps.init.outputs.codeql-path}} version --format=json
- uses: ./analyze
4 changes: 2 additions & 2 deletions .github/workflows/python-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:

- name: Initialize CodeQL
uses: ./init
id: init
with:
tools: latest
languages: python
Expand All @@ -62,8 +63,7 @@ jobs:
esac
echo ${basePath}

codeql_version="0.0.0-$(cat "$GITHUB_WORKSPACE/src/defaults.json" | jq -r .bundleVersion | rev | cut -d - -f 1 | rev)"
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "${basePath}/hostedtoolcache/CodeQL/$codeql_version/x64/codeql"
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
- name: Setup for extractor
run: |
echo $CODEQL_PYTHON
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update Supported Enterprise Server Versions

on:
schedule:
- cron: "0 0 * * *"

jobs:
update-supported-enterprise-server-versions:
runs-on: ubuntu-latest

steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Checkout CodeQL Action
uses: actions/checkout@v2
- name: Checkout Enterprise Releases
uses: actions/checkout@v2
with:
repository: github/enterprise-releases
ssh-key: ${{ secrets.ENTERPRISE_RELEASES_SSH_KEY }}
path: ${{ github.workspace }}/enterprise-releases/
- name: Update Supported Enterprise Server Versions
run: |
cd ./.github/workflows/update-supported-enterprise-server-versions/
python3 -m pip install pipenv
pipenv install
pipenv run ./update.py
rm --recursive "$ENTERPRISE_RELEASES_PATH"
npm run build
env:
ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/
- name: Commit Changes
uses: peter-evans/create-pull-request@c7f493a8000b8aeb17a1332e326ba76b57cb83eb # v3.4.1
with:
commit-message: Update supported GitHub Enterprise Server versions.
title: Update supported GitHub Enterprise Server versions.
body: ""
author: GitHub <noreply@github.com>
branch: update-supported-enterprise-server-versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
semver = "*"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env python3
import datetime
import json
import os
import pathlib

import semver

_API_COMPATIBILITY_PATH = pathlib.Path(__file__).absolute().parents[3] / "src" / "api-compatibility.json"
_ENTERPRISE_RELEASES_PATH = pathlib.Path(os.environ["ENTERPRISE_RELEASES_PATH"])
_RELEASE_FILE_PATH = _ENTERPRISE_RELEASES_PATH / "releases.json"
_FIRST_SUPPORTED_RELEASE = semver.VersionInfo.parse("2.22.0") # Versions older than this did not include Code Scanning.

def main():
api_compatibility_data = json.loads(_API_COMPATIBILITY_PATH.read_text())

releases = json.loads(_RELEASE_FILE_PATH.read_text())
oldest_supported_release = None
newest_supported_release = semver.VersionInfo.parse(api_compatibility_data["maximumVersion"] + ".0")

for release_version_string, release_data in releases.items():
release_version = semver.VersionInfo.parse(release_version_string + ".0")
if release_version < _FIRST_SUPPORTED_RELEASE:
continue

if release_version > newest_supported_release:
feature_freeze_date = datetime.date.fromisoformat(release_data["feature_freeze"])
if feature_freeze_date < datetime.date.today() + datetime.timedelta(weeks=2):
newest_supported_release = release_version

if oldest_supported_release is None or release_version < oldest_supported_release:
end_of_life_date = datetime.date.fromisoformat(release_data["end"])
if end_of_life_date > datetime.date.today():
oldest_supported_release = release_version

api_compatibility_data = {
"minimumVersion": f"{oldest_supported_release.major}.{oldest_supported_release.minor}",
"maximumVersion": f"{newest_supported_release.major}.{newest_supported_release.minor}",
}
_API_COMPATIBILITY_PATH.write_text(json.dumps(api_compatibility_data, sort_keys=True) + "\n")

if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ It is possible to run this action locally via [act](https://github.com/nektos/ac

```bash
CODEQL_LOCAL_RUN=true
GITHUB_SERVER_URL=https://github.com

# Optional, for better logging
GITHUB_JOB=<ANY_JOB_NAME>
Expand Down
3 changes: 3 additions & 0 deletions init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ inputs:
description: Try to auto-install your python dependencies
required: true
default: 'true'
outputs:
codeql-path:
description: The path of the CodeQL binary used for analysis
runs:
using: 'node12'
main: '../lib/init-action.js'
3 changes: 3 additions & 0 deletions lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions lib/actions-util.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading