Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bfa539f0d | ||
|
|
4db62cd596 | ||
|
|
654e9a041e | ||
|
|
9af8ec1a72 | ||
|
|
d679de9200 | ||
|
|
e5890a16d1 | ||
|
|
76699419e3 |
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
- name: Checkout to branch
|
- name: Checkout to branch
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
uses: reviewdog/action-shellcheck@v1.5
|
uses: reviewdog/action-shellcheck@v1.6
|
||||||
|
|
||||||
test-no-head-sha:
|
test-no-head-sha:
|
||||||
name: Test changed-files missing head sha
|
name: Test changed-files missing head sha
|
||||||
|
|||||||
25
HISTORY.md
25
HISTORY.md
@@ -1,5 +1,29 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v8.3](https://github.com/tj-actions/changed-files/tree/v8.3) (2021-06-25)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.2...v8.3)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fixed empty branch name in debug message [\#115](https://github.com/tj-actions/changed-files/pull/115) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v8.2 [\#114](https://github.com/tj-actions/changed-files/pull/114) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v8.2](https://github.com/tj-actions/changed-files/tree/v8.2) (2021-06-24)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8.1...v8.2)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update arrow direction and added branch information [\#113](https://github.com/tj-actions/changed-files/pull/113) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Updated README.md [\#112](https://github.com/tj-actions/changed-files/pull/112) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Update tj-actions/verify-changed-files action to v7 [\#111](https://github.com/tj-actions/changed-files/pull/111) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Upgraded to v8.1 [\#110](https://github.com/tj-actions/changed-files/pull/110) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v8.1](https://github.com/tj-actions/changed-files/tree/v8.1) (2021-06-18)
|
## [v8.1](https://github.com/tj-actions/changed-files/tree/v8.1) (2021-06-18)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8...v8.1)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v8...v8.1)
|
||||||
@@ -20,7 +44,6 @@
|
|||||||
|
|
||||||
- support windows-latest [\#101](https://github.com/tj-actions/changed-files/issues/101)
|
- support windows-latest [\#101](https://github.com/tj-actions/changed-files/issues/101)
|
||||||
- issues with failed getting changed files [\#100](https://github.com/tj-actions/changed-files/issues/100)
|
- issues with failed getting changed files [\#100](https://github.com/tj-actions/changed-files/issues/100)
|
||||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -30,7 +30,7 @@ Retrieve all changed files relative to the default branch (`pull_request*` based
|
|||||||
|
|
||||||
> NOTE: :warning:
|
> NOTE: :warning:
|
||||||
>
|
>
|
||||||
> * **IMPORTANT:** For `push` events to work you need to include `fetch-depth: 0` **OR** `fetch-depth: 2` depending on your use case.
|
> * **IMPORTANT:** For `push` events you need to include `fetch-depth: 0` **OR** `fetch-depth: 2` depending on your use case.
|
||||||
> * When using `persist-credentials: false` with `actions/checkout@v2` you'll need to specify a `token` using the `token` input.
|
> * When using `persist-credentials: false` with `actions/checkout@v2` you'll need to specify a `token` using the `token` input.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v8.1
|
uses: tj-actions/changed-files@v8.3
|
||||||
|
|
||||||
- name: List all modified files
|
- name: List all modified files
|
||||||
run: |
|
run: |
|
||||||
@@ -108,11 +108,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files using defaults
|
- name: Get changed files using defaults
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v8.1
|
uses: tj-actions/changed-files@v8.3
|
||||||
|
|
||||||
- name: Get changed files using a comma separator
|
- name: Get changed files using a comma separator
|
||||||
id: changed-files-comma
|
id: changed-files-comma
|
||||||
uses: tj-actions/changed-files@v8.1
|
uses: tj-actions/changed-files@v8.3
|
||||||
with:
|
with:
|
||||||
separator: ","
|
separator: ","
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get specific changed files
|
- name: Get specific changed files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v8.1
|
uses: tj-actions/changed-files@v8.3
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
@@ -163,7 +163,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v8.1
|
uses: tj-actions/changed-files@v8.3
|
||||||
|
|
||||||
- name: Pre-commit
|
- name: Pre-commit
|
||||||
uses: pre-commit/action@v2.0.0
|
uses: pre-commit/action@v2.0.0
|
||||||
@@ -184,6 +184,8 @@ jobs:
|
|||||||
|
|
||||||
If you feel generous and want to show some extra appreciation:
|
If you feel generous and want to show some extra appreciation:
|
||||||
|
|
||||||
|
Support me with a :star:
|
||||||
|
|
||||||
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
|
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
|
||||||
|
|
||||||
[buymeacoffee]: https://www.buymeacoffee.com/jackton1
|
[buymeacoffee]: https://www.buymeacoffee.com/jackton1
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
echo "::group::changed-files"
|
||||||
|
|
||||||
git remote set-url origin "https://${INPUT_TOKEN}@github.com/${GITHUB_REPOSITORY}"
|
git remote set-url origin "https://${INPUT_TOKEN}@github.com/${GITHUB_REPOSITORY}"
|
||||||
|
|
||||||
echo "Getting HEAD info..."
|
echo "Getting HEAD info..."
|
||||||
@@ -19,6 +21,8 @@ fi
|
|||||||
|
|
||||||
if [[ -z $GITHUB_BASE_REF ]]; then
|
if [[ -z $GITHUB_BASE_REF ]]; then
|
||||||
PREV_SHA=$(git rev-parse HEAD^1 2>&1) && exit_status=$? || exit_status=$?
|
PREV_SHA=$(git rev-parse HEAD^1 2>&1) && exit_status=$? || exit_status=$?
|
||||||
|
TARGET_BRANCH=${GITHUB_REF/refs\/heads\//}
|
||||||
|
CURRENT_BRANCH=$TARGET_BRANCH
|
||||||
|
|
||||||
if [[ $exit_status -ne 0 ]]; then
|
if [[ $exit_status -ne 0 ]]; then
|
||||||
echo "::warning::Unable to determine the previous commit sha"
|
echo "::warning::Unable to determine the previous commit sha"
|
||||||
@@ -27,6 +31,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
TARGET_BRANCH=${GITHUB_BASE_REF}
|
TARGET_BRANCH=${GITHUB_BASE_REF}
|
||||||
|
CURRENT_BRANCH=$GITHUB_HEAD_REF
|
||||||
git fetch --depth=1 origin "${TARGET_BRANCH}":"${TARGET_BRANCH}"
|
git fetch --depth=1 origin "${TARGET_BRANCH}":"${TARGET_BRANCH}"
|
||||||
PREV_SHA=$(git rev-parse "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$?
|
PREV_SHA=$(git rev-parse "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
|
|
||||||
@@ -36,7 +41,7 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Retrieving changes between $PREV_SHA ($TARGET_BRANCH) ← $CURR_SHA ($GITHUB_HEAD_REF)"
|
echo "Retrieving changes between $PREV_SHA ($TARGET_BRANCH) ← $CURR_SHA ($CURRENT_BRANCH)"
|
||||||
|
|
||||||
if [[ -z "$INPUT_FILES" ]]; then
|
if [[ -z "$INPUT_FILES" ]]; then
|
||||||
echo "Getting diff..."
|
echo "Getting diff..."
|
||||||
@@ -143,3 +148,5 @@ echo "::set-output name=unmerged_files::$UNMERGED"
|
|||||||
echo "::set-output name=unknown_files::$UNKNOWN"
|
echo "::set-output name=unknown_files::$UNKNOWN"
|
||||||
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
||||||
echo "::set-output name=all_modified_files::$ALL_MODIFIED_FILES"
|
echo "::set-output name=all_modified_files::$ALL_MODIFIED_FILES"
|
||||||
|
|
||||||
|
echo "::endgroup::"
|
||||||
|
|||||||
Reference in New Issue
Block a user