Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
271468ecaf | ||
|
|
5b338faafa | ||
|
|
b73d4f8d3f | ||
|
|
9d48b7acf4 | ||
|
|
2458fea93e | ||
|
|
539c9b2f0c | ||
|
|
1bf2f9775d | ||
|
|
6be19fd726 | ||
|
|
445bbefc90 | ||
|
|
e9f69ac719 | ||
|
|
416c6348f8 | ||
|
|
75f52eeda4 |
2
.github/workflows/sync-release-version.yml
vendored
2
.github/workflows/sync-release-version.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
with:
|
||||
output: 'HISTORY.md'
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v3.12.0
|
||||
uses: peter-evans/create-pull-request@v3.12.1
|
||||
with:
|
||||
base: "main"
|
||||
title: "Upgraded to ${{ steps.sync-release-version.outputs.new_version }}"
|
||||
|
||||
2
.github/workflows/update-readme.yml
vendored
2
.github/workflows/update-readme.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
|
||||
- name: Create Pull Request
|
||||
if: failure()
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
uses: peter-evans/create-pull-request@v3.12.1
|
||||
with:
|
||||
base: "main"
|
||||
title: "Updated README.md"
|
||||
|
||||
47
HISTORY.md
47
HISTORY.md
@@ -1,5 +1,40 @@
|
||||
# Changelog
|
||||
|
||||
## [v14.1](https://github.com/tj-actions/changed-files/tree/v14.1) (2022-01-26)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v4.0.1...v14.1)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Upgraded to v4.0.1 [\#331](https://github.com/tj-actions/changed-files/pull/331) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v4.0.1](https://github.com/tj-actions/changed-files/tree/v4.0.1) (2022-01-26)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v14...v4.0.1)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- bug: Fix command to narrow down target files [\#330](https://github.com/tj-actions/changed-files/pull/330) ([massongit](https://github.com/massongit))
|
||||
- Upgraded to v14 [\#329](https://github.com/tj-actions/changed-files/pull/329) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v14](https://github.com/tj-actions/changed-files/tree/v14) (2022-01-26)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v4.0.0...v14)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Upgraded to v4.0.0 [\#328](https://github.com/tj-actions/changed-files/pull/328) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v4.0.0](https://github.com/tj-actions/changed-files/tree/v4.0.0) (2022-01-26)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v13.2...v4.0.0)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Clean up variable name to reflect usage. [\#327](https://github.com/tj-actions/changed-files/pull/327) ([jackton1](https://github.com/jackton1))
|
||||
- Narrow down target files by exact match of INPUT\_FILES [\#326](https://github.com/tj-actions/changed-files/pull/326) ([massongit](https://github.com/massongit))
|
||||
- Upgraded to v13.2 [\#325](https://github.com/tj-actions/changed-files/pull/325) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v13.2](https://github.com/tj-actions/changed-files/tree/v13.2) (2022-01-25)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v3.0.2...v13.2)
|
||||
@@ -59,7 +94,7 @@
|
||||
|
||||
## [v13](https://github.com/tj-actions/changed-files/tree/v13) (2022-01-05)
|
||||
|
||||
[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:**
|
||||
|
||||
@@ -77,13 +112,13 @@
|
||||
- Upgraded to v2.0.1 [\#298](https://github.com/tj-actions/changed-files/pull/298) ([jackton1](https://github.com/jackton1))
|
||||
- Upgraded to v12.2 [\#297](https://github.com/tj-actions/changed-files/pull/297) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [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:**
|
||||
|
||||
|
||||
28
README.md
28
README.md
@@ -64,7 +64,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
|
||||
- name: List all changed files
|
||||
run: |
|
||||
@@ -141,11 +141,11 @@ Support this project with a :star:
|
||||
|
||||
- name: Get changed files using defaults
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
|
||||
- name: Get changed files using a comma separator
|
||||
id: changed-files-comma
|
||||
uses: tj-actions/changed-files@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
with:
|
||||
separator: ","
|
||||
|
||||
@@ -167,7 +167,7 @@ Support this project with a :star:
|
||||
|
||||
- name: Get specific changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -206,14 +206,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@v13.2
|
||||
uses: tj-actions/changed-files@v14.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@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -222,13 +222,13 @@ Support this project with a :star:
|
||||
|
||||
- name: Use a different commit SHA
|
||||
id: changed-files-custom-sha
|
||||
uses: tj-actions/changed-files@v13.2
|
||||
uses: tj-actions/changed-files@v14.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@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
with:
|
||||
base_sha: "2096ed0"
|
||||
|
||||
@@ -240,7 +240,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@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
@@ -252,7 +252,7 @@ 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@v13.2
|
||||
uses: tj-actions/changed-files@v14.1
|
||||
with:
|
||||
since_last_remote_commit: "true"
|
||||
|
||||
@@ -270,6 +270,14 @@ Support this project with a :star:
|
||||
> * However, this action will handle spaces in file names, with a recommendation of using a separator to prevent hidden issues.
|
||||
> 
|
||||
|
||||
## Compatibility
|
||||
|
||||
| Runner | Supported version |
|
||||
|--------------------------|-----------------------|
|
||||
| [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) | `v14.1` |
|
||||
| [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server) | `v14.1` |
|
||||
| [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) | `v12.2` & `v2.0.1` |
|
||||
|
||||
## Credits
|
||||
|
||||
This package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter).
|
||||
|
||||
14
action.yml
14
action.yml
@@ -112,21 +112,13 @@ runs:
|
||||
fi
|
||||
id: base-sha
|
||||
shell: bash
|
||||
- run: |
|
||||
bash $GITHUB_ACTION_PATH/sourcefiles.sh
|
||||
id: source-input-files
|
||||
shell: bash
|
||||
env:
|
||||
# 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: ${{ inputs.files }}
|
||||
INPUT_FILES_FROM_SOURCE_FILE: ${{ inputs.files_from_source_file }}
|
||||
- name: Glob match
|
||||
uses: tj-actions/glob@v3.3
|
||||
uses: tj-actions/glob@v5
|
||||
id: glob
|
||||
with:
|
||||
files: ${{ steps.source-input-files.outputs.files }}
|
||||
files: ${{ inputs.files }}
|
||||
files-separator: " "
|
||||
files-from-source-file: ${{ inputs.files_from_source_file }}
|
||||
separator: "|"
|
||||
- run: |
|
||||
bash $GITHUB_ACTION_PATH/entrypoint.sh
|
||||
|
||||
@@ -107,18 +107,19 @@ if [[ -z "$INPUT_FILES_PATTERN" ]]; then
|
||||
ALL_MODIFIED=$(git diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
else
|
||||
echo "Input files pattern: $INPUT_FILES_PATTERN"
|
||||
FILES_PATTERN="^($INPUT_FILES_PATTERN)$"
|
||||
|
||||
ADDED=$(git diff --diff-filter=A --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
COPIED=$(git diff --diff-filter=C --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
DELETED=$(git diff --diff-filter=D --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
MODIFIED=$(git diff --diff-filter=M --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
RENAMED=$(git diff --diff-filter=R --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
TYPE_CHANGED=$(git diff --diff-filter=T --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
UNMERGED=$(git diff --diff-filter=U --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
UNKNOWN=$(git diff --diff-filter=X --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
ALL_CHANGED_AND_MODIFIED=$(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
ALL_CHANGED=$(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
ALL_MODIFIED=$(git diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -x "$INPUT_FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
ADDED=$(git diff --diff-filter=A --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
COPIED=$(git diff --diff-filter=C --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
DELETED=$(git diff --diff-filter=D --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
MODIFIED=$(git diff --diff-filter=M --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
RENAMED=$(git diff --diff-filter=R --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
TYPE_CHANGED=$(git diff --diff-filter=T --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
UNMERGED=$(git diff --diff-filter=U --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
UNKNOWN=$(git diff --diff-filter=X --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
ALL_CHANGED_AND_MODIFIED=$(git diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
ALL_CHANGED=$(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
ALL_MODIFIED=$(git diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
|
||||
ALL_OTHER_CHANGED=$(git diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "::group::changed-files-from-source-file"
|
||||
|
||||
RAW_FILES=()
|
||||
|
||||
if [[ -n $INPUT_FILES_FROM_SOURCE_FILE ]]; then
|
||||
for file in $INPUT_FILES_FROM_SOURCE_FILE
|
||||
do
|
||||
while read -r fileName; do
|
||||
RAW_FILES+=("$fileName")
|
||||
done <"$file"
|
||||
done
|
||||
fi
|
||||
|
||||
IFS=" " read -r -a CLEAN_FILES <<< "$(echo "${RAW_FILES[*]}" | tr "\r\n" "\n" | tr " " "\n" | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}')"
|
||||
|
||||
IFS=" " read -r -a CLEAN_INPUT_FILES <<< "$(echo "${INPUT_FILES}" | tr "\r\n" "\n" | tr " " "\n" | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}')"
|
||||
|
||||
FILES=("${CLEAN_FILES[@]}" "${CLEAN_INPUT_FILES[@]}")
|
||||
|
||||
IFS=" " read -r -a ALL_UNIQUE_FILES <<< "$(echo "${FILES[@]}" | tr "\r\n" "\n" | tr " " "\n" | awk '!a[$0]++' | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}')"
|
||||
|
||||
echo "Input files: ${ALL_UNIQUE_FILES[*]}"
|
||||
|
||||
echo "::set-output name=files::${ALL_UNIQUE_FILES[*]}"
|
||||
|
||||
echo "::endgroup::"
|
||||
Reference in New Issue
Block a user