Compare commits

...

40 Commits

Author SHA1 Message Date
Tonye Jack
57d9664f8e Update diff-sha.sh 2023-01-19 14:15:50 -07:00
Tonye Jack
653adcf614 fix: revert change to pull pr branch via the branch name (#958) 2023-01-19 14:11:25 -07:00
Tonye Jack
019dd18a51 Update README.md 2023-01-19 08:58:09 -07:00
Tonye Jack
235067705e Upgraded to v35.4.3 (#954)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-18 19:02:34 -07:00
Tonye Jack
f487fc6c7b feat: add guide for retrieving changed files for tags (#955) 2023-01-18 19:02:19 -07:00
Tonye Jack
0953088baa Update diff-sha.sh 2023-01-18 17:44:51 -07:00
Tonye Jack
ddc065bac8 Update diff-sha.sh 2023-01-18 17:42:26 -07:00
Tonye Jack
82b26d6c01 Update diff-sha.sh 2023-01-18 17:05:21 -07:00
Tonye Jack
c54e638a31 Update diff-sha.sh 2023-01-18 16:51:30 -07:00
Tonye Jack
e7bcef0f0b fix: handling since last remote commits for the first pr branch commit (#953) 2023-01-18 23:35:50 +00:00
Tonye Jack
6f8a32e362 Upgraded to v35.4.2 (#951)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-18 19:22:55 +00:00
Tonye Jack
0562b9f865 fix: handle case of invalid file patterns (#950) 2023-01-18 11:54:46 -07:00
Tonye Jack
be519638b0 Update README.md 2023-01-17 17:27:32 -07:00
Tonye Jack
596fc641d0 Update README.md 2023-01-17 17:19:40 -07:00
Tonye Jack
c0c2634976 Update README.md 2023-01-17 05:26:20 -07:00
Tonye Jack
5ac4c9fe42 Updated README.md (#948)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-13 19:34:44 +00:00
Tonye Jack
93ae7c6b6a Update README.md 2023-01-13 12:16:39 -07:00
Tonye Jack
ca8881ae34 Upgraded to v35.4.1 (#946)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-11 23:15:50 +00:00
Tonye Jack
487675b843 fix: bug retrieving diff with custom a base sha (#945)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-01-11 20:58:50 +00:00
Tonye Jack
988322a381 Update diff-sha.sh 2023-01-11 13:36:35 -07:00
Tonye Jack
30649ae7e0 Updated README.md (#943)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
2023-01-10 19:55:11 +00:00
Tonye Jack
52c733bd7b chore: make since_last_remote_commit optional (#942) 2023-01-10 19:38:39 +00:00
Tonye Jack
e6a750f507 Update README.md 2023-01-06 10:58:28 -07:00
Tonye Jack
b1a4c25c63 Updated .github/workflows/update-readme.yml 2023-01-05 22:01:58 -07:00
Tonye Jack
15be594e99 Updated .github/workflows/update-readme.yml 2023-01-05 21:46:20 -07:00
Tonye Jack
5af8560e3b Updated .github/workflows/update-readme.yml 2023-01-05 21:22:49 -07:00
Tonye Jack
ef3b39a58e Updated .github/workflows/update-readme.yml 2023-01-05 21:21:03 -07:00
Tonye Jack
a7850c2ddb Upgraded to v35.4.0 (#937)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-05 20:25:57 +00:00
Chiel Fernhout
9a6dabf8d1 Make example consistent and out of the box usable (#931)
Co-authored-by: Tonye Jack <jtonye@ymail.com>
2023-01-05 19:24:02 +00:00
Tonye Jack
4f9f822a4a Update README.md 2023-01-05 12:09:37 -07:00
Tonye Jack
e5ceb2cea2 Update README.md 2023-01-05 11:20:14 -07:00
Tonye Jack
238f44e1cf Upgraded to v35.3.2 (#936)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-05 11:12:15 -07:00
Tonye Jack
dc4c7d50aa fix: error overriding the base sha (#933) 2023-01-05 11:12:03 -07:00
Tonye Jack
ebf889a3b1 feat: skip fetching remote refs for non shallow clones (#934) 2023-01-05 11:01:14 -07:00
Tonye Jack
45c8d9cb88 Updated README.md (#935)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-05 11:00:54 -07:00
allcontributors[bot]
19b584354a docs: add cfernhout as a contributor for doc (#932)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-01-05 10:58:53 -07:00
Tonye Jack
7839ede089 fix(regression): invalid json output. (#930)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-01-05 10:19:06 -07:00
renovate[bot]
15cb0ce053 chore(deps): update actions/checkout action to v3.3.0 (#929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-01-05 08:19:08 -07:00
Tonye Jack
c50c1e0f0c Update manual-test.yml 2023-01-05 08:17:46 -07:00
Tonye Jack
b6c440bf6f Upgraded to v35.3.1 (#928)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-01-05 09:32:32 +00:00
12 changed files with 294 additions and 91 deletions

View File

@@ -169,6 +169,15 @@
"code", "code",
"doc" "doc"
] ]
},
{
"login": "cfernhout",
"name": "Chiel Fernhout",
"avatar_url": "https://avatars.githubusercontent.com/u/22294606?v=4",
"profile": "https://github.com/cfernhout",
"contributions": [
"doc"
]
} }
], ],
"contributorsPerLine": 7, "contributorsPerLine": 7,

View File

@@ -3,6 +3,7 @@ name: Manual Test
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
test: test:
name: Test changed-files name: Test changed-files

View File

@@ -3,7 +3,6 @@ name: CI
on: on:
push: push:
branches: branches:
- main
- "**" - "**"
pull_request: pull_request:
types: types:
@@ -859,8 +858,11 @@ jobs:
( (
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test.txt') !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '[test new].txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml')
) )
run: | run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then
@@ -881,8 +883,11 @@ jobs:
( (
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml') && !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test.txt') !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '[test new].txt') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml')
) )
run: | run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then
@@ -899,7 +904,16 @@ jobs:
shell: shell:
bash bash
- name: Verify any_deleted from source files - name: Verify any_deleted from source files
if: "!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test.txt')" if: |
(
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '[test new].txt') &&
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml')
)
run: | run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-source-file.outputs.any_deleted }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-source-file.outputs.any_deleted }})"
@@ -925,7 +939,15 @@ jobs:
shell: shell:
bash bash
- name: Verify any_changed files comma separator - name: Verify any_changed files comma separator
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'test/test.txt')" if: |
(
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt')
)
run: | run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }})"
@@ -934,7 +956,15 @@ jobs:
shell: shell:
bash bash
- name: Verify any_modified files comma separator - name: Verify any_modified files comma separator
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'test/test.txt')" if: |
(
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt')
)
run: | run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }})"
@@ -943,7 +973,15 @@ jobs:
shell: shell:
bash bash
- name: Verify any_deleted files with comma separator - name: Verify any_deleted files with comma separator
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, 'test/test.txt')" if: |
(
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'action.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '[test new].txt')
)
run: | run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }}" != "false" ]]; then if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }})" echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }})"
@@ -951,18 +989,6 @@ jobs:
fi fi
shell: shell:
bash bash
- name: Run changed-files with custom sha
id: changed-files-custom-sha
if: github.event_name == 'pull_request' && github.event.action != 'closed'
uses: ./
with:
sha: ${{ github.event.pull_request.head.sha }}
- name: Show output
if: github.event.action != 'closed'
run: |
echo '${{ toJSON(steps.changed-files-custom-sha.outputs) }}'
shell:
bash
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v6 uses: tj-actions/branch-names@v6
@@ -985,6 +1011,31 @@ jobs:
echo '${{ toJSON(steps.changed-files-custom-base-sha.outputs) }}' echo '${{ toJSON(steps.changed-files-custom-base-sha.outputs) }}'
shell: shell:
bash bash
- name: Run changed-files with custom sha
id: changed-files-custom-sha
if: github.event_name == 'pull_request' && github.event.action != 'closed'
uses: ./
with:
sha: ${{ github.event.pull_request.head.sha }}
- name: Show output
if: github.event.action != 'closed'
run: |
echo '${{ toJSON(steps.changed-files-custom-sha.outputs) }}'
shell:
bash
- name: Run changed-files with the pull request base sha and head sha
id: changed-files-pull-request-base-sha-head-sha
if: github.event_name == 'pull_request' && github.event.action != 'closed'
uses: ./
with:
base_sha: ${{ github.event.pull_request.base.sha }}
sha: ${{ github.event.pull_request.head.sha }}
- name: Show output
if: github.event.action != 'closed'
run: |
echo '${{ toJSON(steps.changed-files-pull-request-base-sha-head-sha.outputs) }}'
shell:
bash
- name: Run changed-files with specific files (only-changed) - name: Run changed-files with specific files (only-changed)
id: changed-files-specific-only-changed id: changed-files-specific-only-changed
uses: ./ uses: ./

View File

@@ -9,14 +9,14 @@ jobs:
sync-assets: sync-assets:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3.2.0 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Run auto-doc - name: Run auto-doc
uses: tj-actions/auto-doc@v1.7.3 uses: tj-actions/auto-doc@v1
- name: Run test - name: Run remark
uses: tj-actions/remark@v3 uses: tj-actions/remark@v3
- name: Verify Changed files - name: Verify Changed files
@@ -34,7 +34,7 @@ jobs:
- name: Create Pull Request - name: Create Pull Request
if: failure() if: failure()
uses: peter-evans/create-pull-request@v4.2.3 uses: peter-evans/create-pull-request@v4
with: with:
base: "main" base: "main"
labels: "merge when passing" labels: "merge when passing"

View File

@@ -1,25 +1,105 @@
# Changelog # Changelog
## [Unreleased](https://github.com/tj-actions/changed-files/tree/HEAD) ## [v35](https://github.com/tj-actions/changed-files/tree/v35) (2023-01-19)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35...HEAD) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.4.3...v35)
## [v35.4.3](https://github.com/tj-actions/changed-files/tree/v35.4.3) (2023-01-19)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.4.2...v35.4.3)
**Fixed bugs:**
- \[BUG\] Files not found when not last commit on new branch [\#952](https://github.com/tj-actions/changed-files/issues/952)
- \[BUG\] `changed-files` error during run [\#875](https://github.com/tj-actions/changed-files/issues/875)
**Merged pull requests:**
- fix: handling since last remote commits for the first pr branch commit [\#953](https://github.com/tj-actions/changed-files/pull/953) ([jackton1](https://github.com/jackton1))
- Upgraded to v35.4.2 [\#951](https://github.com/tj-actions/changed-files/pull/951) ([jackton1](https://github.com/jackton1))
## [v35.4.2](https://github.com/tj-actions/changed-files/tree/v35.4.2) (2023-01-18)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.4.1...v35.4.2)
**Fixed bugs:**
- \[BUG\] Unable find a diff between ... [\#944](https://github.com/tj-actions/changed-files/issues/944)
**Merged pull requests:**
- fix: handle case of invalid file patterns [\#950](https://github.com/tj-actions/changed-files/pull/950) ([jackton1](https://github.com/jackton1))
- Updated README.md [\#948](https://github.com/tj-actions/changed-files/pull/948) ([jackton1](https://github.com/jackton1))
- Upgraded to v35.4.1 [\#946](https://github.com/tj-actions/changed-files/pull/946) ([jackton1](https://github.com/jackton1))
## [v35.4.1](https://github.com/tj-actions/changed-files/tree/v35.4.1) (2023-01-11)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.4.0...v35.4.1)
**Implemented enhancements:**
- \[Feature\] Specify base branch, not just base-sha [\#941](https://github.com/tj-actions/changed-files/issues/941)
- \[Feature\] Get contents of deleted file [\#938](https://github.com/tj-actions/changed-files/issues/938)
**Merged pull requests:**
- fix: bug retrieving diff with custom a base sha [\#945](https://github.com/tj-actions/changed-files/pull/945) ([jackton1](https://github.com/jackton1))
- Updated README.md [\#943](https://github.com/tj-actions/changed-files/pull/943) ([jackton1](https://github.com/jackton1))
- chore: make since\_last\_remote\_commit optional [\#942](https://github.com/tj-actions/changed-files/pull/942) ([jackton1](https://github.com/jackton1))
- Upgraded to v35.4.0 [\#937](https://github.com/tj-actions/changed-files/pull/937) ([jackton1](https://github.com/jackton1))
## [v35.4.0](https://github.com/tj-actions/changed-files/tree/v35.4.0) (2023-01-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.2...v35.4.0)
**Implemented enhancements:**
- \[Feature\] Skip fetching remote refs for non shallow clones [\#924](https://github.com/tj-actions/changed-files/issues/924)
**Fixed bugs:**
- \[BUG\] v35.3.0 Fails to add \[\] around files when with:json: true [\#926](https://github.com/tj-actions/changed-files/issues/926)
**Merged pull requests:**
- Upgraded to v35.3.2 [\#936](https://github.com/tj-actions/changed-files/pull/936) ([jackton1](https://github.com/jackton1))
- Updated README.md [\#935](https://github.com/tj-actions/changed-files/pull/935) ([jackton1](https://github.com/jackton1))
- feat: skip fetching remote refs for non shallow clones [\#934](https://github.com/tj-actions/changed-files/pull/934) ([jackton1](https://github.com/jackton1))
- fix: error overriding the base sha [\#933](https://github.com/tj-actions/changed-files/pull/933) ([jackton1](https://github.com/jackton1))
- docs: add cfernhout as a contributor for doc [\#932](https://github.com/tj-actions/changed-files/pull/932) ([allcontributors[bot]](https://github.com/apps/allcontributors))
- Make example consistent and out of the box usable [\#931](https://github.com/tj-actions/changed-files/pull/931) ([cfernhout](https://github.com/cfernhout))
## [v35.3.2](https://github.com/tj-actions/changed-files/tree/v35.3.2) (2023-01-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.1...v35.3.2)
**Closed issues:**
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
**Merged pull requests:**
- fix\(regression\): invalid json output. [\#930](https://github.com/tj-actions/changed-files/pull/930) ([jackton1](https://github.com/jackton1))
- chore\(deps\): update actions/checkout action to v3.3.0 [\#929](https://github.com/tj-actions/changed-files/pull/929) ([renovate[bot]](https://github.com/apps/renovate))
- Upgraded to v35.3.1 [\#928](https://github.com/tj-actions/changed-files/pull/928) ([jackton1](https://github.com/jackton1))
## [v35.3.1](https://github.com/tj-actions/changed-files/tree/v35.3.1) (2023-01-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.0...v35.3.1)
**Fixed bugs:** **Fixed bugs:**
- \[BUG\] `files_ignore` used with `files` not ignoring as expected [\#901](https://github.com/tj-actions/changed-files/issues/901) - \[BUG\] `files_ignore` used with `files` not ignoring as expected [\#901](https://github.com/tj-actions/changed-files/issues/901)
## [v35](https://github.com/tj-actions/changed-files/tree/v35) (2023-01-05) **Merged pull requests:**
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.0...v35) - fix: json output [\#927](https://github.com/tj-actions/changed-files/pull/927) ([jackton1](https://github.com/jackton1))
- Upgraded to v35.3.0 [\#925](https://github.com/tj-actions/changed-files/pull/925) ([jackton1](https://github.com/jackton1))
## [v35.3.0](https://github.com/tj-actions/changed-files/tree/v35.3.0) (2023-01-05) ## [v35.3.0](https://github.com/tj-actions/changed-files/tree/v35.3.0) (2023-01-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.2.1...v35.3.0) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.2.1...v35.3.0)
**Closed issues:**
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
**Merged pull requests:** **Merged pull requests:**
- fix: bug dirnames output [\#923](https://github.com/tj-actions/changed-files/pull/923) ([jackton1](https://github.com/jackton1)) - fix: bug dirnames output [\#923](https://github.com/tj-actions/changed-files/pull/923) ([jackton1](https://github.com/jackton1))
@@ -125,7 +205,6 @@
**Fixed bugs:** **Fixed bugs:**
- \[BUG\] Process completed with exit code 1 [\#884](https://github.com/tj-actions/changed-files/issues/884) - \[BUG\] Process completed with exit code 1 [\#884](https://github.com/tj-actions/changed-files/issues/884)
- \[BUG\] `changed-files` error during run [\#875](https://github.com/tj-actions/changed-files/issues/875)
**Closed issues:** **Closed issues:**
@@ -563,7 +642,7 @@
## [v34.0.0](https://github.com/tj-actions/changed-files/tree/v34.0.0) (2022-10-25) ## [v34.0.0](https://github.com/tj-actions/changed-files/tree/v34.0.0) (2022-10-25)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v33...v34.0.0) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v33.0.0...v34.0.0)
**Fixed bugs:** **Fixed bugs:**
@@ -576,13 +655,13 @@
- feat: add support for fetching more history [\#709](https://github.com/tj-actions/changed-files/pull/709) ([jackton1](https://github.com/jackton1)) - feat: add support for fetching more history [\#709](https://github.com/tj-actions/changed-files/pull/709) ([jackton1](https://github.com/jackton1))
- Upgraded to v33.0.0 [\#707](https://github.com/tj-actions/changed-files/pull/707) ([jackton1](https://github.com/jackton1)) - Upgraded to v33.0.0 [\#707](https://github.com/tj-actions/changed-files/pull/707) ([jackton1](https://github.com/jackton1))
## [v33](https://github.com/tj-actions/changed-files/tree/v33) (2022-10-21)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v33.0.0...v33)
## [v33.0.0](https://github.com/tj-actions/changed-files/tree/v33.0.0) (2022-10-21) ## [v33.0.0](https://github.com/tj-actions/changed-files/tree/v33.0.0) (2022-10-21)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v32.1.2...v33.0.0) [Full Changelog](https://github.com/tj-actions/changed-files/compare/v33...v33.0.0)
## [v33](https://github.com/tj-actions/changed-files/tree/v33) (2022-10-21)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v32.1.2...v33)
**Closed issues:** **Closed issues:**

View File

@@ -9,7 +9,7 @@
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-) [![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END --> <!-- ALL-CONTRIBUTORS-BADGE:END -->
@@ -26,6 +26,7 @@ Retrieve all changed files and directories relative to the target branch or the
* Escaped JSON Output which can be used for running matrix jobs based on changed files. * Escaped JSON Output which can be used for running matrix jobs based on changed files.
* Optionally list only changed directories. * Optionally list only changed directories.
* Restrict the max depth of changed directories. * Restrict the max depth of changed directories.
* Optionally save outputs to files at a specified location for further processing.
* Monorepos (Fetches only the last remote commit). * Monorepos (Fetches only the last remote commit).
* Supports all platforms (Linux, MacOS, Windows). * Supports all platforms (Linux, MacOS, Windows).
* [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) support * [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) support
@@ -38,6 +39,7 @@ Retrieve all changed files and directories relative to the target branch or the
* Restrict change detection to a subset of files and directories: * Restrict change detection to a subset of files and directories:
* Boolean output indicating that certain files have been changed. * Boolean output indicating that certain files have been changed.
* Using [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching. * Using [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
* Brace expansion
## Usage ## Usage
@@ -47,24 +49,23 @@ Retrieve all changed files and directories relative to the target branch or the
> * For monorepos where pulling all the branch history might not be desired, you can omit `fetch-depth` for `pull_request` events. > * For monorepos where pulling all the branch history might not be desired, you can omit `fetch-depth` for `pull_request` events.
> * For files located in a sub-directory ensure that the pattern specified contains `**/` (globstar) to match any preceding directories or explicitly pass the full path relative to the project root. See: [#314](https://github.com/tj-actions/changed-files/issues/314). > * For files located in a sub-directory ensure that the pattern specified contains `**/` (globstar) to match any preceding directories or explicitly pass the full path relative to the project root. See: [#314](https://github.com/tj-actions/changed-files/issues/314).
> * All multiline inputs should not use double or single qoutes since the value is already a string seperated by a newline character. See [Examples](#examples) for more information. > * All multiline inputs should not use double or single qoutes since the value is already a string seperated by a newline character. See [Examples](#examples) for more information.
> * Ensure that `persist-credentials` is set to `true` when configuring `actions/checkout`. > * Ensure that `persist-credentials` is set to `true` when configuring `actions/checkout` if `fetch-depth` isn't set to `0`.
```yaml ```yaml
name: CI name: CI
on: on:
# Compare the preceeding commit of main -> to the current commit of the main branch. # Compare the preceeding commit -> to the current commit of the main branch.
# (Note: To compare changes between the last pushed commit to the remote main branch set `since_last_remote_commit: true`) # (Note: To compare changes between the current commit to the last pushed remote commit of the main branch set `since_last_remote_commit: true`)
push: push:
branches: branches:
- main - main
# Compare the last commit of main -> to the current commit of a PR branch. # Compare the last commit of main -> to the current commit of a PR branch.
# (Note: To compare changes between the last pushed commit to the remote PR branch set `since_last_remote_commit: true`) # (Note: To compare changes between the current commit to the last pushed remote commit of a PR branch set `since_last_remote_commit: true`)
pull_request: pull_request:
branches: branches:
- main - main
jobs: jobs:
build: build:
runs-on: ubuntu-latest # windows-latest | macos-latest runs-on: ubuntu-latest # windows-latest | macos-latest
@@ -90,8 +91,7 @@ jobs:
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v35 uses: tj-actions/changed-files@v35
with: with:
files: | files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
docs/**
- name: Run step if any file(s) in the docs folder change - name: Run step if any file(s) in the docs folder change
if: steps.changed-files-specific.outputs.any_changed == 'true' if: steps.changed-files-specific.outputs.any_changed == 'true'
@@ -182,7 +182,7 @@ Support this project with a :star:
| separator | string | false | `" "` | Split character for output strings | | separator | string | false | `" "` | Split character for output strings |
| sha | string | false | | Specify a different commit SHA used<br>for comparing changes | | sha | string | false | | Specify a different commit SHA used<br>for comparing changes |
| since | string | false | | Get changed files for commits whose<br> timestamp is older than the given<br>time. | | since | string | false | | Get changed files for commits whose<br> timestamp is older than the given<br>time. |
| since\_last\_remote\_commit | string | true | `"false"` | Use the last commit on the<br> remote branch as the `base_sha`. Defaults<br> to the last non merge commit<br> on the target branch for pull<br> request events and the previous remote<br> commit of the current branch for<br>push events. | | since\_last\_remote\_commit | string | false | `"false"` | Use the last commit on the<br> remote branch as the `base_sha`. Defaults<br> to the last non merge commit<br> on the target branch for pull<br> request events and the previous remote<br> commit of the current branch for<br>push events. |
| until | string | false | | Get changed files for commits whose<br> timestamp is earlier than the given<br>time. | | until | string | false | | Get changed files for commits whose<br> timestamp is earlier than the given<br>time. |
| write\_output\_files | string | false | `"false"` | Write outputs to files in the<br>`.github/outputs` folder by default. | | write\_output\_files | string | false | `"false"` | Write outputs to files in the<br>`.github/outputs` folder by default. |
@@ -285,12 +285,12 @@ See [inputs](#inputs) for more information.
</details> </details>
<details> <details>
<summary>Get all changed files using a list of files and take action base on the changes</summary> <summary>Get all changed files using a list of files and take action based on the changes</summary>
```yaml ```yaml
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files-specific
uses: tj-actions/changed-files@v35 uses: tj-actions/changed-files@v35
with: with:
files: | files: |
@@ -312,16 +312,16 @@ See [inputs](#inputs) for more information.
echo "Only files listed above have changed." echo "Only files listed above have changed."
- name: Run step if any of the listed files above is deleted - name: Run step if any of the listed files above is deleted
if: steps.changed-files.outputs.any_deleted == 'true' if: steps.changed-files-specific.outputs.any_deleted == 'true'
run: | run: |
for file in ${{ steps.changed-files.outputs.deleted_files }}; do for file in ${{ steps.changed-files-specific.outputs.deleted_files }}; do
echo "$file was deleted" echo "$file was deleted"
done done
- name: Run step if all listed files above have been deleted - name: Run step if all listed files above have been deleted
if: steps.changed-files.outputs.only_deleted == 'true' if: steps.changed-files-specific.outputs.only_deleted == 'true'
run: | run: |
for file in ${{ steps.changed-files.outputs.deleted_files }}; do for file in ${{ steps.changed-files-specific.outputs.deleted_files }}; do
echo "$file was deleted" echo "$file was deleted"
done done
... ...
@@ -403,6 +403,56 @@ See [inputs](#inputs) for more information.
</details> </details>
<details>
<summary>Get all changed files between the previous tag and the current tag</summary>
```yaml
...
on:
push:
tags:
- 'v*'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Base SHA
id: get-base-sha
run: |
echo "base_sha=$(git rev-parse "$(git tag --sort=-v:refname | head -n 2 | tail -n 1)")" >> $GITHUB_OUTPUT
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
- name: Get changed files in the .github folder
id: changed-files-specific
uses: tj-actions/changed-files@v35
with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
files: .github/**
- name: Run step if any file(s) in the .github folder change
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
echo "One or more files in the .github folder has changed."
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
...
```
See [inputs](#inputs) for more information.
</details>
<details> <details>
<summary>Get all changed files for a repository located in a different path</summary> <summary>Get all changed files for a repository located in a different path</summary>
@@ -687,6 +737,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/lpulley"><img src="https://avatars.githubusercontent.com/u/7193187?v=4?s=100" width="100px;" alt="Logan Pulley"/><br /><sub><b>Logan Pulley</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=lpulley" title="Code">💻</a></td> <td align="center"><a href="https://github.com/lpulley"><img src="https://avatars.githubusercontent.com/u/7193187?v=4?s=100" width="100px;" alt="Logan Pulley"/><br /><sub><b>Logan Pulley</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=lpulley" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/kenji-miyake/"><img src="https://avatars.githubusercontent.com/u/31987104?v=4?s=100" width="100px;" alt="Kenji Miyake"/><br /><sub><b>Kenji Miyake</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=kenji-miyake" title="Code">💻</a></td> <td align="center"><a href="https://www.linkedin.com/in/kenji-miyake/"><img src="https://avatars.githubusercontent.com/u/31987104?v=4?s=100" width="100px;" alt="Kenji Miyake"/><br /><sub><b>Kenji Miyake</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=kenji-miyake" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/adonisgarciac"><img src="https://avatars.githubusercontent.com/u/71078987?v=4?s=100" width="100px;" alt="adonisgarciac"/><br /><sub><b>adonisgarciac</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/adonisgarciac"><img src="https://avatars.githubusercontent.com/u/71078987?v=4?s=100" width="100px;" alt="adonisgarciac"/><br /><sub><b>adonisgarciac</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/cfernhout"><img src="https://avatars.githubusercontent.com/u/22294606?v=4?s=100" width="100px;" alt="Chiel Fernhout"/><br /><sub><b>Chiel Fernhout</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=cfernhout" title="Documentation">📖</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@@ -89,7 +89,7 @@ inputs:
default: "50" default: "50"
since_last_remote_commit: 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." 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: true required: false
default: "false" default: "false"
write_output_files: write_output_files:
description: "Write outputs to files in the `.github/outputs` folder by default." description: "Write outputs to files in the `.github/outputs` folder by default."

View File

@@ -8,6 +8,11 @@ EXTRA_ARGS="--no-tags --prune --no-recurse-submodules"
PREVIOUS_SHA="" PREVIOUS_SHA=""
CURRENT_SHA="" CURRENT_SHA=""
DIFF="..." DIFF="..."
IS_TAG="false"
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
IS_TAG="true"
fi
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
EXTRA_ARGS="--prune --no-recurse-submodules" EXTRA_ARGS="--prune --no-recurse-submodules"
@@ -55,10 +60,11 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then
TARGET_BRANCH=$GITHUB_REFNAME TARGET_BRANCH=$GITHUB_REFNAME
CURRENT_BRANCH=$TARGET_BRANCH CURRENT_BRANCH=$TARGET_BRANCH
if [[ -f .git/shallow ]]; then
echo "Fetching remote refs..." echo "Fetching remote refs..."
# shellcheck disable=SC2086 # shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null || true
fi
echo "::debug::Getting HEAD SHA..." echo "::debug::Getting HEAD SHA..."
if [[ -n "$INPUT_UNTIL" ]]; then if [[ -n "$INPUT_UNTIL" ]]; then
@@ -102,20 +108,16 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then
PREVIOUS_SHA="" PREVIOUS_SHA=""
if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE PREVIOUS_SHA=$GITHUB_EVENT_BEFORE && exit_status=$? || exit_status=$?
else
PREVIOUS_SHA=$(git rev-list -n 1 "HEAD~1") && exit_status=$? || exit_status=$?
fi fi
else else
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH") && exit_status=$? || exit_status=$? PREVIOUS_SHA=$(git rev-list -n 1 "HEAD~1") && exit_status=$? || exit_status=$?
if [[ -z "$PREVIOUS_SHA" ]]; then
if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
fi
fi
fi fi
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
PREVIOUS_SHA=$(git rev-parse "$(git branch -r --sort=-committerdate | head -1 | xargs)") PREVIOUS_SHA=$(git rev-list -n 1 "HEAD~1") && exit_status=$? || exit_status=$?
fi fi
if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
@@ -135,6 +137,10 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then
fi fi
else else
PREVIOUS_SHA=$INPUT_BASE_SHA PREVIOUS_SHA=$INPUT_BASE_SHA
if [[ "$IS_TAG" == "true" ]]; then
TARGET_BRANCH=$(git describe --tags "$PREVIOUS_SHA")
fi
fi fi
echo "::debug::Target branch $TARGET_BRANCH..." echo "::debug::Target branch $TARGET_BRANCH..."
@@ -157,10 +163,19 @@ else
TARGET_BRANCH=$CURRENT_BRANCH TARGET_BRANCH=$CURRENT_BRANCH
fi fi
if [[ -f .git/shallow ]]; then
echo "Fetching remote refs..." echo "Fetching remote refs..."
# shellcheck disable=SC2086 # shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress origin pull/"$GITHUB_EVENT_PULL_REQUEST_NUMBER"/head:"$CURRENT_BRANCH" 1>/dev/null git fetch $EXTRA_ARGS -u --progress origin pull/"$GITHUB_EVENT_PULL_REQUEST_NUMBER"/head:"$CURRENT_BRANCH" 1>/dev/null
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" != "true" ]]; then
echo "::debug::Fetching remote target branch..."
# shellcheck disable=SC2086
git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 1>/dev/null 2>&1 || true
fi
fi
echo "::debug::Getting HEAD SHA..." echo "::debug::Getting HEAD SHA..."
if [[ -n "$INPUT_UNTIL" ]]; then if [[ -n "$INPUT_UNTIL" ]]; then
echo "::debug::Getting HEAD SHA for '$INPUT_UNTIL'..." echo "::debug::Getting HEAD SHA for '$INPUT_UNTIL'..."
@@ -197,13 +212,11 @@ else
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA
fi fi
else else
echo "::debug::Fetching remote target branch..."
# shellcheck disable=SC2086
git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 1>/dev/null 2>&1 || true
PREVIOUS_SHA=$(git merge-base "$TARGET_BRANCH" "$CURRENT_SHA") && exit_status=$? || exit_status=$? PREVIOUS_SHA=$(git merge-base "$TARGET_BRANCH" "$CURRENT_SHA") && exit_status=$? || exit_status=$?
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
PREVIOUS_SHA=$(git rev-parse origin/"$TARGET_BRANCH") && exit_status=$? || exit_status=$?
fi
fi fi
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
@@ -216,13 +229,7 @@ else
fi fi
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
PREVIOUS_SHA=$(git rev-parse "$TARGET_BRANCH") && exit_status=$? || exit_status=$?
DIFF=".." DIFF=".."
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
echo "::error::Unable find a diff between $PREVIOUS_SHA and $CURRENT_SHA"
exit 1
fi
fi fi
echo "::debug::Target branch: $TARGET_BRANCH" echo "::debug::Target branch: $TARGET_BRANCH"
@@ -236,6 +243,11 @@ else
echo "::error::Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." echo "::error::Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH."
exit 1 exit 1
fi fi
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
echo "::error::Unable to determine a difference between $PREVIOUS_SHA$DIFF$CURRENT_SHA"
exit 1
fi
fi fi
if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" && "$INITIAL_COMMIT" == "false" ]]; then if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" && "$INITIAL_COMMIT" == "false" ]]; then

View File

@@ -52,13 +52,13 @@ function get_dirname_max_depth() {
} }
function json_output() { function json_output() {
JQ_ARGS="-R" JQ_ARGS="-sR"
if [[ "$INPUT_JSON_RAW_FORMAT" == "true" ]]; then if [[ "$INPUT_JSON_RAW_FORMAT" == "true" ]]; then
JQ_ARGS="$JQ_ARGS -r" JQ_ARGS="$JQ_ARGS -r"
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
jq $JQ_ARGS 'split("\n") | @json' | tr -s / jq $JQ_ARGS 'split("\n") | map(select(. != "")) | @json' | sed -r 's/^"|"$//g' | tr -s /
} }
function get_diff() { function get_diff() {
@@ -147,7 +147,7 @@ fi
echo "Retrieving changes between $INPUT_PREVIOUS_SHA ($INPUT_TARGET_BRANCH) → $INPUT_CURRENT_SHA ($INPUT_CURRENT_BRANCH)" echo "Retrieving changes between $INPUT_PREVIOUS_SHA ($INPUT_TARGET_BRANCH) → $INPUT_CURRENT_SHA ($INPUT_CURRENT_BRANCH)"
if [[ "$INPUT_HAS_CUSTOM_PATTERNS" == "false" ]]; then if [[ "$INPUT_HAS_CUSTOM_PATTERNS" == "false" || -z "$INPUT_FILES_PATTERN_FILE" ]]; then
if [[ "$INPUT_JSON" == "false" ]]; then if [[ "$INPUT_JSON" == "false" ]]; then
if [[ "$INPUT_DIR_NAMES" == "true" ]]; then if [[ "$INPUT_DIR_NAMES" == "true" ]]; then
ADDED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" A | xargs -I {} dirname {} | get_dirname_max_depth | uniq | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}') ADDED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" A | xargs -I {} dirname {} | get_dirname_max_depth | uniq | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')

View File

@@ -1 +1 @@
This is a test file This is a test file.

View File

@@ -1 +1 @@
This is a test file This is a test file.

View File

@@ -1 +1 @@
Lorem ipsum dolor sit amet, consectetur adip eget, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.