Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
2845a93
Fixing sorting of PRs
robertbrignull Jun 22, 2020
d55f711
introduce inputs.threads flag to analyze action
Jun 22, 2020
f4001a0
update dependencies
Jun 22, 2020
2758bd3
avoid floating point division of ram
Jun 22, 2020
dcba709
move functions to util.ts
Jun 22, 2020
bc9591a
revert node_modules from master
Jun 22, 2020
c0c67ce
Reduce debug output in tests
sampart Jun 22, 2020
8622312
Update JavaScript with newer comment
sampart Jun 22, 2020
bcb5b28
format code
Jun 22, 2020
3199693
reformat code and allow negative values for threads
Jun 22, 2020
6d413dd
Update release branch script as main branch is now "main".
sampart Jun 23, 2020
1ce7f98
Update other references to master in release script
sampart Jun 23, 2020
8a67191
Merge pull request #76 from github/update-release-branch-base
sampart Jun 23, 2020
beedd31
Merge branch 'main' into release-sorting
robertbrignull Jun 23, 2020
7ae8c32
Merge branch 'main' into add-analyze-threads-flag
Jun 23, 2020
8e098cb
Merge pull request #72 from github/release-sorting
robertbrignull Jun 23, 2020
9133b2b
Merge branch 'main' into add-analyze-threads-flag
Jun 23, 2020
a30a5ba
Add silencing to additional test files
sampart Jun 23, 2020
98f8945
Merge pull request #73 from github/add-analyze-threads-flag
Jun 23, 2020
56f06c7
add calls
robertbrignull Jun 23, 2020
66be268
run verbose
robertbrignull Jun 23, 2020
0277624
Only output on failing tests
robertbrignull Jun 23, 2020
bd40428
Merge remote-tracking branch 'origin/main' into only-output-on-failure
robertbrignull Jun 23, 2020
a1d945f
Add a `.editorconfig` with our chosen formatting options.
chrisgavin Jun 23, 2020
350bf48
add semicolon
robertbrignull Jun 23, 2020
211ad30
Update TSLint configuration to detect bad indentation.
chrisgavin Jun 23, 2020
8823109
Convert all 4-space indented files to 2-space.
chrisgavin Jun 23, 2020
107d8ff
Fix a line that's too long.
chrisgavin Jun 23, 2020
052d39e
Fix some strange formatting.
chrisgavin Jun 23, 2020
852d99d
Call codeql.exe rather than codeql.cmd wrapper on Windows
nickrolfe Jun 23, 2020
f009c4c
Merge branch 'main' into nickrolfe/codeql.exe
robertbrignull Jun 23, 2020
b3c9d6f
Merge pull request #78 from github/fix-indentation
chrisgavin Jun 23, 2020
9a784b1
Merge remote-tracking branch 'upstream/main' into nickrolfe/codeql.exe
nickrolfe Jun 23, 2020
bc21c8f
Merge pull request #77 from nickrolfe/nickrolfe/codeql.exe
robertbrignull Jun 23, 2020
52e5243
handle Uint8Array
robertbrignull Jun 23, 2020
403832b
Merge remote-tracking branch 'origin/main' into only-output-on-failure
robertbrignull Jun 23, 2020
cb384e7
fix indentation
robertbrignull Jun 23, 2020
af252d2
report action has aborted
Jun 23, 2020
7581ac8
make the temporary directory in tests a symlink
robertbrignull Jun 23, 2020
b8ac06a
run tslint --fix
Jun 23, 2020
74c48f7
Use a single Octokit client for everything rather than a bunch of Oct…
chrisgavin Jun 23, 2020
04adf2b
Merge pull request #80 from github/symlinks_test
robertbrignull Jun 24, 2020
a091618
Merge branch 'main' into report-action-aborted
Jun 24, 2020
3871ca7
reformat remaining 4 space indentations
Jun 24, 2020
b3ffa76
Merge branch 'main' into only-output-on-failure
robertbrignull Jun 24, 2020
a67896b
fix typo and throw error when languages are not detected
Jun 24, 2020
8530f5b
add missing semicolon
Jun 24, 2020
464ce1b
Manually convert response.data to a JSON string.
chrisgavin Jun 24, 2020
5bb9e6e
Merge pull request #79 from github/only-output-on-failure
robertbrignull Jun 24, 2020
559e260
Merge branch 'main' into report-action-aborted
Jun 24, 2020
6846c70
Merge pull request #81 from github/report-action-aborted
Jun 24, 2020
50a2815
Include completed_at when action is aborted
robertbrignull Jun 25, 2020
28944b5
Merge pull request #83 from github/aborted_completed_at
robertbrignull Jun 25, 2020
0fdc2c7
fall back to GITHUB_SHA env var if git is not available
robertbrignull Jun 25, 2020
96d02d5
Merge pull request #84 from github/remove_git_dependency
robertbrignull Jun 25, 2020
ef50797
Merge branch 'main' into octokit
chrisgavin Jun 26, 2020
1754806
Merge pull request #82 from github/octokit
chrisgavin Jun 26, 2020
bb9ed79
getRequiredEnvParams must be non-empty
rneatherway Jun 26, 2020
a0d4330
Simplify singleton tests by removing the loop
rneatherway Jun 26, 2020
504c8cf
Merge pull request #85 from github/non-empty-env-vars
rneatherway Jun 26, 2020
151d531
Correct copy/pasted test description
rneatherway Jun 26, 2020
a08742f
Merge pull request #86 from github/correct-test-description
rneatherway Jun 26, 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
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
indent_style = space
indent_size = 2
34 changes: 17 additions & 17 deletions .github/update-release-branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# The branch being merged from.
# This is the one that contains day-to-day development work.
MASTER_BRANCH = 'master'
MAIN_BRANCH = 'main'
# The branch being merged into.
# This is the release branch that users reference.
LATEST_RELEASE_BRANCH = 'v1'
Expand All @@ -28,7 +28,7 @@ def branch_exists_on_remote(branch_name):
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''

# Opens a PR from the given branch to the release branch
def open_pr(repo, all_commits, short_master_sha, branch_name):
def open_pr(repo, all_commits, short_main_sha, branch_name):
# Sort the commits into the pull requests that introduced them,
# and any commits that don't have a pull request
pull_requests = []
Expand All @@ -45,11 +45,11 @@ def open_pr(repo, all_commits, short_master_sha, branch_name):
print('Found ' + str(len(commits_without_pull_requests)) + ' commits not in a pull request')

# Sort PRs and commits by age
sorted(pull_requests, key=lambda pr: pr.number)
sorted(commits_without_pull_requests, key=lambda c: c.commit.author.date)
pull_requests = sorted(pull_requests, key=lambda pr: pr.number)
commits_without_pull_requests = sorted(commits_without_pull_requests, key=lambda c: c.commit.author.date)

# Start constructing the body text
body = 'Merging ' + short_master_sha + ' into ' + LATEST_RELEASE_BRANCH
body = 'Merging ' + short_main_sha + ' into ' + LATEST_RELEASE_BRANCH

conductor = get_conductor(repo, pull_requests, commits_without_pull_requests)
body += '\n\nConductor for this PR is @' + conductor
Expand All @@ -71,7 +71,7 @@ def open_pr(repo, all_commits, short_master_sha, branch_name):
body += ' - ' + get_truncated_commit_message(commit)
body += ' (@' + commit.author.login + ')'

title = 'Merge ' + MASTER_BRANCH + ' into ' + LATEST_RELEASE_BRANCH
title = 'Merge ' + MAIN_BRANCH + ' into ' + LATEST_RELEASE_BRANCH

# Create the pull request
pr = repo.create_pull(title=title, body=body, head=branch_name, base=LATEST_RELEASE_BRANCH)
Expand All @@ -90,12 +90,12 @@ def get_conductor(repo, pull_requests, other_commits):
# Otherwise take the author of the latest commit
return other_commits[-1].author.login

# Gets a list of the SHAs of all commits that have happened on master
# 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 master.
# that aren't on main.
def get_commit_difference(repo):
commits = run_git('log', '--pretty=format:%H', ORIGIN + '/' + LATEST_RELEASE_BRANCH + '...' + MASTER_BRANCH).strip().split('\n')
commits = run_git('log', '--pretty=format:%H', ORIGIN + '/' + LATEST_RELEASE_BRANCH + '...' + MAIN_BRANCH).strip().split('\n')

# Convert to full-fledged commit objects
commits = [repo.get_commit(c) for c in commits]
Expand All @@ -115,7 +115,7 @@ def get_truncated_commit_message(commit):
else:
return message

# Converts a commit into the PR that introduced it to the master 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.
def get_pr_for_commit(repo, commit):
prs = commit.get_pulls()
Expand Down Expand Up @@ -144,20 +144,20 @@ def main():
repo = Github(github_token).get_repo(repository_nwo)

# Print what we intend to go
print('Considering difference between ' + MASTER_BRANCH + ' and ' + LATEST_RELEASE_BRANCH)
short_master_sha = run_git('rev-parse', '--short', MASTER_BRANCH).strip()
print('Current head of ' + MASTER_BRANCH + ' is ' + short_master_sha)
print('Considering difference between ' + MAIN_BRANCH + ' and ' + LATEST_RELEASE_BRANCH)
short_main_sha = run_git('rev-parse', '--short', MAIN_BRANCH).strip()
print('Current head of ' + MAIN_BRANCH + ' is ' + short_main_sha)

# See if there are any commits to merge in
commits = get_commit_difference(repo)
if len(commits) == 0:
print('No commits to merge from ' + MASTER_BRANCH + ' to ' + LATEST_RELEASE_BRANCH)
print('No commits to merge from ' + MAIN_BRANCH + ' to ' + LATEST_RELEASE_BRANCH)
return

# 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
# exists we can assume we don't need to recreate it.
new_branch_name = 'update-' + LATEST_RELEASE_BRANCH + '-' + short_master_sha
new_branch_name = 'update-' + LATEST_RELEASE_BRANCH + '-' + short_main_sha
print('Branch name is ' + new_branch_name)

# Check if the branch already exists. If so we can abort as this script
Expand All @@ -168,11 +168,11 @@ def main():

# Create the new branch and push it to the remote
print('Creating branch ' + new_branch_name)
run_git('checkout', '-b', new_branch_name, MASTER_BRANCH)
run_git('checkout', '-b', new_branch_name, MAIN_BRANCH)
run_git('push', ORIGIN, new_branch_name)

# Open a PR to update the branch
open_pr(repo, commits, short_master_sha, new_branch_name)
open_pr(repo, commits, short_main_sha, new_branch_name)

if __name__ == '__main__':
main()
7 changes: 6 additions & 1 deletion analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ author: 'GitHub'
inputs:
check_name:
description: The name of the check run to add text to.
required: false
output:
description: The path of the directory in which to save the SARIF results
required: false
default: '../results'
upload:
description: Upload the SARIF file
required: false
default: true
default: "true"
ram:
description: Override the amount of memory in MB to be used by CodeQL. By default, almost all the memory of the machine is used.
required: false
threads:
description: The number of threads to be used by CodeQL.
required: false
default: "1"
token:
default: ${{ github.token }}
matrix:
Expand Down
2 changes: 1 addition & 1 deletion lib/analysis-paths.js.map

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

2 changes: 2 additions & 0 deletions lib/analysis-paths.test.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/analysis-paths.test.js.map

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

23 changes: 23 additions & 0 deletions lib/api-client.js

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

1 change: 1 addition & 0 deletions lib/api-client.js.map

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

2 changes: 1 addition & 1 deletion lib/config-utils.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/config-utils.test.js

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

Loading