Skip to content

Commit f94e06a

Browse files
committed
Merge main into add-multi-cause-markdown-flag.
2 parents 2d75893 + d4eb1e3 commit f94e06a

58 files changed

Lines changed: 530 additions & 130 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: true
22
contact_links:
33
- name: Contact GitHub Support
4-
url: https://support.github.com/contact?subject=Code+Scanning+Beta+Support&tags=code-scanning-support
5-
about: Contact Support about code scanning
4+
url: https://support.github.com/request
5+
about: Contact Support

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: ./init
18+
id: init
1819
with:
1920
languages: javascript
2021
config-file: ./.github/codeql/codeql-config.yml
22+
# confirm steps.init.outputs.codeql-path points to the codeql binary
23+
- name: Print CodeQL Version
24+
run: ${{steps.init.outputs.codeql-path}} version --format=json
2125
- uses: ./analyze

.github/workflows/python-deps.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ jobs:
4343
- uses: actions/checkout@v2
4444

4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: ./init
47+
id: init
4748
with:
4849
tools: latest
4950
languages: python
51+
setup-python-dependencies: false
5052

5153
- name: Test Auto Package Installation
5254
run: |
@@ -61,8 +63,7 @@ jobs:
6163
esac
6264
echo ${basePath}
6365
64-
codeql_version="0.0.0-$(cat "$GITHUB_WORKSPACE/src/defaults.json" | jq -r .bundleVersion | rev | cut -d - -f 1 | rev)"
65-
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "${basePath}/hostedtoolcache/CodeQL/$codeql_version/x64/codeql"
66+
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
6667
- name: Setup for extractor
6768
run: |
6869
echo $CODEQL_PYTHON
@@ -105,10 +106,11 @@ jobs:
105106
- uses: actions/checkout@v2
106107

107108
- name: Initialize CodeQL
108-
uses: github/codeql-action/init@v1
109+
uses: ./init
109110
with:
110111
tools: latest
111112
languages: python
113+
setup-python-dependencies: false
112114

113115
- name: Test Auto Package Installation
114116
run: |
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update Supported Enterprise Server Versions
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
update-supported-enterprise-server-versions:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Setup Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.7"
16+
- name: Checkout CodeQL Action
17+
uses: actions/checkout@v2
18+
- name: Checkout Enterprise Releases
19+
uses: actions/checkout@v2
20+
with:
21+
repository: github/enterprise-releases
22+
ssh-key: ${{ secrets.ENTERPRISE_RELEASES_SSH_KEY }}
23+
path: ${{ github.workspace }}/enterprise-releases/
24+
- name: Update Supported Enterprise Server Versions
25+
run: |
26+
cd ./.github/workflows/update-supported-enterprise-server-versions/
27+
python3 -m pip install pipenv
28+
pipenv install
29+
pipenv run ./update.py
30+
rm --recursive "$ENTERPRISE_RELEASES_PATH"
31+
npm run build
32+
env:
33+
ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/
34+
- name: Commit Changes
35+
uses: peter-evans/create-pull-request@c7f493a8000b8aeb17a1332e326ba76b57cb83eb # v3.4.1
36+
with:
37+
commit-message: Update supported GitHub Enterprise Server versions.
38+
title: Update supported GitHub Enterprise Server versions.
39+
body: ""
40+
author: GitHub <noreply@github.com>
41+
branch: update-supported-enterprise-server-versions
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
8+
[packages]
9+
semver = "*"

.github/workflows/update-supported-enterprise-server-versions/Pipfile.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
import datetime
3+
import json
4+
import os
5+
import pathlib
6+
7+
import semver
8+
9+
_API_COMPATIBILITY_PATH = pathlib.Path(__file__).absolute().parents[3] / "src" / "api-compatibility.json"
10+
_ENTERPRISE_RELEASES_PATH = pathlib.Path(os.environ["ENTERPRISE_RELEASES_PATH"])
11+
_RELEASE_FILE_PATH = _ENTERPRISE_RELEASES_PATH / "releases.json"
12+
_FIRST_SUPPORTED_RELEASE = semver.VersionInfo.parse("2.22.0") # Versions older than this did not include Code Scanning.
13+
14+
def main():
15+
api_compatibility_data = json.loads(_API_COMPATIBILITY_PATH.read_text())
16+
17+
releases = json.loads(_RELEASE_FILE_PATH.read_text())
18+
oldest_supported_release = None
19+
newest_supported_release = semver.VersionInfo.parse(api_compatibility_data["maximumVersion"] + ".0")
20+
21+
for release_version_string, release_data in releases.items():
22+
release_version = semver.VersionInfo.parse(release_version_string + ".0")
23+
if release_version < _FIRST_SUPPORTED_RELEASE:
24+
continue
25+
26+
if release_version > newest_supported_release:
27+
feature_freeze_date = datetime.date.fromisoformat(release_data["feature_freeze"])
28+
if feature_freeze_date < datetime.date.today() + datetime.timedelta(weeks=2):
29+
newest_supported_release = release_version
30+
31+
if oldest_supported_release is None or release_version < oldest_supported_release:
32+
end_of_life_date = datetime.date.fromisoformat(release_data["end"])
33+
if end_of_life_date > datetime.date.today():
34+
oldest_supported_release = release_version
35+
36+
api_compatibility_data = {
37+
"minimumVersion": f"{oldest_supported_release.major}.{oldest_supported_release.minor}",
38+
"maximumVersion": f"{newest_supported_release.major}.{newest_supported_release.minor}",
39+
}
40+
_API_COMPATIBILITY_PATH.write_text(json.dumps(api_compatibility_data, sort_keys=True) + "\n")
41+
42+
if __name__ == "__main__":
43+
main()

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ It is possible to run this action locally via [act](https://github.com/nektos/ac
3636

3737
```bash
3838
CODEQL_LOCAL_RUN=true
39+
GITHUB_SERVER_URL=https://github.com
3940

4041
# Optional, for better logging
4142
GITHUB_JOB=<ANY_JOB_NAME>

README.md

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ on:
2323
pull_request:
2424
schedule:
2525
# ┌───────────── minute (0 - 59)
26-
# │ ┌───────────── hour (0 - 23)
27-
# │ │ ┌───────────── day of the month (1 - 31)
28-
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
29-
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
30-
# │ │ │ │ │
31-
# │ │ │ │ │
32-
# │ │ │ │ │
33-
# * * * * *
26+
# ┌───────────── hour (0 - 23)
27+
# │ ┌───────────── day of the month (1 - 31)
28+
# │ │ ┌───────────── month (1 - 12 or JAN-DEC)
29+
# │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
30+
# │ │ │ │
31+
# │ │ │ │
32+
# │ │ │ │
33+
# * * * * *
3434
- cron: '30 1 * * 0'
3535

3636
jobs:
@@ -41,17 +41,6 @@ jobs:
4141
steps:
4242
- name: Checkout repository
4343
uses: actions/checkout@v2
44-
with:
45-
# Must fetch at least the immediate parents so that if this is
46-
# a pull request then we can checkout the head of the pull request.
47-
# Only include this option if you are running this workflow on pull requests.
48-
fetch-depth: 2
49-
50-
# If this run was triggered by a pull request event then checkout
51-
# the head of the pull request instead of the merge commit.
52-
# Only include this step if you are running this workflow on pull requests.
53-
- run: git checkout HEAD^2
54-
if: ${{ github.event_name == 'pull_request' }}
5544

5645
# Initializes the CodeQL tools for scanning.
5746
- name: Initialize CodeQL

init/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'CodeQL: Init'
2-
description: 'Setup the CodeQL tracer'
2+
description: 'Set up CodeQL'
33
author: 'GitHub'
44
inputs:
55
tools:
@@ -23,6 +23,9 @@ inputs:
2323
description: Try to auto-install your python dependencies
2424
required: true
2525
default: 'true'
26+
outputs:
27+
codeql-path:
28+
description: The path of the CodeQL binary used for analysis
2629
runs:
2730
using: 'node12'
2831
main: '../lib/init-action.js'

0 commit comments

Comments
 (0)