Skip to content

Commit

Permalink
feat: add support for fetching additional history for submodules (#1476)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
jackton1 and actions-user committed Aug 23, 2023
1 parent 7852182 commit 5693615
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 159 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: changed_files
if: github.event_name == 'pull_request'
with:
files: |
src
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ inputs:
description: "Skip the initial fetch to improve performance for shallow repositories. **NOTE**: This could lead to errors with missing history and the intended use is limited to when you've fetched the history necessary to perform the diff."
required: false
default: "false"
fetch_additional_submodule_history:
description: "Fetch additional history for submodules."
required: false
default: "false"
since_last_remote_commit:
description: "Use the last commit on the remote branch as the `base_sha`. Defaults to the last non-merge commit on the target branch for pull request events and the previous remote commit of the current branch for push events."
required: false
Expand Down
185 changes: 111 additions & 74 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/changedFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export const getRenamedFiles = async ({
diff
}))
) {
core.warning(
`Set 'fetch_additional_submodule_history: true' to fetch additional submodule history for: ${submodulePath}, Note you can control the fetch depth using 'fetch_depth' input`
)
diff = '..'
}

Expand Down Expand Up @@ -157,6 +160,9 @@ export const getAllDiffFiles = async ({
diff
}))
) {
core.warning(
`Set 'fetch_additional_submodule_history: true' to fetch additional submodule history for: ${submodulePath}, Note you can control the fetch depth using 'fetch_depth' input`
)
diff = '..'
}

Expand Down
Loading

0 comments on commit 5693615

Please sign in to comment.