mirror of https://github.com/google/oss-fuzz.git
ci: Fix get_changed_files_output (#5944)
* ci: Fix get_changed_files_output * Update project_tests.yml * ci: Fix presubmit checks * ci: Use fetch-depth:0 instead of --unshallow
This commit is contained in:
parent
f43633e0ec
commit
aed20a9b62
|
@ -15,8 +15,9 @@ jobs:
|
|||
access_token: ${{ github.token }}
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- run: | # Needed for git diff to work.
|
||||
git fetch origin master --depth 1
|
||||
with: # Needed for git diff to work. (get_changed_files)
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
|
||||
|
||||
- name: Setup python environment
|
||||
|
|
|
@ -16,8 +16,9 @@ jobs:
|
|||
access_token: ${{ github.token }}
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- run: | # Needed for git diff to work.
|
||||
git fetch origin master --depth 1
|
||||
with: # Needed for git diff to work. (get_changed_files)
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
|
||||
|
||||
- name: Setup python environment
|
||||
|
|
|
@ -48,8 +48,9 @@ jobs:
|
|||
access_token: ${{ github.token }}
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- run: | # Needed for git diff to work.
|
||||
git fetch origin master --depth 1
|
||||
with: # Needed for git diff to work. (get_changed_files)
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
|
||||
|
||||
- name: Clear unnecessary files
|
||||
|
|
|
@ -38,7 +38,7 @@ LANGUAGES_WITH_COVERAGE_SUPPORT = ['c', 'c++', 'go', 'jvm', 'rust']
|
|||
def get_changed_files_output():
|
||||
"""Returns the output of a git command that discovers changed files."""
|
||||
branch_commit_hash = subprocess.check_output(
|
||||
['git', 'merge-base', 'FETCH_HEAD', 'origin/HEAD']).strip().decode()
|
||||
['git', 'merge-base', 'HEAD', 'origin/HEAD']).strip().decode()
|
||||
|
||||
return subprocess.check_output(
|
||||
['git', 'diff', '--name-only', branch_commit_hash + '..']).decode()
|
||||
|
|
|
@ -346,7 +346,7 @@ def yapf(paths, validate=True):
|
|||
def get_changed_files():
|
||||
"""Return a list of absolute paths of files changed in this git branch."""
|
||||
branch_commit_hash = subprocess.check_output(
|
||||
['git', 'merge-base', 'FETCH_HEAD', 'origin/HEAD']).strip().decode()
|
||||
['git', 'merge-base', 'HEAD', 'origin/HEAD']).strip().decode()
|
||||
|
||||
diff_commands = [
|
||||
# Return list of modified files in the commits on this branch.
|
||||
|
|
Loading…
Reference in New Issue