Skip to content

Commit

Permalink
Allow pull requests, and report correct commit oid and ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Brignull committed May 28, 2020
1 parent 8b71cf3 commit da1e237
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 36 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "CodeQL action"

on: [push]
on: [push, pull_request]

jobs:
build:
Expand All @@ -11,6 +11,16 @@ jobs:

steps:
- uses: actions/checkout@v1
with:
# Must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head of the pull request.
fetch-depth: 2

# If this run was triggered by a pull request event then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- uses: ./init
with:
languages: javascript
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/integration-testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Integration Testing"

on: [push]
on: [push, pull_request]

jobs:
multi-language-repo_test-autodetect-languages:
Expand All @@ -16,9 +16,8 @@ jobs:
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
- uses: ./../action/init
- name: Build code
shell: bash
Expand All @@ -40,9 +39,8 @@ jobs:
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
- uses: ./../action/init
with:
languages: cpp,csharp,java,javascript,python
Expand Down Expand Up @@ -72,9 +70,8 @@ jobs:
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
- uses: ./../action/init
with:
languages: go
Expand All @@ -96,9 +93,8 @@ jobs:
shell: bash
run: |
mkdir ../action
shopt -s dotglob
mv * ../action/
mv ../action/tests/multi-language-repo/* .
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -117,4 +113,4 @@ jobs:
with:
sarif_file: rubocop.sarif
env:
TEST_MODE: true
TEST_MODE: true
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ name: "Code Scanning - Action"

on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'

Expand All @@ -33,6 +34,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# Must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head of the pull request.
# Only include this option if you are running this workflow on pull requests.
fetch-depth: 2

# If this run was triggered by a pull request event then checkout
# the head of the pull request instead of the merge commit.
# Only include this step if you are running this workflow on pull requests.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion lib/upload-lib.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/upload-lib.js.map

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

38 changes: 30 additions & 8 deletions lib/util.js

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

Loading

0 comments on commit da1e237

Please sign in to comment.