Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae90a0b602 | ||
|
|
3538a9c448 | ||
|
|
3ea81e414c | ||
|
|
bc1dc8f54d | ||
|
|
51ab26a070 | ||
|
|
3de1f9a283 | ||
|
|
87d61bba41 | ||
|
|
9716e7993f | ||
|
|
666680491a | ||
|
|
58a81c5c4c | ||
|
|
6b8ef3323f | ||
|
|
1c997727c9 |
88
HISTORY.md
88
HISTORY.md
@@ -1,12 +1,58 @@
|
||||
# Changelog
|
||||
|
||||
## [v22.1](https://github.com/tj-actions/changed-files/tree/v22.1) (2022-05-31)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v22...v22.1)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- chore: upgrade tj-actions/glob from v9 to v9.2 [\#513](https://github.com/tj-actions/changed-files/pull/513) ([jackton1](https://github.com/jackton1))
|
||||
- Upgraded to v22 [\#512](https://github.com/tj-actions/changed-files/pull/512) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v22](https://github.com/tj-actions/changed-files/tree/v22) (2022-05-31)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v21...v22)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- \[Feature\] since\_last\_passing\_remote\_commit [\#507](https://github.com/tj-actions/changed-files/issues/507)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Updated README.md [\#511](https://github.com/tj-actions/changed-files/pull/511) ([jackton1](https://github.com/jackton1))
|
||||
- chore: Update README.md [\#510](https://github.com/tj-actions/changed-files/pull/510) ([jackton1](https://github.com/jackton1))
|
||||
- Bump tj-actions/glob from 7.20 to 9 [\#509](https://github.com/tj-actions/changed-files/pull/509) ([dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- chore: explicitly set the GITHUB\_WORKSPACE environment variable [\#505](https://github.com/tj-actions/changed-files/pull/505) ([jackton1](https://github.com/jackton1))
|
||||
- Upgraded to v21 [\#503](https://github.com/tj-actions/changed-files/pull/503) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v21](https://github.com/tj-actions/changed-files/tree/v21) (2022-05-25)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v20.2...v21)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- \[Feature\] Handle Pipeline Error [\#500](https://github.com/tj-actions/changed-files/issues/500)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- \[BUG\] System.InvalidOperationException: Maximum object size exceeded [\#501](https://github.com/tj-actions/changed-files/issues/501)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- fix: large output generated by all\_old\_new\_renamed\_files output [\#502](https://github.com/tj-actions/changed-files/pull/502) ([jackton1](https://github.com/jackton1))
|
||||
- Upgraded to v20.2 [\#499](https://github.com/tj-actions/changed-files/pull/499) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v20.2](https://github.com/tj-actions/changed-files/tree/v20.2) (2022-05-24)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v20.1...v20.2)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- \[BUG\] old\_new\_renamed\_files is empty when providing a glob pattern. [\#467](https://github.com/tj-actions/changed-files/issues/467)
|
||||
- \[BUG\] all\_old\_new\_renamed\_files is empty when providing a glob pattern. [\#467](https://github.com/tj-actions/changed-files/issues/467)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
@@ -55,10 +101,6 @@
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v19.1...v19.2)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- feat/add support for retrieving old and new names of renamed files [\#486](https://github.com/tj-actions/changed-files/pull/486) ([jackton1](https://github.com/jackton1))
|
||||
@@ -497,7 +539,7 @@
|
||||
|
||||
## [v13](https://github.com/tj-actions/changed-files/tree/v13) (2022-02-17)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v13)
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.2...v13)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
@@ -516,13 +558,13 @@
|
||||
- \[BUG\] wrong result of any\_change output [\#314](https://github.com/tj-actions/changed-files/issues/314)
|
||||
- \[BUG\] Investigate possible bug using since\_last\_remote\_commit when force pushing changes. [\#303](https://github.com/tj-actions/changed-files/issues/303)
|
||||
|
||||
## [v2.0.1](https://github.com/tj-actions/changed-files/tree/v2.0.1) (2021-12-30)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.2...v2.0.1)
|
||||
|
||||
## [v12.2](https://github.com/tj-actions/changed-files/tree/v12.2) (2021-12-30)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.1...v12.2)
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v12.2)
|
||||
|
||||
## [v2.0.1](https://github.com/tj-actions/changed-files/tree/v2.0.1) (2021-12-30)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.1...v2.0.1)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
@@ -672,7 +714,7 @@
|
||||
|
||||
## [v1.2.1](https://github.com/tj-actions/changed-files/tree/v1.2.1) (2021-11-08)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.2.0...v1.2.1)
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.5...v1.2.1)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
@@ -686,13 +728,13 @@
|
||||
- Update actions/checkout action to v2.4.0 [\#243](https://github.com/tj-actions/changed-files/pull/243) ([renovate[bot]](https://github.com/apps/renovate))
|
||||
- Upgraded to v11.5 [\#241](https://github.com/tj-actions/changed-files/pull/241) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v1.2.0](https://github.com/tj-actions/changed-files/tree/v1.2.0) (2021-10-30)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.5...v1.2.0)
|
||||
|
||||
## [v11.5](https://github.com/tj-actions/changed-files/tree/v11.5) (2021-10-30)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.4...v11.5)
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.2.0...v11.5)
|
||||
|
||||
## [v1.2.0](https://github.com/tj-actions/changed-files/tree/v1.2.0) (2021-10-30)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.4...v1.2.0)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
@@ -1084,7 +1126,7 @@
|
||||
|
||||
## [v7](https://github.com/tj-actions/changed-files/tree/v7) (2021-06-09)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v7)
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v7)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
@@ -1100,13 +1142,13 @@
|
||||
- Update tj-actions/sync-release-version action to v8.7 [\#86](https://github.com/tj-actions/changed-files/pull/86) ([renovate[bot]](https://github.com/apps/renovate))
|
||||
- Upgraded to v6.3 [\#85](https://github.com/tj-actions/changed-files/pull/85) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v6.3](https://github.com/tj-actions/changed-files/tree/v6.3) (2021-05-26)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v6.3)
|
||||
|
||||
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6)
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v6)
|
||||
|
||||
## [v6.3](https://github.com/tj-actions/changed-files/tree/v6.3) (2021-05-26)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6.3)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
|
||||
74
README.md
74
README.md
@@ -67,7 +67,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
|
||||
- name: List all changed files
|
||||
run: |
|
||||
@@ -140,12 +140,13 @@ Support this project with a :star:
|
||||
| files\_ignore\_from\_source\_file | `string` | `false` | | Source file(s) <br> used to populate <br> the `files_ignore` input |
|
||||
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
|
||||
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
|
||||
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
||||
| path | `string` | `false` | `'.'` | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
||||
| since\_last\_remote\_commit | `boolean` | `false` | `false` | Use the last commit on the remote <br> branch as the `base_sha` <br> (Defaults to the last commit <br> on the target branch for Pull requests <br> or the previous commit <br> on the current branch <br> for push events). <br /> NOTE: This requires <br /> `fetch-depth: 0` <br /> with `actions/checkout@v2` |
|
||||
| use\_fork\_point | `boolean` | `false` | `false` | Finds best common ancestor <br /> between two commits <br /> to use in a three-way merge <br /> as the `base_sha` <br /> See: [git merge-base](https://git-scm.com/docs/git-merge-base#Documentation/git-merge-base.txt---fork-point). <br> NOTE: This pulls the entire commit history of the base branch |
|
||||
| quotepath | `boolean` | `false` | `true` | Output filenames completely verbatim by setting this to `false` |
|
||||
| diff\_relative | `boolean` | `false` | | Exclude changes outside the current directory and show pathnames relative to it. |
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
|
||||
```yaml
|
||||
...
|
||||
@@ -157,11 +158,11 @@ Support this project with a :star:
|
||||
|
||||
- name: Get changed files using defaults
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
|
||||
- name: Get changed files using a comma separator
|
||||
id: changed-files-comma
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
separator: ","
|
||||
|
||||
@@ -183,7 +184,7 @@ Support this project with a :star:
|
||||
|
||||
- name: Get specific changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -224,14 +225,14 @@ Support this project with a :star:
|
||||
|
||||
- name: Use a source file or list of file(s) to populate to files input.
|
||||
id: changed-files-specific-source-file
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
|
||||
- name: Use a source file or list of file(s) to populate to files input and optionally specify more files.
|
||||
id: changed-files-specific-source-file-and-specify-files
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -240,13 +241,13 @@ Support this project with a :star:
|
||||
|
||||
- name: Use a different commit SHA
|
||||
id: changed-files-custom-sha
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
sha: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Use a different base SHA
|
||||
id: changed-files-custom-base-sha
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
base_sha: "2096ed0"
|
||||
|
||||
@@ -258,7 +259,7 @@ Support this project with a :star:
|
||||
|
||||
- name: Run changed-files with defaults on the dir1
|
||||
id: changed-files-for-dir1
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
@@ -270,21 +271,64 @@ Support this project with a :star:
|
||||
|
||||
- name: Run changed-files using the last commit on the remote branch
|
||||
id: changed-files-since-last-remote-commit
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
since_last_remote_commit: "true"
|
||||
|
||||
- name: Run changed-files using the fork point of a pull request
|
||||
id: changed-files-fork-point
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
use_fork_point: "true"
|
||||
|
||||
- name: Run changed-files with quotepath disabled
|
||||
id: changed-files-quotepath
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
quotepath: "false"
|
||||
|
||||
# Run changed-files action using the last successful commit as the base_sha
|
||||
# NOTE: This setting overrides the commit sha used by setting since_last_remote_commit to true.
|
||||
# It is recommended to use either solutions that works for your use case.
|
||||
|
||||
# Push event based workflows
|
||||
- name: Get branch name
|
||||
id: branch-name
|
||||
uses: tj-actions/branch-names@v5
|
||||
|
||||
- uses: nrwl/last-successful-commit-action@v1
|
||||
id: last_successful_commit_push
|
||||
with:
|
||||
branch: ${{ steps.branch-name.outputs.current_branch }} # Get the last successful commit for the current branch.
|
||||
workflow_id: 'test.yml'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run
|
||||
id: changed-files-base-sha-push
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_push.outputs.commit_hash }}
|
||||
|
||||
# Pull request based workflows.
|
||||
- name: Get branch name
|
||||
id: branch-name
|
||||
uses: tj-actions/branch-names@v5
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
- uses: nrwl/last-successful-commit-action@v1
|
||||
id: last_successful_commit_pull_request
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
branch: ${{ steps.branch-name.outputs.base_ref_branch }} # Get the last successful commit on master or main branch
|
||||
workflow_id: 'test.yml'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run on main
|
||||
if: github.event_name == 'pull_request'
|
||||
id: changed-files-base-sha-pull-request
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.commit_hash }}
|
||||
|
||||
```
|
||||
|
||||
@@ -336,7 +380,7 @@ With the switch from using grep's Extended regex to match files to the natively
|
||||
|
||||
- name: Get specific changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v20.2
|
||||
uses: tj-actions/changed-files@v22.1
|
||||
with:
|
||||
files: |
|
||||
*.sh
|
||||
|
||||
@@ -61,6 +61,7 @@ inputs:
|
||||
path:
|
||||
description: 'Specify a relative path under $GITHUB_WORKSPACE to locate the repository'
|
||||
required: false
|
||||
default: '.'
|
||||
use_fork_point:
|
||||
description: 'Finds best common ancestor between two commits to use in a three-way merge as the base_sha'
|
||||
default: 'false'
|
||||
@@ -69,6 +70,9 @@ inputs:
|
||||
description: 'Output filenames completely verbatim by setting this to false'
|
||||
default: 'true'
|
||||
required: false
|
||||
diff_relative:
|
||||
description: 'Exclude changes outside the current directory and show pathnames relative to it'
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
added_files:
|
||||
@@ -158,6 +162,7 @@ runs:
|
||||
GITHUB_BASE_REF: ${{ github.base_ref }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
GITHUB_ACTION_PATH: ${{ github.action_path }}
|
||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
||||
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
||||
INPUT_SHA: ${{ inputs.sha }}
|
||||
@@ -166,7 +171,7 @@ runs:
|
||||
INPUT_PATH: ${{ inputs.path }}
|
||||
INPUT_USE_FORK_POINT: ${{ inputs.use_fork_point }}
|
||||
- name: Glob match
|
||||
uses: tj-actions/glob@v7.20
|
||||
uses: tj-actions/glob@v9.2
|
||||
id: glob
|
||||
with:
|
||||
files: ${{ inputs.files }}
|
||||
@@ -187,6 +192,7 @@ runs:
|
||||
shell: bash
|
||||
env:
|
||||
GITHUB_ACTION_PATH: ${{ github.action_path }}
|
||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
||||
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
||||
INPUT_FILES_PATTERN_FILE: ${{ steps.glob.outputs.paths-output-file }}
|
||||
@@ -200,6 +206,7 @@ runs:
|
||||
INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES: ${{ inputs.include_all_old_new_renamed_files }}
|
||||
INPUT_OLD_NEW_SEPARATOR: ${{ inputs.old_new_separator }}
|
||||
INPUT_OLD_NEW_FILES_SEPARATOR: ${{ inputs.old_new_files_separator }}
|
||||
INPUT_DIFF_RELATIVE: ${{ inputs.diff_relative }}
|
||||
|
||||
branding:
|
||||
icon: file-text
|
||||
|
||||
@@ -4,12 +4,12 @@ set -eu
|
||||
|
||||
echo "::group::changed-files-diff-sha"
|
||||
|
||||
echo "Resolving repository path..."
|
||||
|
||||
if [[ -n $INPUT_PATH ]]; then
|
||||
REPO_DIR="$GITHUB_WORKSPACE/$INPUT_PATH"
|
||||
|
||||
echo "Resolving repository path: $REPO_DIR"
|
||||
if [[ ! -d "$REPO_DIR" ]]; then
|
||||
echo "::warning::Invalid repository path"
|
||||
echo "::warning::Invalid repository path: $REPO_DIR"
|
||||
exit 1
|
||||
fi
|
||||
cd "$REPO_DIR"
|
||||
|
||||
@@ -12,6 +12,10 @@ else
|
||||
git config --global core.quotepath on
|
||||
fi
|
||||
|
||||
if [[ -n $INPUT_DIFF_RELATIVE ]]; then
|
||||
git config --global diff.relative "$INPUT_DIFF_RELATIVE"
|
||||
fi
|
||||
|
||||
function get_diff() {
|
||||
base="$1"
|
||||
sha="$2"
|
||||
@@ -52,12 +56,12 @@ function get_renames() {
|
||||
|
||||
echo "::group::changed-files"
|
||||
|
||||
echo "Resolving repository path..."
|
||||
|
||||
if [[ -n $INPUT_PATH ]]; then
|
||||
REPO_DIR="$GITHUB_WORKSPACE/$INPUT_PATH"
|
||||
|
||||
echo "Resolving repository path: $REPO_DIR"
|
||||
if [[ ! -d "$REPO_DIR" ]]; then
|
||||
echo "::warning::Invalid repository path"
|
||||
echo "::warning::Invalid repository path: $REPO_DIR"
|
||||
exit 1
|
||||
fi
|
||||
cd "$REPO_DIR"
|
||||
|
||||
Reference in New Issue
Block a user