Compare commits

...

55 Commits
v39 ... v39.1.1

Author SHA1 Message Date
Tonye Jack
a21a533a0c Update test.yml 2023-09-19 14:21:54 -06:00
Tonye Jack
eeb169a9f9 chore: add codacy config (#1590)
Co-authored-by: GitHub Action <action@github.com>
2023-09-19 14:19:15 -06:00
Arthur
951140b94a fix: changed_keys and modified_keys output to handle json and escape_json inputs (#1585)
Co-authored-by: Arthur Volant <arthur.volant@adevinta.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-09-19 19:18:22 +00:00
Tonye Jack
dbf0700c7a fix: error with test (#1589) 2023-09-19 12:10:14 -06:00
tj-actions[bot]
dacbaebcaf Updated README.md (#1588)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-09-19 16:58:27 +00:00
allcontributors[bot]
36ab2fe9c2 docs: add V0lantis as a contributor for bug (#1587)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-09-19 10:39:08 -06:00
Tonye Jack
7e3a4bac80 chore: Update test.yml (#1586) 2023-09-19 16:09:34 +00:00
Tonye Jack
dcbe9805f4 chore: move variable declaration (#1584)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-09-18 23:37:47 +00:00
tj-actions[bot]
fd73c1248c Upgraded to v39.1.0 (#1583)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-09-18 20:39:02 +00:00
tj-actions[bot]
8e79ba7ab9 Updated README.md (#1582)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
2023-09-18 14:22:58 -06:00
Tonye Jack
5db7b578d5 feat: add support for returning YAML keys for paths that have changed (#1581)
Co-authored-by: GitHub Action <action@github.com>
2023-09-18 20:17:46 +00:00
renovate[bot]
a17e8c5252 chore(deps): update typescript-eslint monorepo to v6.7.2 2023-09-18 19:14:08 +00:00
renovate[bot]
d1e9506b19 chore(deps): lock file maintenance 2023-09-18 02:01:10 +00:00
tj-actions[bot]
1fdfe0928a Upgraded to v39.0.3 (#1577)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-09-17 21:34:54 +00:00
Tonye Jack
76c4d81a6a chore: cleanup imports (#1576) 2023-09-17 03:16:01 +00:00
Tonye Jack
d8904df6c5 chore: refactor function (#1572)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-09-16 11:44:37 +00:00
renovate[bot]
662c03ea61 chore(deps): update dependency @types/node to v20.6.2 2023-09-16 09:06:38 +00:00
renovate[bot]
c8b7da7226 chore(deps): update dependency eslint-plugin-jest to v27.4.0 2023-09-16 00:28:53 +00:00
renovate[bot]
249c1698c5 chore(deps): update dependency @types/jest to v29.5.5 2023-09-15 22:09:24 +00:00
renovate[bot]
17352b2176 chore(deps): update dependency @types/node to v20.6.1 2023-09-15 08:58:26 +00:00
tj-actions[bot]
e8e6614779 Updated README.md (#1570)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-09-14 22:07:53 -06:00
Tonye Jack
ad4b06d999 Update README.md 2023-09-14 21:59:38 -06:00
Tonye Jack
b1a34eb336 Update README.md 2023-09-14 21:58:35 -06:00
Tonye Jack
d9a6ccb099 chore: update README.md (#1569) 2023-09-14 17:38:21 +00:00
renovate[bot]
090eb05f17 chore(deps): update dependency @types/uuid to v9.0.4 2023-09-14 15:58:41 +00:00
tj-actions[bot]
690bef673a Updated README.md (#1566)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
2023-09-13 17:36:28 +00:00
Tonye Jack
fb8d2c9c29 chore: update input description (#1565) 2023-09-13 17:25:26 +00:00
Tonye Jack
bb3b39cd33 Update README.md 2023-09-13 07:45:12 -06:00
renovate[bot]
001f56257c chore(deps): update dependency jest to v29.7.0 2023-09-12 09:59:39 +00:00
tj-actions[bot]
57245a9721 Upgraded to v39.0.2 (#1563)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-09-12 02:19:34 +00:00
renovate[bot]
6ee9cdc581 chore(deps): update typescript-eslint monorepo to v6.7.0 2023-09-11 19:21:13 +00:00
GitHub Action
dc40835d4d Added missing changes and modified dist assets. 2023-09-11 17:08:01 +00:00
renovate[bot]
7e3122dc95 fix(deps): update dependency @actions/core to v1.10.1 2023-09-11 17:08:01 +00:00
renovate[bot]
073479583b chore(deps): lock file maintenance 2023-09-09 12:28:32 +00:00
renovate[bot]
d76ddeeeaa chore(deps): lock file maintenance 2023-09-09 03:38:50 +00:00
tj-actions[bot]
7cdc56dd7a Upgraded to v39.0.1 (#1557)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-09-09 03:25:27 +00:00
Tonye Jack
246636f5fa fix: bug returning empty output for pull request close event (#1556)
Co-authored-by: GitHub Action <action@github.com>
2023-09-09 03:02:46 +00:00
Tonye Jack
fe0fb71961 Update README.md 2023-09-08 20:43:21 -06:00
Tonye Jack
e60a7a9173 Update README.md 2023-09-08 20:41:04 -06:00
Tonye Jack
81bb5d8954 chore: update check (#1555)
Co-authored-by: GitHub Action <action@github.com>
2023-09-09 01:39:42 +00:00
Tonye Jack
523e8b6f11 fix: raise error when the previous sha cannot be determined and since_last_remote_commit is true (#1554)
Co-authored-by: GitHub Action <action@github.com>
2023-09-08 19:18:37 -06:00
renovate[bot]
4a0a3c4aa5 chore(deps): update dependency eslint to v8.49.0 2023-09-08 22:14:25 +00:00
renovate[bot]
9dfd3f686b chore(deps): update dependency @types/node to v20.6.0 2023-09-08 21:58:21 +00:00
Tonye Jack
796ac2d08f fix: raise errors when unable to locate the previous commit in local history (#1551)
Co-authored-by: GitHub Action <action@github.com>
2023-09-08 18:31:25 +00:00
tj-actions[bot]
534262e0b2 Updated README.md (#1548)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
2023-09-08 12:12:32 +00:00
Tonye Jack
673189f77b chore: Update docs to site example (#1547) 2023-09-08 12:00:24 +00:00
tj-actions[bot]
89cb9ea919 Updated README.md (#1546)
Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com>
2023-09-07 15:01:23 +00:00
renovate[bot]
7113206187 chore(deps): lock file maintenance 2023-09-07 14:48:08 +00:00
Tonye Jack
926a3fd777 chore: add warning on valid output keys (#1544) 2023-09-07 14:27:55 +00:00
renovate[bot]
de23f62d1e chore(deps): update reviewdog/action-shellcheck action to v1.19 2023-09-06 23:38:08 +00:00
renovate[bot]
afbabc4364 chore(deps): update dependency @vercel/ncc to ^0.38.0 2023-09-06 20:49:21 +00:00
renovate[bot]
eda0811ed2 chore(deps): update tj-actions/eslint-changed-files action to v21 (#1539)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-06 04:39:25 +00:00
renovate[bot]
bda67fc879 chore(deps): update dependency @types/lodash to v4.14.198 2023-09-05 22:15:21 +00:00
Tonye Jack
5a5d398e5f chore: Update sync-release-version.yml (#1537)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-09-04 22:11:32 +00:00
tj-actions[bot]
f699bde5ad Upgraded to v39 (#1536)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-09-04 21:46:56 +00:00
16 changed files with 1197 additions and 850 deletions

View File

@@ -187,6 +187,16 @@
"contributions": [
"doc"
]
},
{
"login": "V0lantis",
"name": "Arthur",
"avatar_url": "https://avatars.githubusercontent.com/u/37664438?v=4",
"profile": "https://arthurvolant.com",
"contributions": [
"bug",
"code"
]
}
],
"contributorsPerLine": 7,
@@ -195,5 +205,6 @@
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true,
"commitConvention": "angular"
"commitConvention": "angular",
"commitType": "docs"
}

4
.codacy.yml Normal file
View File

@@ -0,0 +1,4 @@
---
exclude_paths:
- "*.md"
- "dist/**"

View File

@@ -26,6 +26,7 @@ jobs:
id: sync-release-package-version
with:
pattern: '"version": "'
strip_prefix: "v"
paths: |
package.json
- name: Run git-cliff

View File

@@ -37,16 +37,16 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
- name: shellcheck
uses: reviewdog/action-shellcheck@v1.18
uses: reviewdog/action-shellcheck@v1.19
build:
runs-on: ubuntu-latest
outputs:
files_changed: ${{ steps.changed_files.outputs.files_changed }}
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
@@ -68,7 +68,7 @@ jobs:
yarn install
- name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v20
uses: tj-actions/eslint-changed-files@v21
if: github.event_name == 'pull_request'
with:
token: ${{ secrets.PAT_TOKEN }}
@@ -123,7 +123,7 @@ jobs:
if: needs.build.outputs.files_changed != 'true'
steps:
- name: Checkout into dir1
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
@@ -163,7 +163,7 @@ jobs:
path: dir2/dist
- name: Checkout into dir2
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
@@ -198,7 +198,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
@@ -256,7 +256,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
@@ -294,7 +294,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
@@ -332,7 +332,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: ${{ matrix.fetch-depth }}
@@ -364,7 +364,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
@@ -396,7 +396,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
fetch-depth: ${{ matrix.fetch-depth }}
persist-credentials: false
@@ -425,7 +425,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
- name: Download build assets
uses: actions/download-artifact@v3
@@ -479,7 +479,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
- name: Download build assets
uses: actions/download-artifact@v3
@@ -534,7 +534,7 @@ jobs:
pull-requests: read
steps:
- name: Checkout into dir1
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
@@ -570,7 +570,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
@@ -613,7 +613,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
@@ -665,7 +665,7 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
@@ -765,6 +765,12 @@ jobs:
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-with-files-yaml.outputs.test_deleted_files }}"
exit 1
- name: Verify that the modified_keys is correct
if: "!contains(steps.changed-files-recover-deleted-files-with-files-yaml.outputs.modified_keys, 'test')"
run: |
echo "Expected: (test) got ${{ steps.changed-files-recover-deleted-files-with-files-yaml.outputs.modified_keys }}"
exit 1
- name: Verify that test/test deleted.txt is restored
run: |
if [ ! -f "test/test deleted.txt" ]; then
@@ -805,6 +811,56 @@ jobs:
else
cat "deleted_files/test/test deleted.txt"
fi
test-since-last-remote-commit:
name: Test changed-files since last remote commit
runs-on: ubuntu-latest
needs: build
if: needs.build.outputs.files_changed != 'true'
strategy:
fail-fast: false
max-parallel: 4
matrix:
fetch-depth: [0, 1, 2]
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: build-assets
- name: Run changed-files with since_last_remote_commit
id: changed-files-since-last-remote-commit
continue-on-error: true
uses: ./
with:
since_last_remote_commit: true
- name: Verify failed
if: steps.changed-files-since-last-remote-commit.outcome != 'failure' && matrix.fetch-depth == 1 && github.event.action == 'closed' && github.event_name == 'pull_request'
run: |
echo "Expected: (failure) got ${{ steps.changed-files-since-last-remote-commit.outcome }}"
exit 1
- name: Verify succeeded
if: steps.changed-files-since-last-remote-commit.outcome != 'success' && matrix.fetch-depth != 1
run: |
echo "Expected: (success) got ${{ steps.changed-files-since-last-remote-commit.outcome }}"
exit 1
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-since-last-remote-commit.outputs) }}'
shell:
bash
test:
name: Test changed-files
@@ -820,7 +876,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@v4
with:
submodules: true
repository: ${{ github.event.pull_request.head.repo.full_name }}
@@ -841,16 +897,6 @@ jobs:
echo '${{ toJSON(steps.changed-files.outputs) }}'
shell:
bash
- name: Run changed-files with since_last_remote_commit
id: changed-files-since-last-remote-commit
uses: ./
with:
since_last_remote_commit: true
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-since-last-remote-commit.outputs) }}'
shell:
bash
- name: Run changed-files with dir name
id: changed-files-dir-name
uses: ./

View File

@@ -1,5 +1,141 @@
# Changelog
# [39.1.0](https://github.com/tj-actions/changed-files/compare/v39.0.3...v39.1.0) - (2023-09-18)
## <!-- 0 -->🚀 Features
- Add support for returning YAML keys for paths that have changed ([#1581](https://github.com/tj-actions/changed-files/issues/1581)) ([5db7b57](https://github.com/tj-actions/changed-files/commit/5db7b578d50867ab5781bf9d867e7650b5b39fc4)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1582](https://github.com/tj-actions/changed-files/issues/1582))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([8e79ba7](https://github.com/tj-actions/changed-files/commit/8e79ba7ab9fee9984275219aeb2c8db47bcb8a2d)) - (tj-actions[bot])
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update typescript-eslint monorepo to v6.7.2 ([a17e8c5](https://github.com/tj-actions/changed-files/commit/a17e8c5252f6c9982b161714c528708a7f445479)) - (renovate[bot])
- **deps:** Lock file maintenance ([d1e9506](https://github.com/tj-actions/changed-files/commit/d1e9506b19d9c3a4053191d616b1ac09de1dfa55)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v39.0.3 ([#1577](https://github.com/tj-actions/changed-files/issues/1577))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([1fdfe09](https://github.com/tj-actions/changed-files/commit/1fdfe0928a9a55323f0d333ecf6ccfca8c6d73c9)) - (tj-actions[bot])
# [39.0.3](https://github.com/tj-actions/changed-files/compare/v39.0.2...v39.0.3) - (2023-09-17)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1570](https://github.com/tj-actions/changed-files/issues/1570))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([e8e6614](https://github.com/tj-actions/changed-files/commit/e8e66147790920052eb3032cb5a62c70572bae22)) - (tj-actions[bot])
- Update README.md ([ad4b06d](https://github.com/tj-actions/changed-files/commit/ad4b06d99998aabe50aa36b86f0867357026a7e2)) - (Tonye Jack)
- Update README.md ([b1a34eb](https://github.com/tj-actions/changed-files/commit/b1a34eb336292345947ec693f02ef5fb59954683)) - (Tonye Jack)
- Updated README.md ([#1566](https://github.com/tj-actions/changed-files/issues/1566))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([690bef6](https://github.com/tj-actions/changed-files/commit/690bef673ae8df0db1deff98f4c33c8f651ce3b9)) - (tj-actions[bot])
- Update README.md ([bb3b39c](https://github.com/tj-actions/changed-files/commit/bb3b39cd33dab0e736e0f00b67222c3edaaea664)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Cleanup imports ([#1576](https://github.com/tj-actions/changed-files/issues/1576)) ([76c4d81](https://github.com/tj-actions/changed-files/commit/76c4d81a6acd339b55bd7407a016981c853eb702)) - (Tonye Jack)
- Refactor function ([#1572](https://github.com/tj-actions/changed-files/issues/1572)) ([d8904df](https://github.com/tj-actions/changed-files/commit/d8904df6c55e24ee0b072a93387f64ab19b03302)) - (Tonye Jack)
- **deps:** Update dependency @types/node to v20.6.2 ([662c03e](https://github.com/tj-actions/changed-files/commit/662c03ea61a144e0bb71991d27928fe08897109f)) - (renovate[bot])
- **deps:** Update dependency eslint-plugin-jest to v27.4.0 ([c8b7da7](https://github.com/tj-actions/changed-files/commit/c8b7da7226d05c69f882473d9bc05af8475f28fc)) - (renovate[bot])
- **deps:** Update dependency @types/jest to v29.5.5 ([249c169](https://github.com/tj-actions/changed-files/commit/249c1698c5b04bfa024f0af7fa876952cc638660)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.6.1 ([17352b2](https://github.com/tj-actions/changed-files/commit/17352b21768e018a02c594a8c7b151d0002e5d73)) - (renovate[bot])
- Update README.md ([#1569](https://github.com/tj-actions/changed-files/issues/1569)) ([d9a6ccb](https://github.com/tj-actions/changed-files/commit/d9a6ccb099927ca383d6bf06d0d44e3a4cc03dd9)) - (Tonye Jack)
- **deps:** Update dependency @types/uuid to v9.0.4 ([090eb05](https://github.com/tj-actions/changed-files/commit/090eb05f17c92a8e9b30d65ca4abe71ea35d8671)) - (renovate[bot])
- Update input description ([#1565](https://github.com/tj-actions/changed-files/issues/1565)) ([fb8d2c9](https://github.com/tj-actions/changed-files/commit/fb8d2c9c29d888bc338bd0b5cd23a78f8fd04baa)) - (Tonye Jack)
- **deps:** Update dependency jest to v29.7.0 ([001f562](https://github.com/tj-actions/changed-files/commit/001f56257c66815ba8267ded5207cc6feeb3c4fd)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v39.0.2 ([#1563](https://github.com/tj-actions/changed-files/issues/1563))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([57245a9](https://github.com/tj-actions/changed-files/commit/57245a97217e7a73240a81d75f5b3f4d9dc7fb04)) - (tj-actions[bot])
# [39.0.2](https://github.com/tj-actions/changed-files/compare/v39.0.1...v39.0.2) - (2023-09-11)
## <!-- 1 -->🐛 Bug Fixes
- **deps:** Update dependency @actions/core to v1.10.1 ([7e3122d](https://github.com/tj-actions/changed-files/commit/7e3122dc950f53aecf77675b13eb8549fc50702d)) - (renovate[bot])
## <!-- 16 --> Add
- Added missing changes and modified dist assets.
([dc40835](https://github.com/tj-actions/changed-files/commit/dc40835d4da682fdd0d708a18736c67f61dd30bd)) - (GitHub Action)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update typescript-eslint monorepo to v6.7.0 ([6ee9cdc](https://github.com/tj-actions/changed-files/commit/6ee9cdc5816333acda68e01cf12eedc619e28316)) - (renovate[bot])
- **deps:** Lock file maintenance ([0734795](https://github.com/tj-actions/changed-files/commit/073479583b8aa435de99bca59cf0f1d7c9ca60f1)) - (renovate[bot])
- **deps:** Lock file maintenance ([d76ddee](https://github.com/tj-actions/changed-files/commit/d76ddeeeaafef4ed076ba691b79b2ce022583e29)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v39.0.1 ([#1557](https://github.com/tj-actions/changed-files/issues/1557))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([7cdc56d](https://github.com/tj-actions/changed-files/commit/7cdc56dd7a1e035be75e46b4023543b68e58a0ac)) - (tj-actions[bot])
# [39.0.1](https://github.com/tj-actions/changed-files/compare/v39.0.0...v39.0.1) - (2023-09-09)
## <!-- 1 -->🐛 Bug Fixes
- Bug returning empty output for pull request close event ([#1556](https://github.com/tj-actions/changed-files/issues/1556)) ([246636f](https://github.com/tj-actions/changed-files/commit/246636f5fa148b5ad8e65ca4c57b18af3123e5f6)) - (Tonye Jack)
- Raise error when the previous sha cannot be determined and since_last_remote_commit is true ([#1554](https://github.com/tj-actions/changed-files/issues/1554)) ([523e8b6](https://github.com/tj-actions/changed-files/commit/523e8b6f11215082522b8e62c274b358f64422fa)) - (Tonye Jack)
- Raise errors when unable to locate the previous commit in local history ([#1551](https://github.com/tj-actions/changed-files/issues/1551)) ([796ac2d](https://github.com/tj-actions/changed-files/commit/796ac2d08f9344cd0602d9bfe4a0393cdfda6ff7)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update README.md ([fe0fb71](https://github.com/tj-actions/changed-files/commit/fe0fb71961c75e134247bf312ee383e33bc06156)) - (Tonye Jack)
- Update README.md ([e60a7a9](https://github.com/tj-actions/changed-files/commit/e60a7a9173bef6e97132058dd044b946b197f9b6)) - (Tonye Jack)
- Updated README.md ([#1548](https://github.com/tj-actions/changed-files/issues/1548))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([534262e](https://github.com/tj-actions/changed-files/commit/534262e0b262de5c56969bb66d47df047cba50ff)) - (tj-actions[bot])
- Updated README.md ([#1546](https://github.com/tj-actions/changed-files/issues/1546))
Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com> ([89cb9ea](https://github.com/tj-actions/changed-files/commit/89cb9ea919269ab73a63fbafb7aed58174e5e411)) - (tj-actions[bot])
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update check ([#1555](https://github.com/tj-actions/changed-files/issues/1555)) ([81bb5d8](https://github.com/tj-actions/changed-files/commit/81bb5d895445a08f2e12fa348b88cd6aea2e94c4)) - (Tonye Jack)
- **deps:** Update dependency eslint to v8.49.0 ([4a0a3c4](https://github.com/tj-actions/changed-files/commit/4a0a3c4aa538c8f49477d4306b29b349031685d8)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.6.0 ([9dfd3f6](https://github.com/tj-actions/changed-files/commit/9dfd3f686b90dc76c07e414be407ec7d43bf9e7f)) - (renovate[bot])
- Update docs to site example ([#1547](https://github.com/tj-actions/changed-files/issues/1547)) ([673189f](https://github.com/tj-actions/changed-files/commit/673189f77bde91f43ac9301ef8ebcc4ce105358e)) - (Tonye Jack)
- **deps:** Lock file maintenance ([7113206](https://github.com/tj-actions/changed-files/commit/711320618723bac63c2926a9710f091acbbe736e)) - (renovate[bot])
- Add warning on valid output keys ([#1544](https://github.com/tj-actions/changed-files/issues/1544)) ([926a3fd](https://github.com/tj-actions/changed-files/commit/926a3fd7779d0f54baac89dbb55d6302825ae6f9)) - (Tonye Jack)
- **deps:** Update reviewdog/action-shellcheck action to v1.19 ([de23f62](https://github.com/tj-actions/changed-files/commit/de23f62d1eecad9116a04783c7f26d8885f0733b)) - (renovate[bot])
- **deps:** Update dependency @vercel/ncc to ^0.38.0 ([afbabc4](https://github.com/tj-actions/changed-files/commit/afbabc4364fff08a6b98f3d686abae4217a7123f)) - (renovate[bot])
- **deps:** Update tj-actions/eslint-changed-files action to v21 ([#1539](https://github.com/tj-actions/changed-files/issues/1539)) ([eda0811](https://github.com/tj-actions/changed-files/commit/eda0811ed2364c6ea09da7989ab0e572f2f5fd61)) - (renovate[bot])
- **deps:** Update dependency @types/lodash to v4.14.198 ([bda67fc](https://github.com/tj-actions/changed-files/commit/bda67fc879fa09a72253e0ed6b5cffeac9f14f44)) - (renovate[bot])
- Update sync-release-version.yml ([#1537](https://github.com/tj-actions/changed-files/issues/1537)) ([5a5d398](https://github.com/tj-actions/changed-files/commit/5a5d398e5fb9b4d2776feb62de64e396ecb74de8)) - (Tonye Jack)
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v39 ([#1536](https://github.com/tj-actions/changed-files/issues/1536))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([f699bde](https://github.com/tj-actions/changed-files/commit/f699bde5ad428fbc4281b9ca6865153f4b1e7a55)) - (tj-actions[bot])
# [39.0.0](https://github.com/tj-actions/changed-files/compare/v38.2.2...v39.0.0) - (2023-09-04)
## <!-- 26 -->🔄 Update
- Update README.md ([632c84d](https://github.com/tj-actions/changed-files/commit/632c84dcca8d5cbc35825d0cddfd0c2870886adc)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Lock file maintenance ([d68a666](https://github.com/tj-actions/changed-files/commit/d68a6666bebcffa866de06e2468374eda79f6187)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Nodejs to v20 ([#1535](https://github.com/tj-actions/changed-files/issues/1535)) ([48566bb](https://github.com/tj-actions/changed-files/commit/48566bbcc22ceb7c5809ebdd27377309f2c3de8c)) - (Tonye Jack)
- Upgraded to v38.2.2 ([#1533](https://github.com/tj-actions/changed-files/issues/1533))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([07660d5](https://github.com/tj-actions/changed-files/commit/07660d51a9f53df8dfaa952899fe3170cc8d7a1d)) - (tj-actions[bot])
# [38.2.2](https://github.com/tj-actions/changed-files/compare/v38.2.1...v38.2.2) - (2023-09-04)
## <!-- 1 -->🐛 Bug Fixes

View File

@@ -9,7 +9,7 @@
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-21-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
@@ -69,8 +69,8 @@ Effortlessly track all changed files and directories relative to a target branch
* Supports brace expansion.
* Supports negation.
* Uses [YAML](https://yaml.org/) syntax for specifying patterns.
* Supports [YAML anchors & aliases](https://www.educative.io/blog/advanced-yaml-syntax-cheatsheet#anchors).
* Supports [YAML multi-line strings](https://learnxinyminutes.com/docs/yaml/).
* Supports [YAML anchors & aliases](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml#L8-L12).
* Supports [YAML multi-line strings](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml#L13-L16).
And many more...
@@ -88,6 +88,8 @@ Visit the [discussions for more information](https://github.com/tj-actions/chang
### On `pull_request` 🔀
Detect changes to all files in a Pull request relative to the target branch or since the last pushed commit.
#### Using local .git history 📁
```yaml
@@ -113,7 +115,7 @@ jobs:
# Example 1
- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
files_yaml: |
doc:
@@ -143,7 +145,7 @@ jobs:
# Example 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with:
@@ -158,7 +160,7 @@ jobs:
# Example 3
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
files_ignore: docs/static.js
@@ -198,7 +200,7 @@ jobs:
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
- name: List all changed files
run: |
@@ -209,6 +211,8 @@ jobs:
### On `push` ⬆️
Detect changes to files made since the last pushed commit.
```yaml
name: CI
@@ -255,10 +259,9 @@ jobs:
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
# Example 1
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
@@ -267,11 +270,6 @@ jobs:
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
# Example 2: See above
...
# Example 3: See above
...
```
@@ -303,6 +301,7 @@ Support this project with a :star:
> **Warning**
>
> * When using `files_yaml*` inputs ensure all outputs are prefixed by the key `test_{...}` e.g. `test_added_files`, `test_any_changed`
> * All keys must start with a letter or \_ and contain only alphanumeric characters, -, or \_.
## Outputs 📤
@@ -320,23 +319,25 @@ Support this project with a :star:
| <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` |
| <a name="output_all_old_new_renamed_files"></a>[all\_old\_new\_renamed\_files](#output_all_old_new_renamed_files) | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
| <a name="output_all_old_new_renamed_files_count"></a>[all\_old\_new\_renamed\_files\_count](#output_all_old_new_renamed_files_count) | string | Returns the number of `all_old_new_renamed_files` |
| <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has changed. i.e. <br>*using a combination of all added, copied, modified and renamed files (ACMR)*. |
| <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has changed. i.e. <br>*includes a combination of all added, copied, modified and renamed files (ACMR)*. |
| <a name="output_any_deleted"></a>[any\_deleted](#output_any_deleted) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been deleted. <br>(D) |
| <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been modified. <br>i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
| <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been modified. <br>i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
| <a name="output_changed_keys"></a>[changed\_keys](#output_changed_keys) | string | Returns all changed YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)* |
| <a name="output_copied_files"></a>[copied\_files](#output_copied_files) | string | Returns only files that are <br>Copied (C). |
| <a name="output_copied_files_count"></a>[copied\_files\_count](#output_copied_files_count) | string | Returns the number of `copied_files` |
| <a name="output_deleted_files"></a>[deleted\_files](#output_deleted_files) | string | Returns only files that are <br>Deleted (D). |
| <a name="output_deleted_files_count"></a>[deleted\_files\_count](#output_deleted_files_count) | string | Returns the number of `deleted_files` |
| <a name="output_modified_files"></a>[modified\_files](#output_modified_files) | string | Returns only files that are <br>Modified (M). |
| <a name="output_modified_files_count"></a>[modified\_files\_count](#output_modified_files_count) | string | Returns the number of `modified_files` |
| <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
| <a name="output_modified_keys"></a>[modified\_keys](#output_modified_keys) | string | Returns all modified YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)* |
| <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
| <a name="output_only_deleted"></a>[only\_deleted](#output_only_deleted) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been deleted. (D) |
| <a name="output_only_modified"></a>[only\_modified](#output_only_modified) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been modified. (ACMRD). |
| <a name="output_other_changed_files"></a>[other\_changed\_files](#output_other_changed_files) | string | Returns all other changed files <br>not listed in the files <br>input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
| <a name="output_other_changed_files"></a>[other\_changed\_files](#output_other_changed_files) | string | Returns all other changed files <br>not listed in the files <br>input i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
| <a name="output_other_changed_files_count"></a>[other\_changed\_files\_count](#output_other_changed_files_count) | string | Returns the number of `other_changed_files` |
| <a name="output_other_deleted_files"></a>[other\_deleted\_files](#output_other_deleted_files) | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* |
| <a name="output_other_deleted_files_count"></a>[other\_deleted\_files\_count](#output_other_deleted_files_count) | string | Returns the number of `other_deleted_files` |
| <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
| <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
| <a name="output_other_modified_files_count"></a>[other\_modified\_files\_count](#output_other_modified_files_count) | string | Returns the number of `other_modified_files` |
| <a name="output_renamed_files"></a>[renamed\_files](#output_renamed_files) | string | Returns only files that are <br>Renamed (R). |
| <a name="output_renamed_files_count"></a>[renamed\_files\_count](#output_renamed_files_count) | string | Returns the number of `renamed_files` |
@@ -383,7 +384,7 @@ Support this project with a :star:
| <a name="input_files_yaml_from_source_file"></a>[files\_yaml\_from\_source\_file](#input_files_yaml_from_source_file) | string | false | | Source file(s) used to populate <br>the `files_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
| <a name="input_files_yaml_from_source_file_separator"></a>[files\_yaml\_from\_source\_file\_separator](#input_files_yaml_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` input |
| <a name="input_include_all_old_new_renamed_files"></a>[include\_all\_old\_new\_renamed\_files](#input_include_all_old_new_renamed_files) | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this <br>can generate a large output <br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
| <a name="input_json"></a>[json](#input_json) | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. |
| <a name="input_json"></a>[json](#input_json) | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. [Example](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml) |
| <a name="input_old_new_files_separator"></a>[old\_new\_files\_separator](#input_old_new_files_separator) | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
| <a name="input_old_new_separator"></a>[old\_new\_separator](#input_old_new_separator) | string | false | `","` | Split character for old and <br>new filename pairs. |
| <a name="input_output_dir"></a>[output\_dir](#input_output_dir) | string | false | `".github/outputs"` | Directory to store output files. |
@@ -428,7 +429,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
...
```
@@ -441,7 +442,7 @@ The format of the version string is as follows:
...
- name: Get all changed files and use a comma separator in the output
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
separator: ","
...
@@ -458,7 +459,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
- name: List all added files
run: |
@@ -479,7 +480,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
- name: Run a step if my-file.txt was modified
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
@@ -539,7 +540,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
files: |
my-file.txt
@@ -562,7 +563,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
files: |
my-file.txt
@@ -609,7 +610,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files using a source file or list of file(s) to populate to files input.
id: changed-files-specific-source-file
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
files_from_source_file: test/changed-files-list.txt
...
@@ -626,7 +627,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using 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@v38
uses: tj-actions/changed-files@v39
with:
files_from_source_file: |
test/changed-files-list.txt
@@ -647,7 +648,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different SHA
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
sha: ${{ github.event.pull_request.head.sha }}
...
@@ -664,7 +665,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different base SHA
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ github.event.pull_request.base.sha }}
...
@@ -696,11 +697,11 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
- name: Get changed files in the .github folder
id: changed-files-specific
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
files: .github/**
@@ -730,7 +731,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with defaults in dir1
id: changed-files-for-dir1
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
path: dir1
@@ -753,7 +754,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with quotepath disabled
id: changed-files-quotepath
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
quotepath: "false"
@@ -792,7 +793,7 @@ See [inputs](#inputs) for more information.
- 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@v38
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
...
@@ -819,7 +820,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with the commit of the last successful test workflow run on the main branch
id: changed-files-base-sha-pull-request
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
...
@@ -845,7 +846,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with dir_names
id: changed-files-dir-names
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
dir_names: "true"
...
@@ -862,7 +863,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with JSON output
id: changed-files-json
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
json: "true"
...
@@ -879,13 +880,13 @@ See [inputs](#inputs) for more information.
...
- name: Get changed-files since 2022-08-19
id: changed-files-since
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
since: "2022-08-19"
- name: Get changed-files until 2022-08-20
id: changed-files-until
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v39
with:
until: "2022-08-20"
...
@@ -1010,6 +1011,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><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" valign="top" width="14.28%"><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>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/albertoperdomo2"><img src="https://avatars.githubusercontent.com/u/62241095?v=4?s=100" width="100px;" alt="Alberto Perdomo"/><br /><sub><b>Alberto Perdomo</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=albertoperdomo2" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://arthurvolant.com"><img src="https://avatars.githubusercontent.com/u/37664438?v=4?s=100" width="100px;" alt="Arthur"/><br /><sub><b>Arthur</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/issues?q=author%3AV0lantis" title="Bug reports">🐛</a> <a href="https://github.com/tj-actions/changed-files/commits?author=V0lantis" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -121,7 +121,7 @@ inputs:
default: "\n"
required: false
json:
description: "Output list of changed files in a JSON formatted string which can be used for matrix jobs."
description: "Output list of changed files in a JSON formatted string which can be used for matrix jobs. [Example](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml)"
required: false
default: "false"
escape_json:
@@ -243,11 +243,11 @@ outputs:
all_changed_files_count:
description: "Returns the number of `all_changed_files`"
any_changed:
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
only_changed:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
other_changed_files:
description: "Returns all other changed files not listed in the files input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
description: "Returns all other changed files not listed in the files input i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
other_changed_files_count:
description: "Returns the number of `other_changed_files`"
all_modified_files:
@@ -255,11 +255,11 @@ outputs:
all_modified_files_count:
description: "Returns the number of `all_modified_files`"
any_modified:
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
only_modified:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)."
other_modified_files:
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
other_modified_files_count:
description: "Returns the number of `other_modified_files`"
any_deleted:
@@ -270,6 +270,10 @@ outputs:
description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
other_deleted_files_count:
description: "Returns the number of `other_deleted_files`"
modified_keys:
description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)*"
changed_keys:
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)*"
runs:
using: 'node20'

321
dist/index.js generated vendored
View File

@@ -49,13 +49,84 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getChangedFilesFromGithubAPI = exports.getAllChangeTypeFiles = exports.getChangeTypeFiles = exports.getAllDiffFiles = exports.ChangeTypeEnum = exports.getRenamedFiles = void 0;
exports.getChangedFilesFromGithubAPI = exports.getAllChangeTypeFiles = exports.getChangeTypeFiles = exports.getAllDiffFiles = exports.ChangeTypeEnum = exports.getRenamedFiles = exports.processChangedFiles = void 0;
const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438));
const flatten_1 = __importDefault(__nccwpck_require__(2394));
const micromatch_1 = __importDefault(__nccwpck_require__(6228));
const path = __importStar(__nccwpck_require__(1017));
const changedFilesOutput_1 = __nccwpck_require__(8930);
const utils_1 = __nccwpck_require__(918);
const processChangedFiles = ({ filePatterns, allDiffFiles, inputs, yamlFilePatterns }) => __awaiter(void 0, void 0, void 0, function* () {
if (filePatterns.length > 0) {
core.startGroup('changed-files-patterns');
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
allDiffFiles,
filePatterns
});
core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`);
yield (0, changedFilesOutput_1.setOutputsAndGetModifiedAndChangedFilesStatus)({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns
});
core.info('All Done!');
core.endGroup();
}
if (Object.keys(yamlFilePatterns).length > 0) {
const modifiedKeys = [];
const changedKeys = [];
for (const key of Object.keys(yamlFilePatterns)) {
core.startGroup(`changed-files-yaml-${key}`);
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
allDiffFiles,
filePatterns: yamlFilePatterns[key]
});
core.debug(`All filtered diff files for ${key}: ${JSON.stringify(allFilteredDiffFiles)}`);
const { anyChanged, anyModified } = yield (0, changedFilesOutput_1.setOutputsAndGetModifiedAndChangedFilesStatus)({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns: yamlFilePatterns[key],
outputPrefix: key
});
if (anyModified) {
modifiedKeys.push(key);
}
if (anyChanged) {
changedKeys.push(key);
}
core.info('All Done!');
core.endGroup();
}
if (modifiedKeys.length > 0) {
yield (0, utils_1.setArrayOutput)({
key: 'modified_keys',
inputs,
value: modifiedKeys
});
}
if (changedKeys.length > 0) {
yield (0, utils_1.setArrayOutput)({
key: 'changed_keys',
inputs,
value: changedKeys
});
}
}
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
core.startGroup('changed-files-all');
yield (0, changedFilesOutput_1.setOutputsAndGetModifiedAndChangedFilesStatus)({
allDiffFiles,
allFilteredDiffFiles: allDiffFiles,
inputs
});
core.info('All Done!');
core.endGroup();
}
});
exports.processChangedFiles = processChangedFiles;
const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, submodulePaths }) => __awaiter(void 0, void 0, void 0, function* () {
const renamedFiles = yield (0, utils_1.gitRenamedFiles)({
cwd: workingDirectory,
@@ -356,17 +427,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.setChangedFilesOutput = void 0;
exports.setOutputsAndGetModifiedAndChangedFilesStatus = void 0;
const core = __importStar(__nccwpck_require__(2186));
const changedFiles_1 = __nccwpck_require__(7358);
const utils_1 = __nccwpck_require__(918);
const getOutputKey = (key, outputPrefix) => {
return outputPrefix ? `${outputPrefix}_${key}` : key;
};
const getArrayFromPaths = (paths, inputs) => {
return Array.isArray(paths) ? paths : paths.split(inputs.separator);
};
const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, filePatterns = [], outputPrefix = '' }) => __awaiter(void 0, void 0, void 0, function* () {
const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilteredDiffFiles, inputs, filePatterns = [], outputPrefix = '' }) => __awaiter(void 0, void 0, void 0, function* () {
const addedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs,
changedFiles: allFilteredDiffFiles,
@@ -374,7 +442,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Added files: ${JSON.stringify(addedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('added_files', outputPrefix),
key: (0, utils_1.getOutputKey)('added_files', outputPrefix),
value: addedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -382,7 +450,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('added_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('added_files_count', outputPrefix),
value: addedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -394,7 +462,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Copied files: ${JSON.stringify(copiedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('copied_files', outputPrefix),
key: (0, utils_1.getOutputKey)('copied_files', outputPrefix),
value: copiedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -402,7 +470,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('copied_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('copied_files_count', outputPrefix),
value: copiedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -414,7 +482,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Modified files: ${JSON.stringify(modifiedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('modified_files', outputPrefix),
key: (0, utils_1.getOutputKey)('modified_files', outputPrefix),
value: modifiedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -422,7 +490,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('modified_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('modified_files_count', outputPrefix),
value: modifiedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -434,7 +502,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Renamed files: ${JSON.stringify(renamedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('renamed_files', outputPrefix),
key: (0, utils_1.getOutputKey)('renamed_files', outputPrefix),
value: renamedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -442,7 +510,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('renamed_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('renamed_files_count', outputPrefix),
value: renamedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -454,7 +522,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Type changed files: ${JSON.stringify(typeChangedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('type_changed_files', outputPrefix),
key: (0, utils_1.getOutputKey)('type_changed_files', outputPrefix),
value: typeChangedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -462,7 +530,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('type_changed_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('type_changed_files_count', outputPrefix),
value: typeChangedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -474,7 +542,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Unmerged files: ${JSON.stringify(unmergedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('unmerged_files', outputPrefix),
key: (0, utils_1.getOutputKey)('unmerged_files', outputPrefix),
value: unmergedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -482,7 +550,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('unmerged_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('unmerged_files_count', outputPrefix),
value: unmergedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -494,7 +562,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Unknown files: ${JSON.stringify(unknownFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('unknown_files', outputPrefix),
key: (0, utils_1.getOutputKey)('unknown_files', outputPrefix),
value: unknownFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -502,7 +570,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('unknown_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('unknown_files_count', outputPrefix),
value: unknownFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -513,7 +581,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`All changed and modified files: ${JSON.stringify(allChangedAndModifiedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_and_modified_files', outputPrefix),
key: (0, utils_1.getOutputKey)('all_changed_and_modified_files', outputPrefix),
value: allChangedAndModifiedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -521,7 +589,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('all_changed_and_modified_files_count', outputPrefix),
value: allChangedAndModifiedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -538,7 +606,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`All changed files: ${JSON.stringify(allChangedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_files', outputPrefix),
key: (0, utils_1.getOutputKey)('all_changed_files', outputPrefix),
value: allChangedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -546,13 +614,13 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('all_changed_files_count', outputPrefix),
value: allChangedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
});
yield (0, utils_1.setOutput)({
key: getOutputKey('any_changed', outputPrefix),
key: (0, utils_1.getOutputKey)('any_changed', outputPrefix),
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -576,24 +644,20 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
allChangedFiles.paths.length > 0 &&
filePatterns.length > 0;
yield (0, utils_1.setOutput)({
key: getOutputKey('only_changed', outputPrefix),
key: (0, utils_1.getOutputKey)('only_changed', outputPrefix),
value: onlyChanged,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
});
yield (0, utils_1.setOutput)({
key: getOutputKey('other_changed_files', outputPrefix),
value: inputs.json
? otherChangedFiles
: otherChangedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
yield (0, utils_1.setArrayOutput)({
key: 'other_changed_files',
inputs,
value: otherChangedFiles,
outputPrefix
});
yield (0, utils_1.setOutput)({
key: getOutputKey('other_changed_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('other_changed_files_count', outputPrefix),
value: otherChangedFiles.length.toString(),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -611,7 +675,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`All modified files: ${JSON.stringify(allModifiedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('all_modified_files', outputPrefix),
key: (0, utils_1.getOutputKey)('all_modified_files', outputPrefix),
value: allModifiedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -619,13 +683,13 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('all_modified_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('all_modified_files_count', outputPrefix),
value: allModifiedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
});
yield (0, utils_1.setOutput)({
key: getOutputKey('any_modified', outputPrefix),
key: (0, utils_1.getOutputKey)('any_modified', outputPrefix),
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -649,24 +713,20 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
allModifiedFiles.paths.length > 0 &&
filePatterns.length > 0;
yield (0, utils_1.setOutput)({
key: getOutputKey('only_modified', outputPrefix),
key: (0, utils_1.getOutputKey)('only_modified', outputPrefix),
value: onlyModified,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
});
yield (0, utils_1.setOutput)({
key: getOutputKey('other_modified_files', outputPrefix),
value: inputs.json
? otherModifiedFiles
: otherModifiedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
yield (0, utils_1.setArrayOutput)({
key: 'other_modified_files',
inputs,
value: otherModifiedFiles,
outputPrefix
});
yield (0, utils_1.setOutput)({
key: getOutputKey('other_modified_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('other_modified_files_count', outputPrefix),
value: otherModifiedFiles.length.toString(),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
@@ -678,7 +738,7 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
});
core.debug(`Deleted files: ${JSON.stringify(deletedFiles)}`);
yield (0, utils_1.setOutput)({
key: getOutputKey('deleted_files', outputPrefix),
key: (0, utils_1.getOutputKey)('deleted_files', outputPrefix),
value: deletedFiles.paths,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -686,13 +746,13 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
shouldEscape: inputs.escapeJson
});
yield (0, utils_1.setOutput)({
key: getOutputKey('deleted_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('deleted_files_count', outputPrefix),
value: deletedFiles.count,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
});
yield (0, utils_1.setOutput)({
key: getOutputKey('any_deleted', outputPrefix),
key: (0, utils_1.getOutputKey)('any_deleted', outputPrefix),
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
@@ -710,30 +770,30 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
deletedFiles.paths.length > 0 &&
filePatterns.length > 0;
yield (0, utils_1.setOutput)({
key: getOutputKey('only_deleted', outputPrefix),
key: (0, utils_1.getOutputKey)('only_deleted', outputPrefix),
value: onlyDeleted,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
});
yield (0, utils_1.setOutput)({
key: getOutputKey('other_deleted_files', outputPrefix),
value: inputs.json
? otherDeletedFiles
: otherDeletedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
yield (0, utils_1.setArrayOutput)({
key: 'other_deleted_files',
inputs,
value: otherDeletedFiles,
outputPrefix
});
yield (0, utils_1.setOutput)({
key: getOutputKey('other_deleted_files_count', outputPrefix),
key: (0, utils_1.getOutputKey)('other_deleted_files_count', outputPrefix),
value: otherDeletedFiles.length.toString(),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
});
return {
anyModified: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
anyChanged: allChangedFiles.paths.length > 0 && filePatterns.length > 0
};
});
exports.setChangedFilesOutput = setChangedFilesOutput;
exports.setOutputsAndGetModifiedAndChangedFilesStatus = setOutputsAndGetModifiedAndChangedFilesStatus;
/***/ }),
@@ -1102,31 +1162,50 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
previousSha = github.context.payload.before;
if (!previousSha ||
(previousSha &&
(yield (0, utils_1.verifyCommitSha)({ sha: previousSha, cwd: workingDirectory })) !==
0)) {
if (github.context.payload.action &&
github.context.payload.action === 'synchronize') {
core.warning('Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.');
}
else {
core.info(`Unable to locate the remote branch head sha for ${github.context.eventName} (${github.context.payload.action}) events. Falling back to the previous commit in the local history.`);
}
(yield (0, utils_1.verifyCommitSha)({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0)) {
core.info(`Unable to locate the previous commit in the local history for ${github.context.eventName} (${github.context.payload.action}) event. Falling back to the previous commit in the local history.`);
previousSha = yield (0, utils_1.getParentSha)({
cwd: workingDirectory
});
if (!previousSha) {
core.warning('Unable to locate the previous commit in the local history. Falling back to the pull request base sha.');
previousSha = (_w = (_v = github.context.payload.pull_request) === null || _v === void 0 ? void 0 : _v.base) === null || _w === void 0 ? void 0 : _w.sha;
if (github.context.payload.action &&
github.context.payload.action === 'synchronize' &&
previousSha &&
(!previousSha ||
(previousSha &&
(yield (0, utils_1.verifyCommitSha)({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0))) {
throw new Error('Unable to locate the previous commit in the local history. Please ensure to checkout pull request HEAD commit instead of the merge commit. See: https://github.com/actions/checkout/blob/main/README.md#checkout-pull-request-head-commit-instead-of-merge-commit');
}
if (!previousSha ||
(previousSha &&
(yield (0, utils_1.verifyCommitSha)({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0)) {
throw new Error('Unable to locate the previous commit in the local history. Please ensure to checkout pull request HEAD commit instead of the merge commit. See: https://github.com/actions/checkout/blob/main/README.md#checkout-pull-request-head-commit-instead-of-merge-commit');
}
}
}
else {
previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({
cwd: workingDirectory,
branch: targetBranch
});
if (!previousSha) {
previousSha = (_y = (_x = github.context.payload.pull_request) === null || _x === void 0 ? void 0 : _x.base) === null || _y === void 0 ? void 0 : _y.sha;
if (github.context.payload.action === 'closed') {
previousSha = (_w = (_v = github.context.payload.pull_request) === null || _v === void 0 ? void 0 : _v.base) === null || _w === void 0 ? void 0 : _w.sha;
}
else {
previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({
cwd: workingDirectory,
branch: targetBranch
});
if (!previousSha) {
previousSha = (_y = (_x = github.context.payload.pull_request) === null || _x === void 0 ? void 0 : _x.base) === null || _y === void 0 ? void 0 : _y.sha;
}
}
if (isShallow) {
if (!(yield (0, utils_1.canDiffCommits)({
@@ -1522,59 +1601,11 @@ const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438));
const path_1 = __importDefault(__nccwpck_require__(1017));
const changedFiles_1 = __nccwpck_require__(7358);
const changedFilesOutput_1 = __nccwpck_require__(8930);
const commitSha_1 = __nccwpck_require__(8613);
const env_1 = __nccwpck_require__(9763);
const inputs_1 = __nccwpck_require__(6180);
const utils_1 = __nccwpck_require__(918);
const changedFilesOutput = ({ filePatterns, allDiffFiles, inputs, yamlFilePatterns }) => __awaiter(void 0, void 0, void 0, function* () {
if (filePatterns.length > 0) {
core.startGroup('changed-files-patterns');
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
allDiffFiles,
filePatterns
});
core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`);
yield (0, changedFilesOutput_1.setChangedFilesOutput)({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns
});
core.info('All Done!');
core.endGroup();
}
if (Object.keys(yamlFilePatterns).length > 0) {
for (const key of Object.keys(yamlFilePatterns)) {
core.startGroup(`changed-files-yaml-${key}`);
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
allDiffFiles,
filePatterns: yamlFilePatterns[key]
});
core.debug(`All filtered diff files for ${key}: ${JSON.stringify(allFilteredDiffFiles)}`);
yield (0, changedFilesOutput_1.setChangedFilesOutput)({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns: yamlFilePatterns[key],
outputPrefix: key
});
core.info('All Done!');
core.endGroup();
}
}
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
core.startGroup('changed-files-all');
yield (0, changedFilesOutput_1.setChangedFilesOutput)({
allDiffFiles,
allFilteredDiffFiles: allDiffFiles,
inputs
});
core.info('All Done!');
core.endGroup();
}
});
const getChangedFilesFromLocalGit = ({ inputs, env, workingDirectory, filePatterns, yamlFilePatterns }) => __awaiter(void 0, void 0, void 0, function* () {
const getChangedFilesFromLocalGitHistory = ({ inputs, env, workingDirectory, filePatterns, yamlFilePatterns }) => __awaiter(void 0, void 0, void 0, function* () {
var _a, _b, _c;
yield (0, utils_1.verifyMinimumGitVersion)();
let quotePathValue = 'on';
@@ -1645,7 +1676,7 @@ const getChangedFilesFromLocalGit = ({ inputs, env, workingDirectory, filePatter
sha: diffResult.previousSha
});
}
yield changedFilesOutput({
yield (0, changedFiles_1.processChangedFiles)({
filePatterns,
allDiffFiles,
inputs,
@@ -1685,7 +1716,7 @@ const getChangedFilesFromRESTAPI = ({ inputs, filePatterns, yamlFilePatterns })
});
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`);
core.info('All Done!');
yield changedFilesOutput({
yield (0, changedFiles_1.processChangedFiles)({
filePatterns,
allDiffFiles,
inputs,
@@ -1750,7 +1781,7 @@ function run() {
return;
}
core.info('Using local .git directory');
yield getChangedFilesFromLocalGit({
yield getChangedFilesFromLocalGitHistory({
inputs,
env,
workingDirectory,
@@ -1832,7 +1863,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.hasLocalGitDirectory = exports.recoverDeletedFiles = exports.setOutput = exports.getRecoverFilePatterns = exports.getYamlFilePatterns = exports.getFilePatterns = exports.getDirNamesIncludeFilesPattern = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = exports.isInsideWorkTree = exports.getHeadSha = exports.gitLog = exports.getFilteredChangedFiles = exports.getAllChangedFiles = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = exports.getDirname = exports.normalizeSeparators = exports.isWindows = void 0;
exports.hasLocalGitDirectory = exports.recoverDeletedFiles = exports.setOutput = exports.setArrayOutput = exports.getOutputKey = exports.getRecoverFilePatterns = exports.getYamlFilePatterns = exports.getFilePatterns = exports.getDirNamesIncludeFilesPattern = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = exports.isInsideWorkTree = exports.getHeadSha = exports.gitLog = exports.getFilteredChangedFiles = exports.getAllChangedFiles = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = exports.getDirname = exports.normalizeSeparators = exports.isWindows = void 0;
/*global AsyncIterableIterator*/
const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514));
@@ -2653,6 +2684,22 @@ const getRecoverFilePatterns = ({ inputs }) => {
return filePatterns.filter(Boolean);
};
exports.getRecoverFilePatterns = getRecoverFilePatterns;
const getOutputKey = (key, outputPrefix) => {
return outputPrefix ? `${outputPrefix}_${key}` : key;
};
exports.getOutputKey = getOutputKey;
const setArrayOutput = ({ key, inputs, value, outputPrefix }) => __awaiter(void 0, void 0, void 0, function* () {
core.debug(`${key}: ${JSON.stringify(value)}`);
yield (0, exports.setOutput)({
key: outputPrefix ? (0, exports.getOutputKey)(key, outputPrefix) : key,
value: inputs.json ? value : value.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
});
});
exports.setArrayOutput = setArrayOutput;
const setOutput = ({ key, value, writeOutputFiles, outputDir, json = false, shouldEscape = false }) => __awaiter(void 0, void 0, void 0, function* () {
let cleanedValue;
if (json) {
@@ -3278,7 +3325,7 @@ class OidcClient {
.catch(error => {
throw new Error(`Failed to get ID Token. \n
Error Code : ${error.statusCode}\n
Error Message: ${error.result.message}`);
Error Message: ${error.message}`);
});
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
if (!id_token) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "@tj-actions/changed-files",
"version": "38.2.2",
"version": "39.1.0",
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
"main": "lib/main.js",
"publishConfig": {
@@ -48,7 +48,7 @@
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vercel/ncc": "^0.36.1",
"@vercel/ncc": "^0.38.0",
"eslint": "^8.43.0",
"eslint-plugin-github": "^4.8.0",
"eslint-plugin-jest": "^27.2.2",

View File

@@ -4,7 +4,7 @@ import type {RestEndpointMethodTypes} from '@octokit/rest'
import flatten from 'lodash/flatten'
import mm from 'micromatch'
import * as path from 'path'
import {setOutputsAndGetModifiedAndChangedFilesStatus} from './changedFilesOutput'
import {DiffResult} from './commitSha'
import {Inputs} from './inputs'
import {
@@ -12,12 +12,107 @@ import {
getAllChangedFiles,
getDirnameMaxDepth,
getDirNamesIncludeFilesPattern,
getFilteredChangedFiles,
gitRenamedFiles,
gitSubmoduleDiffSHA,
isWindows,
jsonOutput
jsonOutput,
setArrayOutput
} from './utils'
export const processChangedFiles = async ({
filePatterns,
allDiffFiles,
inputs,
yamlFilePatterns
}: {
filePatterns: string[]
allDiffFiles: ChangedFiles
inputs: Inputs
yamlFilePatterns: Record<string, string[]>
}): Promise<void> => {
if (filePatterns.length > 0) {
core.startGroup('changed-files-patterns')
const allFilteredDiffFiles = await getFilteredChangedFiles({
allDiffFiles,
filePatterns
})
core.debug(
`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`
)
await setOutputsAndGetModifiedAndChangedFilesStatus({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns
})
core.info('All Done!')
core.endGroup()
}
if (Object.keys(yamlFilePatterns).length > 0) {
const modifiedKeys: string[] = []
const changedKeys: string[] = []
for (const key of Object.keys(yamlFilePatterns)) {
core.startGroup(`changed-files-yaml-${key}`)
const allFilteredDiffFiles = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: yamlFilePatterns[key]
})
core.debug(
`All filtered diff files for ${key}: ${JSON.stringify(
allFilteredDiffFiles
)}`
)
const {anyChanged, anyModified} =
await setOutputsAndGetModifiedAndChangedFilesStatus({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns: yamlFilePatterns[key],
outputPrefix: key
})
if (anyModified) {
modifiedKeys.push(key)
}
if (anyChanged) {
changedKeys.push(key)
}
core.info('All Done!')
core.endGroup()
}
if (modifiedKeys.length > 0) {
await setArrayOutput({
key: 'modified_keys',
inputs,
value: modifiedKeys
})
}
if (changedKeys.length > 0) {
await setArrayOutput({
key: 'changed_keys',
inputs,
value: changedKeys
})
}
}
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
core.startGroup('changed-files-all')
await setOutputsAndGetModifiedAndChangedFilesStatus({
allDiffFiles,
allFilteredDiffFiles: allDiffFiles,
inputs
})
core.info('All Done!')
core.endGroup()
}
}
export const getRenamedFiles = async ({
inputs,
workingDirectory,

View File

@@ -6,11 +6,7 @@ import {
getChangeTypeFiles
} from './changedFiles'
import {Inputs} from './inputs'
import {setOutput} from './utils'
const getOutputKey = (key: string, outputPrefix: string): string => {
return outputPrefix ? `${outputPrefix}_${key}` : key
}
import {getOutputKey, setArrayOutput, setOutput} from './utils'
const getArrayFromPaths = (
paths: string | string[],
@@ -19,7 +15,7 @@ const getArrayFromPaths = (
return Array.isArray(paths) ? paths : paths.split(inputs.separator)
}
export const setChangedFilesOutput = async ({
export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
allDiffFiles,
allFilteredDiffFiles,
inputs,
@@ -31,7 +27,7 @@ export const setChangedFilesOutput = async ({
inputs: Inputs
filePatterns?: string[]
outputPrefix?: string
}): Promise<void> => {
}): Promise<{anyModified: boolean; anyChanged: boolean}> => {
const addedFiles = await getChangeTypeFiles({
inputs,
changedFiles: allFilteredDiffFiles,
@@ -283,15 +279,11 @@ export const setChangedFilesOutput = async ({
json: inputs.json
})
await setOutput({
key: getOutputKey('other_changed_files', outputPrefix),
value: inputs.json
? otherChangedFiles
: otherChangedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
await setArrayOutput({
key: 'other_changed_files',
inputs,
value: otherChangedFiles,
outputPrefix
})
await setOutput({
@@ -376,15 +368,11 @@ export const setChangedFilesOutput = async ({
json: inputs.json
})
await setOutput({
key: getOutputKey('other_modified_files', outputPrefix),
value: inputs.json
? otherModifiedFiles
: otherModifiedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
await setArrayOutput({
key: 'other_modified_files',
inputs,
value: otherModifiedFiles,
outputPrefix
})
await setOutput({
@@ -457,15 +445,11 @@ export const setChangedFilesOutput = async ({
json: inputs.json
})
await setOutput({
key: getOutputKey('other_deleted_files', outputPrefix),
value: inputs.json
? otherDeletedFiles
: otherDeletedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
await setArrayOutput({
key: 'other_deleted_files',
inputs,
value: otherDeletedFiles,
outputPrefix
})
await setOutput({
@@ -474,4 +458,9 @@ export const setChangedFilesOutput = async ({
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
return {
anyModified: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
anyChanged: allChangedFiles.paths.length > 0 && filePatterns.length > 0
}
}

View File

@@ -419,40 +419,63 @@ export const getSHAForPullRequestEvent = async (
if (
!previousSha ||
(previousSha &&
(await verifyCommitSha({sha: previousSha, cwd: workingDirectory})) !==
0)
(await verifyCommitSha({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0)
) {
if (
github.context.payload.action &&
github.context.payload.action === 'synchronize'
) {
core.warning(
'Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.'
)
} else {
core.info(
`Unable to locate the remote branch head sha for ${github.context.eventName} (${github.context.payload.action}) events. Falling back to the previous commit in the local history.`
)
}
core.info(
`Unable to locate the previous commit in the local history for ${github.context.eventName} (${github.context.payload.action}) event. Falling back to the previous commit in the local history.`
)
previousSha = await getParentSha({
cwd: workingDirectory
})
if (!previousSha) {
core.warning(
'Unable to locate the previous commit in the local history. Falling back to the pull request base sha.'
if (
github.context.payload.action &&
github.context.payload.action === 'synchronize' &&
previousSha &&
(!previousSha ||
(previousSha &&
(await verifyCommitSha({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0))
) {
throw new Error(
'Unable to locate the previous commit in the local history. Please ensure to checkout pull request HEAD commit instead of the merge commit. See: https://github.com/actions/checkout/blob/main/README.md#checkout-pull-request-head-commit-instead-of-merge-commit'
)
}
if (
!previousSha ||
(previousSha &&
(await verifyCommitSha({
sha: previousSha,
cwd: workingDirectory,
showAsErrorMessage: false
})) !== 0)
) {
throw new Error(
'Unable to locate the previous commit in the local history. Please ensure to checkout pull request HEAD commit instead of the merge commit. See: https://github.com/actions/checkout/blob/main/README.md#checkout-pull-request-head-commit-instead-of-merge-commit'
)
previousSha = github.context.payload.pull_request?.base?.sha
}
}
} else {
previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory,
branch: targetBranch
})
if (!previousSha) {
if (github.context.payload.action === 'closed') {
previousSha = github.context.payload.pull_request?.base?.sha
} else {
previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory,
branch: targetBranch
})
if (!previousSha) {
previousSha = github.context.payload.pull_request?.base?.sha
}
}
if (isShallow) {

View File

@@ -2,13 +2,12 @@ import * as core from '@actions/core'
import * as github from '@actions/github'
import path from 'path'
import {
ChangedFiles,
processChangedFiles,
ChangeTypeEnum,
getAllDiffFiles,
getChangedFilesFromGithubAPI,
getRenamedFiles
} from './changedFiles'
import {setChangedFilesOutput} from './changedFilesOutput'
import {
DiffResult,
getSHAForNonPullRequestEvent,
@@ -18,7 +17,6 @@ import {Env, getEnv} from './env'
import {getInputs, Inputs} from './inputs'
import {
getFilePatterns,
getFilteredChangedFiles,
getRecoverFilePatterns,
getSubmodulePath,
getYamlFilePatterns,
@@ -31,73 +29,7 @@ import {
verifyMinimumGitVersion
} from './utils'
const changedFilesOutput = async ({
filePatterns,
allDiffFiles,
inputs,
yamlFilePatterns
}: {
filePatterns: string[]
allDiffFiles: ChangedFiles
inputs: Inputs
yamlFilePatterns: Record<string, string[]>
}): Promise<void> => {
if (filePatterns.length > 0) {
core.startGroup('changed-files-patterns')
const allFilteredDiffFiles = await getFilteredChangedFiles({
allDiffFiles,
filePatterns
})
core.debug(
`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`
)
await setChangedFilesOutput({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns
})
core.info('All Done!')
core.endGroup()
}
if (Object.keys(yamlFilePatterns).length > 0) {
for (const key of Object.keys(yamlFilePatterns)) {
core.startGroup(`changed-files-yaml-${key}`)
const allFilteredDiffFiles = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: yamlFilePatterns[key]
})
core.debug(
`All filtered diff files for ${key}: ${JSON.stringify(
allFilteredDiffFiles
)}`
)
await setChangedFilesOutput({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns: yamlFilePatterns[key],
outputPrefix: key
})
core.info('All Done!')
core.endGroup()
}
}
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
core.startGroup('changed-files-all')
await setChangedFilesOutput({
allDiffFiles,
allFilteredDiffFiles: allDiffFiles,
inputs
})
core.info('All Done!')
core.endGroup()
}
}
const getChangedFilesFromLocalGit = async ({
const getChangedFilesFromLocalGitHistory = async ({
inputs,
env,
workingDirectory,
@@ -216,7 +148,7 @@ const getChangedFilesFromLocalGit = async ({
})
}
await changedFilesOutput({
await processChangedFiles({
filePatterns,
allDiffFiles,
inputs,
@@ -267,7 +199,7 @@ const getChangedFilesFromRESTAPI = async ({
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`)
core.info('All Done!')
await changedFilesOutput({
await processChangedFiles({
filePatterns,
allDiffFiles,
inputs,
@@ -349,7 +281,7 @@ export async function run(): Promise<void> {
}
core.info('Using local .git directory')
await getChangedFilesFromLocalGit({
await getChangedFilesFromLocalGitHistory({
inputs,
env,
workingDirectory,

View File

@@ -9,7 +9,6 @@ import * as path from 'path'
import {createInterface} from 'readline'
import {parseDocument} from 'yaml'
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
import {Inputs} from './inputs'
const MINIMUM_GIT_VERSION = '2.18.0'
@@ -1223,6 +1222,32 @@ export const getRecoverFilePatterns = ({
return filePatterns.filter(Boolean)
}
export const getOutputKey = (key: string, outputPrefix: string): string => {
return outputPrefix ? `${outputPrefix}_${key}` : key
}
export const setArrayOutput = async ({
key,
inputs,
value,
outputPrefix
}: {
key: string
inputs: Inputs
value: string[]
outputPrefix?: string
}): Promise<void> => {
core.debug(`${key}: ${JSON.stringify(value)}`)
await setOutput({
key: outputPrefix ? getOutputKey(key, outputPrefix) : key,
value: inputs.json ? value : value.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
}
export const setOutput = async ({
key,
value,

1032
yarn.lock

File diff suppressed because it is too large Load Diff