Skip to content

Commit 4997c3f

Browse files
Merge pull request #48 from github/allow_pull_requests
Allow pull requests, and report correct commit oid and ref
2 parents 98ad2fc + 0bd4da3 commit 4997c3f

File tree

9 files changed

+97
-36
lines changed

9 files changed

+97
-36
lines changed

.github/workflows/codeql.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "CodeQL action"
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:
@@ -11,6 +11,16 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v1
14+
with:
15+
# Must fetch at least the immediate parents so that if this is
16+
# a pull request then we can checkout the head of the pull request.
17+
fetch-depth: 2
18+
19+
# If this run was triggered by a pull request event then checkout
20+
# the head of the pull request instead of the merge commit.
21+
- run: git checkout HEAD^2
22+
if: ${{ github.event_name == 'pull_request' }}
23+
1424
- uses: ./init
1525
with:
1626
languages: javascript

.github/workflows/integration-testing.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Integration Testing"
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
multi-language-repo_test-autodetect-languages:
@@ -16,9 +16,8 @@ jobs:
1616
shell: bash
1717
run: |
1818
mkdir ../action
19-
shopt -s dotglob
20-
mv * ../action/
21-
mv ../action/tests/multi-language-repo/* .
19+
mv * .github ../action/
20+
mv ../action/tests/multi-language-repo/{*,.github} .
2221
- uses: ./../action/init
2322
- name: Build code
2423
shell: bash
@@ -40,9 +39,8 @@ jobs:
4039
shell: bash
4140
run: |
4241
mkdir ../action
43-
shopt -s dotglob
44-
mv * ../action/
45-
mv ../action/tests/multi-language-repo/* .
42+
mv * .github ../action/
43+
mv ../action/tests/multi-language-repo/{*,.github} .
4644
- uses: ./../action/init
4745
with:
4846
languages: cpp,csharp,java,javascript,python
@@ -72,9 +70,8 @@ jobs:
7270
shell: bash
7371
run: |
7472
mkdir ../action
75-
shopt -s dotglob
76-
mv * ../action/
77-
mv ../action/tests/multi-language-repo/* .
73+
mv * .github ../action/
74+
mv ../action/tests/multi-language-repo/{*,.github} .
7875
- uses: ./../action/init
7976
with:
8077
languages: go
@@ -96,9 +93,8 @@ jobs:
9693
shell: bash
9794
run: |
9895
mkdir ../action
99-
shopt -s dotglob
100-
mv * ../action/
101-
mv ../action/tests/multi-language-repo/* .
96+
mv * .github ../action/
97+
mv ../action/tests/multi-language-repo/{*,.github} .
10298
- name: Set up Ruby
10399
uses: ruby/setup-ruby@v1
104100
with:
@@ -117,4 +113,4 @@ jobs:
117113
with:
118114
sarif_file: rubocop.sarif
119115
env:
120-
TEST_MODE: true
116+
TEST_MODE: true

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ name: "Code Scanning - Action"
1818

1919
on:
2020
push:
21+
pull_request:
2122
schedule:
2223
- cron: '0 0 * * 0'
2324

@@ -33,6 +34,17 @@ jobs:
3334
steps:
3435
- name: Checkout repository
3536
uses: actions/checkout@v2
37+
with:
38+
# Must fetch at least the immediate parents so that if this is
39+
# a pull request then we can checkout the head of the pull request.
40+
# Only include this option if you are running this workflow on pull requests.
41+
fetch-depth: 2
42+
43+
# If this run was triggered by a pull request event then checkout
44+
# the head of the pull request instead of the merge commit.
45+
# Only include this step if you are running this workflow on pull requests.
46+
- run: git checkout HEAD^2
47+
if: ${{ github.event_name == 'pull_request' }}
3648

3749
# Initializes the CodeQL tools for scanning.
3850
- name: Initialize CodeQL

lib/upload-lib.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js

Lines changed: 30 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)