Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b638a9708 | ||
|
|
188487d180 | ||
|
|
922308f3c8 | ||
|
|
f2bbfc138b |
26
HISTORY.md
26
HISTORY.md
@@ -1,5 +1,31 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased](https://github.com/tj-actions/changed-files/tree/HEAD)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.3.1...HEAD)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- I cant get `since_last_remote_commit` to work properly on pull\_request event [\#276](https://github.com/tj-actions/changed-files/issues/276)
|
||||
|
||||
## [v1.3.1](https://github.com/tj-actions/changed-files/tree/v1.3.1) (2021-12-04)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.8...v1.3.1)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fixed regression bug with base\_sha for pull\_request [\#278](https://github.com/tj-actions/changed-files/pull/278) ([jackton1](https://github.com/jackton1))
|
||||
- Prevent outputting remote not found error message. [\#277](https://github.com/tj-actions/changed-files/pull/277) ([jackton1](https://github.com/jackton1))
|
||||
- Upgraded to v11.8 [\#275](https://github.com/tj-actions/changed-files/pull/275) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v11.8](https://github.com/tj-actions/changed-files/tree/v11.8) (2021-12-04)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.3.0...v11.8)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Upgraded to v1.3.0 [\#274](https://github.com/tj-actions/changed-files/pull/274) ([jackton1](https://github.com/jackton1))
|
||||
|
||||
## [v1.3.0](https://github.com/tj-actions/changed-files/tree/v1.3.0) (2021-12-04)
|
||||
|
||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.7...v1.3.0)
|
||||
|
||||
22
README.md
22
README.md
@@ -63,7 +63,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
|
||||
- name: List all modified files
|
||||
run: |
|
||||
@@ -136,11 +136,11 @@ Support this project with a :star:
|
||||
|
||||
- name: Get changed files using defaults
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
|
||||
- name: Get changed files using a comma separator
|
||||
id: changed-files-comma
|
||||
uses: tj-actions/changed-files@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
with:
|
||||
separator: ","
|
||||
|
||||
@@ -162,7 +162,7 @@ Support this project with a :star:
|
||||
|
||||
- name: Get specific changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -200,14 +200,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@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.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@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -216,13 +216,13 @@ Support this project with a :star:
|
||||
|
||||
- name: Use a different commit SHA
|
||||
id: changed-files-custom-sha
|
||||
uses: tj-actions/changed-files@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.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@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
with:
|
||||
base_sha: "2096ed0"
|
||||
|
||||
@@ -234,7 +234,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@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
@@ -246,7 +246,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@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
with:
|
||||
since_last_remote_commit: 'true'
|
||||
|
||||
@@ -263,7 +263,7 @@ Support this project with a :star:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v1.3.0
|
||||
uses: tj-actions/changed-files@v1.3.1
|
||||
|
||||
- name: Pre-commit
|
||||
uses: pre-commit/action@v2.0.0
|
||||
|
||||
10
action.yml
10
action.yml
@@ -98,10 +98,12 @@ runs:
|
||||
# "Set base sha..."
|
||||
if [[ -n "${{ inputs.base_sha }}" ]]; then
|
||||
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.pull_request.base.sha }}"
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event_name }}" == "push" && "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.before }}"
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" ]]; then
|
||||
if [[ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.before }}"
|
||||
else
|
||||
echo "::set-output name=base_sha::${{ github.sha }}"
|
||||
fi
|
||||
fi
|
||||
id: base-sha
|
||||
shell: bash
|
||||
|
||||
@@ -24,7 +24,7 @@ git ls-remote --exit-code temp_changed_files 1>/dev/null 2>&1 && exit_status=$?
|
||||
if [[ $exit_status -ne 0 ]]; then
|
||||
echo "No 'temp_changed_files' remote found"
|
||||
echo "Creating 'temp_changed_files' remote..."
|
||||
git remote remove temp_changed_files 1>/dev/null || true
|
||||
git remote remove temp_changed_files 2>/dev/null || true
|
||||
git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}"
|
||||
else
|
||||
echo "Found 'temp_changed_files' remote"
|
||||
@@ -56,6 +56,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
||||
PREVIOUS_SHA=$(git rev-parse HEAD^1 2>&1) && exit_status=$? || exit_status=$?
|
||||
else
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
||||
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||
fi
|
||||
|
||||
git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
||||
@@ -76,8 +77,9 @@ else
|
||||
else
|
||||
git fetch --no-tags -u --progress --depth=1 temp_changed_files "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$?
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||
fi
|
||||
|
||||
|
||||
git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
||||
|
||||
if [[ $exit_status -ne 0 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user