Compare commits

...

176 Commits

Author SHA1 Message Date
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
Tonye Jack
48566bbcc2 upgrade: nodejs to v20 (#1535) 2023-09-04 15:29:37 -06:00
renovate[bot]
d68a6666be chore(deps): lock file maintenance 2023-09-04 21:10:22 +00:00
tj-actions[bot]
07660d51a9 Upgraded to v38.2.2 (#1533)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-09-04 20:54:35 +00:00
Tonye Jack
632c84dcca Update README.md 2023-09-04 14:42:58 -06:00
renovate[bot]
1aee3621b1 chore(deps): lock file maintenance 2023-09-04 20:19:43 +00:00
Tonye Jack
8d335b7b7d fix: bug with outputs when json is set to true (#1531)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-04 20:03:32 +00:00
renovate[bot]
fd460fa3ba chore(deps): update typescript-eslint monorepo to v6.6.0 2023-09-04 18:30:15 +00:00
renovate[bot]
5b84ed26a3 chore(deps): update actions/checkout action to v4 (#1527)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-04 13:21:19 +00:00
renovate[bot]
e03c026bf4 chore(deps): lock file maintenance 2023-09-04 02:06:29 +00:00
renovate[bot]
5704310356 chore(deps): update dependency @types/node to v20.5.9 2023-09-02 23:52:01 +00:00
renovate[bot]
c922361eb2 chore(deps): update dependency @types/node to v20.5.8 2023-09-01 21:02:17 +00:00
tj-actions[bot]
48576e6584 Upgraded to v38.2.1 (#1523)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-09-01 20:46:15 +00:00
renovate[bot]
79d644d1a2 chore(deps): lock file maintenance 2023-09-01 20:30:38 +00:00
Tonye Jack
2f7246cb26 chore: update warning message (#1521)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-09-01 14:07:33 -06:00
Tonye Jack
8476756ae3 fix: bug matching patterns (#1520)
Co-authored-by: GitHub Action <action@github.com>
2023-09-01 19:49:08 +00:00
dependabot[bot]
d90c240f2a chore(deps): bump test/demo from 8bbc726 to 5dfac2e (#1518)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 07:30:11 -06:00
renovate[bot]
3be651e99d chore(deps): lock file maintenance 2023-09-01 05:09:43 +00:00
Tonye Jack
4fac98a656 Deleted .github/ISSUE_TEMPLATE/feature_request.yaml 2023-08-31 19:07:44 -06:00
Tonye Jack
bed56b29b8 Deleted .github/ISSUE_TEMPLATE/bug_report.yaml 2023-08-31 19:06:17 -06:00
Tonye Jack
2338e28eef Update bug_report.yaml 2023-08-31 18:14:10 -06:00
Tonye Jack
d4eb53db66 Update bug_report.yaml 2023-08-31 18:12:04 -06:00
Tonye Jack
8f777bbc0d Update bug_report.yaml 2023-08-31 18:10:16 -06:00
Tonye Jack
7d256b941a Update bug_report.yaml 2023-08-31 18:08:46 -06:00
Tonye Jack
c3ceccf9bc Delete FUNDING.yml 2023-08-30 19:50:24 -06:00
renovate[bot]
c89928824f chore(deps): lock file maintenance 2023-08-31 01:09:07 +00:00
tj-actions[bot]
047f654646 Upgraded to v38.2.0 (#1515)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 21:48:14 +00:00
renovate[bot]
0fc9663aa7 chore(deps): update dependency @types/uuid to v9.0.3 (#1512)
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-08-30 15:10:05 -06:00
tj-actions[bot]
50f623482f Updated README.md (#1514)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 15:09:09 -06:00
Tonye Jack
2e0f79f8b6 Update README.md 2023-08-30 15:02:51 -06:00
tj-actions[bot]
308cb3daf9 Updated README.md (#1513)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 14:56:35 -06:00
Tonye Jack
f1b3c2fa8b feat: add support for failing on error (#1511)
Co-authored-by: GitHub Action <action@github.com>
2023-08-30 14:51:36 -06:00
tj-actions[bot]
2f6d66af9d Updated README.md (#1510)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 17:41:36 +00:00
Tonye Jack
ef21b84507 Update README.md 2023-08-30 11:27:45 -06:00
Tonye Jack
c9dd6721cf Update README.md 2023-08-30 11:23:44 -06:00
renovate[bot]
428519788b chore(deps): update dependency prettier to v3.0.3 2023-08-29 16:09:38 +00:00
renovate[bot]
522df62704 chore(deps): update dependency eslint-plugin-github to v4.10.0 2023-08-29 00:54:55 +00:00
renovate[bot]
d35b677f4b chore(deps): update typescript-eslint monorepo to v6.5.0 2023-08-28 18:57:32 +00:00
GitHub Action
b1c183b83c Added missing changes and modified dist assets. 2023-08-28 15:44:10 +00:00
renovate[bot]
7555f14f91 fix(deps): update dependency yaml to v2.3.2 2023-08-28 15:44:10 +00:00
renovate[bot]
bc2a793022 chore(deps): lock file maintenance 2023-08-28 00:52:59 +00:00
tj-actions[bot]
a40e52b504 Upgraded to v38.1.3 (#1503)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-26 20:51:29 +00:00
renovate[bot]
c860b5c47f chore(deps): update tj-actions/release-tagger action to v4 (#1502)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-26 14:32:03 -06:00
Tonye Jack
2f8b80270f chore: update warning message (#1500)
Co-authored-by: GitHub Action <action@github.com>
2023-08-26 14:08:40 -06:00
renovate[bot]
d01e38ae60 chore(deps): lock file maintenance 2023-08-26 03:38:30 +00:00
Tonye Jack
eed6844f8b chore: update submodule (#1498) 2023-08-25 21:18:46 -06:00
Tonye Jack
f6e73eb5b6 chore: update warning message (#1497)
Co-authored-by: GitHub Action <action@github.com>
2023-08-25 21:00:53 -06:00
tj-actions[bot]
3034ed7851 Upgraded to v38.1.1 (#1495)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-25 21:07:25 +00:00
renovate[bot]
34c9fcc96a chore(deps): update dependency eslint to v8.48.0 2023-08-25 20:53:32 +00:00
tj-actions[bot]
b7f1b7347f Updated README.md (#1493)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-25 14:29:10 -06:00
Tonye Jack
fc4a224c47 Update README.md 2023-08-25 14:28:36 -06:00
dependabot[bot]
b86b5055c6 chore(deps): bump test/demo from f0065d7 to 8bbc726 (#1492)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-25 04:27:14 +00:00
GitHub Action
c0d418d2f4 Added missing changes and modified dist assets. 2023-08-24 23:26:13 +00:00
renovate[bot]
2cd89433de chore(deps): lock file maintenance 2023-08-24 23:26:13 +00:00
renovate[bot]
6cb2857ef0 chore(deps): update dependency @types/node to v20.5.6 2023-08-24 22:44:39 +00:00
renovate[bot]
716bc48e21 chore(deps): update dependency typescript to v5.2.2 2023-08-24 19:32:03 +00:00
renovate[bot]
6afd248b18 chore(deps): update dependency jest to v29.6.4 2023-08-24 16:22:35 +00:00
Tonye Jack
8e62bee92f Updated .github/FUNDING.yml 2023-08-23 21:50:47 -06:00
Tonye Jack
02ce009f42 Updated .github/FUNDING.yml 2023-08-23 21:48:07 -06:00
tj-actions[bot]
88a8df65a2 Updated README.md (#1486)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-24 03:14:01 +00:00
tj-actions[bot]
5c42e98b8f Updated README.md (#1485)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-23 20:59:02 -06:00
renovate[bot]
fd5abe1ac5 chore(deps): update tj-actions/auto-doc action to v3 (#1484)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-24 02:53:09 +00:00
tj-actions[bot]
088d89c918 Updated README.md (#1483)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-24 02:33:06 +00:00
Tonye Jack
8299ae07ec Update update-readme.yml 2023-08-23 20:15:29 -06:00
Tonye Jack
fd8ad0b934 Update update-readme.yml 2023-08-23 20:13:54 -06:00
tj-actions[bot]
2fc6aa80df Upgraded to v38.1.0 (#1482)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-23 23:06:36 +00:00
dependabot[bot]
1c26215f3f chore(deps): bump test/demo from e168fac to f0065d7 (#1481)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-23 22:40:11 +00:00
dependabot[bot]
7b1e1540e2 chore(deps-dev): bump @types/node from 20.5.3 to 20.5.4 (#1480)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-23 21:46:49 +00:00
Tonye Jack
02010edac3 chore: move submodule update to dependabot and remove unused workflow (#1478) 2023-08-23 15:09:57 -06:00
tj-actions[bot]
e4e76943d6 Updated README.md (#1477)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-23 15:05:35 -06:00
Tonye Jack
569361586a feat: add support for fetching additional history for submodules (#1476)
Co-authored-by: GitHub Action <action@github.com>
2023-08-23 15:04:44 -06:00
renovate[bot]
785218258b chore(deps): lock file maintenance 2023-08-23 05:18:13 +00:00
tj-actions[bot]
0b45bc64c2 Upgraded to v38 (#1474)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-22 22:59:10 -06:00
Tonye Jack
17f3fec1ed fix: error getting diff for submodules (#1473)
Co-authored-by: GitHub Action <action@github.com>
2023-08-22 22:26:07 -06:00
Tonye Jack
52dbf3e3cf chore: update test (#1469)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-23 04:06:23 +00:00
renovate[bot]
0a814e4372 chore(deps): update dependency @types/jest to v29.5.4 (#1472)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-22 13:53:55 -06:00
Tonye Jack
fc63326544 fix: bug with locating the previous tag (#1470)
Co-authored-by: GitHub Action <action@github.com>
2023-08-22 13:41:54 -06:00
renovate[bot]
18bacaab15 chore(deps): update dependency @types/node to v20.5.3 (#1467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-22 13:41:13 -06:00
tj-actions[bot]
e8f12786b4 Updated README.md (#1466)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
2023-08-21 22:42:43 -06:00
Tonye Jack
8789204f97 feat: add support for including matching changed files when dir_names is set to true (#1464)
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-08-22 03:11:59 +00:00
Tonye Jack
819fb64520 chore: update .eslintrc.json (#1465) 2023-08-21 16:11:26 -06:00
renovate[bot]
31003b45e6 chore(deps): update typescript-eslint monorepo to v6.4.1 (#1463)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 19:33:34 +00:00
renovate[bot]
1f04b16682 chore(deps): update dependency jest to v29.6.3 (#1462)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 16:43:07 +00:00
renovate[bot]
0a8b04e3e3 chore(deps): lock file maintenance (#1461)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-08-21 01:48:26 +00:00
Tonye Jack
f8b4039d96 Update README.md 2023-08-18 19:52:10 -06:00
renovate[bot]
6da496e2f9 chore(deps): update dependency @types/node to v20.5.1 (#1460)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-18 19:53:36 +00:00
renovate[bot]
68d38a3f16 chore(deps): update actions/setup-node action to v3.8.1 (#1459)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 17:55:12 +00:00
Tonye Jack
0e8eddfd8c Update README.md 2023-08-16 19:09:51 -06:00
tj-actions[bot]
3645cf9fc3 Upgraded to v37.6.1 (#1458)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-16 16:45:15 +00:00
renovate[bot]
a0585ff990 chore(deps): update dependency prettier to v3.0.2 (#1457)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-08-15 17:37:46 +00:00
renovate[bot]
ec3a2a3b3b chore(deps): update typescript-eslint monorepo to v6.4.0 (#1456)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-14 19:38:44 +00:00
renovate[bot]
24e2a6fb86 chore(deps): update actions/setup-node action to v3.8.0 (#1455)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-14 13:22:55 +00:00
renovate[bot]
1144bc6587 chore(deps): lock file maintenance (#1454)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-14 02:32:29 +00:00
renovate[bot]
fa84d9471e chore(deps): update dependency @types/node to v20.5.0 (#1453)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-13 21:41:48 +00:00
renovate[bot]
71dfd0dc2e chore(deps): update dependency @types/node to v20.4.10 (#1452)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-11 20:07:54 +00:00
renovate[bot]
b941520afb chore(deps): update dependency eslint to v8.47.0 (#1451)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-11 17:39:21 +00:00
renovate[bot]
be110124f6 chore(deps): lock file maintenance (#1450)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-11 04:48:12 +00:00
Tonye Jack
927363397d Update README.md 2023-08-09 18:30:47 -06:00
renovate[bot]
9dc097cfe5 chore(deps): update dependency @types/lodash to v4.14.197 (#1446)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 23:12:12 +00:00
renovate[bot]
e3b0c8a681 chore(deps): update dependency @types/node to v20.4.9 (#1444)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-08 22:05:23 +00:00
Tonye Jack
a62be95af3 chore: fix typo 2023-08-08 10:15:34 -06:00
Tonye Jack
a2e707696a Update README.md 2023-08-08 10:14:26 -06:00
renovate[bot]
f267068b02 chore(deps): update typescript-eslint monorepo to v6.3.0 (#1442)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-07 18:34:07 +00:00
tj-actions[bot]
7f0849be06 Upgraded to v37.6.0 (#1441)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-07 06:28:07 +00:00
Tonye Jack
87697c0dca chore: improve test coverage (#1440) 2023-08-07 00:05:28 -06:00
Tonye Jack
0acc1c308e chore: simplify code (#1439)
Co-authored-by: GitHub Action <action@github.com>
2023-08-07 00:00:11 -06:00
renovate[bot]
312a3d8003 chore(deps): lock file maintenance (#1438)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-07 02:10:23 +00:00
renovate[bot]
701bae514b chore(deps): update dependency @types/node to v20.4.8 (#1425)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-05 14:14:56 +00:00
renovate[bot]
8bffb974e4 chore(deps): lock file maintenance (#1437)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-08-05 07:48:00 +00:00
Tonye Jack
d4e6e22e93 feat: improve checking local branch history (#1436)
Co-authored-by: GitHub Action <action@github.com>
2023-08-05 06:26:02 +00:00
Tonye Jack
1e9cd5f299 Update README.md 2023-08-04 23:50:03 -06:00
Tonye Jack
29022e81a4 test: improve test coverage (#1435)
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com>
2023-08-04 23:04:46 -06:00
Tonye Jack
6b028b6303 Update README.md 2023-08-04 12:32:36 -06:00
dependabot[bot]
f76208237d chore(deps-dev): bump @types/node from 20.4.6 to 20.4.7 (#1433)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-04 01:31:33 +00:00
tj-actions[bot]
b61db7817f Updated README.md (#1432)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-03 16:17:03 -06:00
Tonye Jack
6a48a0a018 Update README.md 2023-08-03 16:16:10 -06:00
Tonye Jack
3415802ae9 Update README.md 2023-08-03 16:14:44 -06:00
Tonye Jack
20a19b977f Update README.md 2023-08-03 16:11:38 -06:00
Tonye Jack
10228bf07b Update README.md 2023-08-03 16:01:27 -06:00
tj-actions[bot]
24ac45c74e Upgraded to v37.5.2 (#1431)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-03 14:31:15 -06:00
Tonye Jack
85c8b8252f chore: improve test coverage (#1430)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-03 13:25:35 -06:00
Tonye Jack
948fd1aec0 Update README.md 2023-08-03 13:24:56 -06:00
renovate[bot]
213a6fbf71 chore(deps): update dependency prettier to v3.0.1 (#1428)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-03 09:12:04 +00:00
renovate[bot]
c089e392a9 chore(deps): lock file maintenance (#1427)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-03 02:51:06 +00:00
dependabot[bot]
387fa91a19 chore(deps-dev): bump @types/node from 20.4.5 to 20.4.6 (#1426)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-03 02:06:04 +00:00
Tonye Jack
bde04d3ec6 Update README.md 2023-08-01 11:03:13 -06:00
renovate[bot]
ce7dceac93 chore(deps): lock file maintenance (#1424)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-01 13:50:52 +00:00
renovate[bot]
18832c2f0d chore(deps): lock file maintenance (#1423)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-01 02:33:46 +00:00
Tonye Jack
3fdcd6b1fa Update README.md 2023-07-31 17:44:57 -06:00
renovate[bot]
2b564ea543 chore(deps): update typescript-eslint monorepo to v6.2.1 (#1422)
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-07-31 19:04:38 +00:00
Tonye Jack
6b62acfc40 Update README.md 2023-07-31 12:36:37 -06:00
renovate[bot]
62411c0bbf chore(deps): lock file maintenance (#1421)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-31 00:27:03 +00:00
tj-actions[bot]
c10ebdc85f Updated README.md (#1420)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-07-30 01:55:31 +00:00
Tonye Jack
1b00b76bc1 Update README.md 2023-07-29 19:40:28 -06:00
renovate[bot]
8ffb34e4db chore(deps): lock file maintenance (#1419)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 05:29:21 +00:00
tj-actions[bot]
81ce706243 Upgraded to v37.5.1 (#1418)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-07-28 22:41:29 +00:00
30 changed files with 4002 additions and 1912 deletions

View File

@@ -1,4 +1,5 @@
dist/
lib/
node_modules/
jest.config.js
jest.config.js
coverage/

View File

@@ -5,7 +5,8 @@
"github"
],
"extends": [
"plugin:github/recommended"
"plugin:github/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {

12
.github/FUNDING.yml vendored
View File

@@ -1,12 +0,0 @@
# These are supported funding model platforms
github: jackton1
patreon: # Replace with a single Patreon username
open_collective: tj-actions
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: []

View File

@@ -1,98 +0,0 @@
name: 🐞 Bug
description: Create a report to help us improve
title: "[BUG] <title>"
labels: [bug, needs triage]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: checkboxes
attributes:
label: Does this issue exist in the latest version?
description: Please view all releases to confirm that this issue hasn't already been fixed.
options:
- label: I'm using the latest release
required: true
- type: textarea
id: what-happened
attributes:
label: Describe the bug?
description: A clear and concise description of what the bug is
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: To Reproduce
description: Steps to reproduce the behavior?
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: true
- type: dropdown
id: os
attributes:
label: What OS are you seeing the problem on?
multiple: true
options:
- all
- ubuntu-latest or ubuntu-20.04
- ubuntu-18.04
- macos-latest or macos-10.15
- macos-11
- windows-latest or windows-2019
- windows-2016
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior?
description: A clear and concise description of what you expected to happen.
placeholder: Tell us what you expected!
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output which is obtained after enabling debug logging. This will be automatically formatted into code, so no need for backticks.
placeholder: |
1. Re-running the workflow with debug logging enabled.
2. Copy or download the log archive.
3. Paste the contents here or upload the file in a subsequent comment.
render: shell
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? or References?
Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](../blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true

View File

@@ -1,59 +0,0 @@
name: Feature request
description: Suggest an idea for this project
title: "[Feature] <title>"
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: checkboxes
attributes:
label: Is this feature missing in the latest version?
description: Please upgrade to the latest version to verify that this feature is still missing.
options:
- label: I'm using the latest release
required: true
- type: textarea
id: what-happened
attributes:
label: Is your feature request related to a problem? Please describe.
description: |
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: requests
attributes:
label: Describe the solution you'd like?
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Describe alternatives you've considered?
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: |
Links? or References?
Add any other context or screenshots about the feature request here.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](../blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true

View File

@@ -15,3 +15,10 @@ updates:
open-pull-requests-limit: 10
labels:
- "merge when passing"
- package-ecosystem: gitsubmodule
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "merge when passing"

View File

@@ -29,7 +29,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -16,7 +16,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
submodules: true
fetch-depth: 0

View File

@@ -14,7 +14,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0
- name: Get changed files
@@ -38,7 +38,7 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Test
run: |
echo ${{ matrix.files }}

View File

@@ -1,29 +0,0 @@
on:
workflow_dispatch:
jobs:
sync:
name: Submodule Sync
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Git Sumbodule Update
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.2
with:
title: "Updated submodule"
labels: "merge when passing"
branch: "chore/update-submodule"
commit-message: "Updated submodule"
body: "Updated submodule"
token: ${{ secrets.PAT_TOKEN }}

View File

@@ -8,11 +8,11 @@ jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0
- name: Run release-tagger
uses: tj-actions/release-tagger@v3
uses: tj-actions/release-tagger@v4
- name: Sync release version.
uses: tj-actions/sync-release-version@v13
id: sync-release-version
@@ -21,6 +21,14 @@ jobs:
only_major: true
paths: |
README.md
- name: Sync release package version.
uses: tj-actions/sync-release-version@v13
id: sync-release-package-version
with:
pattern: '"version": "'
strip_prefix: "v"
paths: |
package.json
- name: Run git-cliff
uses: tj-actions/git-cliff@v1
- name: Create Pull Request

File diff suppressed because it is too large Load Diff

View File

@@ -9,12 +9,12 @@ jobs:
sync-assets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0
- name: Run auto-doc
uses: tj-actions/auto-doc@v2
uses: tj-actions/auto-doc@v3
- name: Run remark
uses: tj-actions/remark@v3

2
.nvmrc
View File

@@ -1 +1 @@
16
20

View File

@@ -1,5 +1,440 @@
# Changelog
# [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
- Bug with outputs when json is set to true ([#1531](https://github.com/tj-actions/changed-files/issues/1531)) ([8d335b7](https://github.com/tj-actions/changed-files/commit/8d335b7b7dd078ea984daff751cca794ed2e3f55)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Lock file maintenance ([1aee362](https://github.com/tj-actions/changed-files/commit/1aee3621b1c10305ee778298fcf32324684e5448)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.6.0 ([fd460fa](https://github.com/tj-actions/changed-files/commit/fd460fa3ba5a11b8fde158a65d59d764c344878e)) - (renovate[bot])
- **deps:** Update actions/checkout action to v4 ([#1527](https://github.com/tj-actions/changed-files/issues/1527)) ([5b84ed2](https://github.com/tj-actions/changed-files/commit/5b84ed26a3cc4c8a3f72c23739e361226a1c3773)) - (renovate[bot])
- **deps:** Lock file maintenance ([e03c026](https://github.com/tj-actions/changed-files/commit/e03c026bf43272cfd653bdebb67d53eefa7e381c)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.9 ([5704310](https://github.com/tj-actions/changed-files/commit/5704310356f399321c158190d53b4862c1adcdcd)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.8 ([c922361](https://github.com/tj-actions/changed-files/commit/c922361eb2e5315d71b2b0ce26a3ce1919ae0725)) - (renovate[bot])
- **deps:** Lock file maintenance ([79d644d](https://github.com/tj-actions/changed-files/commit/79d644d1a2bc9ca4316052da1b06e73cde530d09)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.2.1 ([#1523](https://github.com/tj-actions/changed-files/issues/1523))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([48576e6](https://github.com/tj-actions/changed-files/commit/48576e65843bb9b05d25cac69fe8b1c142a9485a)) - (tj-actions[bot])
# [38.2.1](https://github.com/tj-actions/changed-files/compare/v38.2.0...v38.2.1) - (2023-09-01)
## <!-- 1 -->🐛 Bug Fixes
- Bug matching patterns ([#1520](https://github.com/tj-actions/changed-files/issues/1520)) ([8476756](https://github.com/tj-actions/changed-files/commit/8476756ae3363aa4c10685f8804636de76aee77c)) - (Tonye Jack)
## <!-- 17 --> Remove
- Deleted .github/ISSUE_TEMPLATE/feature_request.yaml ([4fac98a](https://github.com/tj-actions/changed-files/commit/4fac98a65655335ee89759e4c87d265b0114e15c)) - (Tonye Jack)
- Deleted .github/ISSUE_TEMPLATE/bug_report.yaml ([bed56b2](https://github.com/tj-actions/changed-files/commit/bed56b29b814ce968175396abd67152a01b3a722)) - (Tonye Jack)
- Delete FUNDING.yml ([c3ceccf](https://github.com/tj-actions/changed-files/commit/c3ceccf9bce227317f59ed99512b300e0aa6c2ae)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update bug_report.yaml ([2338e28](https://github.com/tj-actions/changed-files/commit/2338e28eefcb81d8c25c7e6ca50543f53f60446b)) - (Tonye Jack)
- Update bug_report.yaml ([d4eb53d](https://github.com/tj-actions/changed-files/commit/d4eb53db66ce407e266022c530dec9703cdffd3d)) - (Tonye Jack)
- Update bug_report.yaml ([8f777bb](https://github.com/tj-actions/changed-files/commit/8f777bbc0dbc0dfc6994d2c93114bfb970d95e61)) - (Tonye Jack)
- Update bug_report.yaml ([7d256b9](https://github.com/tj-actions/changed-files/commit/7d256b941a1ffb4dea0a5f3b7a3a34b6fe962e4c)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update warning message ([#1521](https://github.com/tj-actions/changed-files/issues/1521)) ([2f7246c](https://github.com/tj-actions/changed-files/commit/2f7246cb26e8bb6709b6cbfc1fec7febfe82e96a)) - (Tonye Jack)
- **deps:** Bump test/demo from `8bbc726` to `5dfac2e` ([#1518](https://github.com/tj-actions/changed-files/issues/1518)) ([d90c240](https://github.com/tj-actions/changed-files/commit/d90c240f2ad4ec04d8f0f48e5ac290ad96ebe850)) - (dependabot[bot])
- **deps:** Lock file maintenance ([3be651e](https://github.com/tj-actions/changed-files/commit/3be651e99d3d4eae395694f6c6f3b9d18457f6c8)) - (renovate[bot])
- **deps:** Lock file maintenance ([c899288](https://github.com/tj-actions/changed-files/commit/c89928824ff66dd05ee32708cd6228b6d65c9405)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.2.0 ([#1515](https://github.com/tj-actions/changed-files/issues/1515))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([047f654](https://github.com/tj-actions/changed-files/commit/047f65464639f7d9b9efefea74419be4c0b50b5f)) - (tj-actions[bot])
# [38.2.0](https://github.com/tj-actions/changed-files/compare/v38.1.3...v38.2.0) - (2023-08-30)
## <!-- 0 -->🚀 Features
- Add support for failing on error ([#1511](https://github.com/tj-actions/changed-files/issues/1511)) ([f1b3c2f](https://github.com/tj-actions/changed-files/commit/f1b3c2fa8b5692e972e331fdd79882d38273972c)) - (Tonye Jack)
## <!-- 1 -->🐛 Bug Fixes
- **deps:** Update dependency yaml to v2.3.2 ([7555f14](https://github.com/tj-actions/changed-files/commit/7555f14f918691d9063483ad675c79b69b47adcd)) - (renovate[bot])
## <!-- 16 --> Add
- Added missing changes and modified dist assets.
([b1c183b](https://github.com/tj-actions/changed-files/commit/b1c183b83c74c3f32fb9bb133284a41b10553736)) - (GitHub Action)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1514](https://github.com/tj-actions/changed-files/issues/1514))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([50f6234](https://github.com/tj-actions/changed-files/commit/50f623482f13ff783ea3495d9c9a106d8f17d2ff)) - (tj-actions[bot])
- Update README.md ([2e0f79f](https://github.com/tj-actions/changed-files/commit/2e0f79f8b6a541bee4a978276043a311172d0dc2)) - (Tonye Jack)
- Updated README.md ([#1513](https://github.com/tj-actions/changed-files/issues/1513))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([308cb3d](https://github.com/tj-actions/changed-files/commit/308cb3daf981b614d1eb8f01ba365f9d478fb50d)) - (tj-actions[bot])
- Updated README.md ([#1510](https://github.com/tj-actions/changed-files/issues/1510))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2f6d66a](https://github.com/tj-actions/changed-files/commit/2f6d66af9db64309ccb993e5969f61d180c9d5ff)) - (tj-actions[bot])
- Update README.md ([ef21b84](https://github.com/tj-actions/changed-files/commit/ef21b845077a6a12523c59bee84fab2847a3c6ed)) - (Tonye Jack)
- Update README.md ([c9dd672](https://github.com/tj-actions/changed-files/commit/c9dd6721cf288da7c7c5d06f78cb27e66d7d8279)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update dependency @types/uuid to v9.0.3 ([#1512](https://github.com/tj-actions/changed-files/issues/1512)) ([0fc9663](https://github.com/tj-actions/changed-files/commit/0fc9663aa70243d87319dbd32fd926344d18d38f)) - (renovate[bot])
- **deps:** Update dependency prettier to v3.0.3 ([4285197](https://github.com/tj-actions/changed-files/commit/428519788bc9daeb52f4031e6be46b6a8b42d57a)) - (renovate[bot])
- **deps:** Update dependency eslint-plugin-github to v4.10.0 ([522df62](https://github.com/tj-actions/changed-files/commit/522df62704d7d3a82510f5b1af9bcac3e8c95a60)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.5.0 ([d35b677](https://github.com/tj-actions/changed-files/commit/d35b677f4bef732191226506c4e785f7dfea2cd0)) - (renovate[bot])
- **deps:** Lock file maintenance ([bc2a793](https://github.com/tj-actions/changed-files/commit/bc2a7930225604ad9877b568ec5bb044d0b1f59c)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.1.3 ([#1503](https://github.com/tj-actions/changed-files/issues/1503))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([a40e52b](https://github.com/tj-actions/changed-files/commit/a40e52b504ccee766d2304f1b5ff1aeba55a832e)) - (tj-actions[bot])
# [38.1.3](https://github.com/tj-actions/changed-files/compare/v38.1.2...v38.1.3) - (2023-08-26)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update tj-actions/release-tagger action to v4 ([#1502](https://github.com/tj-actions/changed-files/issues/1502)) ([c860b5c](https://github.com/tj-actions/changed-files/commit/c860b5c47fa71f461da850094ef2f6e3d6514e44)) - (renovate[bot])
# [38.1.2](https://github.com/tj-actions/changed-files/compare/v38.1.1...v38.1.2) - (2023-08-26)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update warning message ([#1500](https://github.com/tj-actions/changed-files/issues/1500)) ([2f8b802](https://github.com/tj-actions/changed-files/commit/2f8b80270f04e421b28efb2abaccef4fce4815b6)) - (Tonye Jack)
- **deps:** Lock file maintenance ([d01e38a](https://github.com/tj-actions/changed-files/commit/d01e38ae60f5527562be5c2d2bee11d666a25759)) - (renovate[bot])
- Update submodule ([#1498](https://github.com/tj-actions/changed-files/issues/1498)) ([eed6844](https://github.com/tj-actions/changed-files/commit/eed6844f8b8930b86537b173c0c545d73fdf2177)) - (Tonye Jack)
- Update warning message ([#1497](https://github.com/tj-actions/changed-files/issues/1497)) ([f6e73eb](https://github.com/tj-actions/changed-files/commit/f6e73eb5b610c261657b2de25ec64c4252069608)) - (Tonye Jack)
- **deps:** Update dependency eslint to v8.48.0 ([34c9fcc](https://github.com/tj-actions/changed-files/commit/34c9fcc96ac0a5d0be0519ed91e3f625c9b8ad09)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.1.1 ([#1495](https://github.com/tj-actions/changed-files/issues/1495))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([3034ed7](https://github.com/tj-actions/changed-files/commit/3034ed7851a1bae2de6ae8f20e9c9890917b859a)) - (tj-actions[bot])
# [38.1.1](https://github.com/tj-actions/changed-files/compare/v38.1.0...v38.1.1) - (2023-08-25)
## <!-- 16 --> Add
- Added missing changes and modified dist assets.
([c0d418d](https://github.com/tj-actions/changed-files/commit/c0d418d2f41e21e92203a1022c4606ef77aa6bc2)) - (GitHub Action)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1493](https://github.com/tj-actions/changed-files/issues/1493))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([b7f1b73](https://github.com/tj-actions/changed-files/commit/b7f1b7347fea1df67230801b66081fe3cba7dc69)) - (tj-actions[bot])
- Update README.md ([fc4a224](https://github.com/tj-actions/changed-files/commit/fc4a224c47dadefa07dc096ed0ff953c0bd17144)) - (Tonye Jack)
- Updated .github/FUNDING.yml ([8e62bee](https://github.com/tj-actions/changed-files/commit/8e62bee92f800ef13879d41004367f912f016c85)) - (Tonye Jack)
- Updated .github/FUNDING.yml ([02ce009](https://github.com/tj-actions/changed-files/commit/02ce009f4243cd05f1381c43c6a1d48f68a3b485)) - (Tonye Jack)
- Updated README.md ([#1486](https://github.com/tj-actions/changed-files/issues/1486))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([88a8df6](https://github.com/tj-actions/changed-files/commit/88a8df65a2f24314ca8833c27ec427ffe6809039)) - (tj-actions[bot])
- Updated README.md ([#1485](https://github.com/tj-actions/changed-files/issues/1485))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([5c42e98](https://github.com/tj-actions/changed-files/commit/5c42e98b8fe904db676293fa7156514c905af8c4)) - (tj-actions[bot])
- Updated README.md ([#1483](https://github.com/tj-actions/changed-files/issues/1483))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([088d89c](https://github.com/tj-actions/changed-files/commit/088d89c918a1e7d236520ec4e7daea1d959d41e5)) - (tj-actions[bot])
- Update update-readme.yml ([8299ae0](https://github.com/tj-actions/changed-files/commit/8299ae07ec237ebe1c58a4cc49b9c1e064d927fa)) - (Tonye Jack)
- Update update-readme.yml ([fd8ad0b](https://github.com/tj-actions/changed-files/commit/fd8ad0b93433d4d8c80427eb93ae5e78b8a1ce7c)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Bump test/demo from `f0065d7` to `8bbc726` ([#1492](https://github.com/tj-actions/changed-files/issues/1492)) ([b86b505](https://github.com/tj-actions/changed-files/commit/b86b5055c618b14573c5d8f6d7198309ea0828ac)) - (dependabot[bot])
- **deps:** Lock file maintenance ([2cd8943](https://github.com/tj-actions/changed-files/commit/2cd89433debfbbf5e77c95d38dac646ff3a76ebc)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.6 ([6cb2857](https://github.com/tj-actions/changed-files/commit/6cb2857ef0a3296d70201f34aa4ca530deb48e38)) - (renovate[bot])
- **deps:** Update dependency typescript to v5.2.2 ([716bc48](https://github.com/tj-actions/changed-files/commit/716bc48e21c1367a2c750432fff2cc1dd8fe4ead)) - (renovate[bot])
- **deps:** Update dependency jest to v29.6.4 ([6afd248](https://github.com/tj-actions/changed-files/commit/6afd248b1827a2f7943482875140b770f36cc4e8)) - (renovate[bot])
- **deps:** Update tj-actions/auto-doc action to v3 ([#1484](https://github.com/tj-actions/changed-files/issues/1484)) ([fd5abe1](https://github.com/tj-actions/changed-files/commit/fd5abe1ac5fb8d024051c757ad9bf1fc6b767e6c)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.1.0 ([#1482](https://github.com/tj-actions/changed-files/issues/1482))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2fc6aa8](https://github.com/tj-actions/changed-files/commit/2fc6aa80df596875e0f74f1df939e72b7627e867)) - (tj-actions[bot])
# [38.1.0](https://github.com/tj-actions/changed-files/compare/v38.0.0...v38.1.0) - (2023-08-23)
## <!-- 0 -->🚀 Features
- Add support for fetching additional history for submodules ([#1476](https://github.com/tj-actions/changed-files/issues/1476)) ([5693615](https://github.com/tj-actions/changed-files/commit/569361586a6cff9491312916c5e703a443417e81)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1477](https://github.com/tj-actions/changed-files/issues/1477))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([e4e7694](https://github.com/tj-actions/changed-files/commit/e4e76943d643113dcf1458aecb541063cbdc63fd)) - (tj-actions[bot])
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Bump test/demo from `e168fac` to `f0065d7` ([#1481](https://github.com/tj-actions/changed-files/issues/1481)) ([1c26215](https://github.com/tj-actions/changed-files/commit/1c26215f3fbd51eba03bc199e5cbabdfc3584ce3)) - (dependabot[bot])
- **deps-dev:** Bump @types/node from 20.5.3 to 20.5.4 ([#1480](https://github.com/tj-actions/changed-files/issues/1480)) ([7b1e154](https://github.com/tj-actions/changed-files/commit/7b1e1540e27d3397053816b2bcf36f17cfc6cf2f)) - (dependabot[bot])
- Move submodule update to dependabot and remove unused workflow ([#1478](https://github.com/tj-actions/changed-files/issues/1478)) ([02010ed](https://github.com/tj-actions/changed-files/commit/02010edac36d80b90e96e94e505a9e34a67f7b89)) - (Tonye Jack)
- **deps:** Lock file maintenance ([7852182](https://github.com/tj-actions/changed-files/commit/785218258b790e5191c8655f483824c7e8c226da)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38 ([#1474](https://github.com/tj-actions/changed-files/issues/1474))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([0b45bc6](https://github.com/tj-actions/changed-files/commit/0b45bc64c29a84aea65c944b5a06b6c75844dfaa)) - (tj-actions[bot])
# [38.0.0](https://github.com/tj-actions/changed-files/compare/v37.6.1...v38.0.0) - (2023-08-23)
## <!-- 0 -->🚀 Features
- Add support for including matching changed files when dir_names is set to true ([#1464](https://github.com/tj-actions/changed-files/issues/1464)) ([8789204](https://github.com/tj-actions/changed-files/commit/8789204f9747de46e322edc26ccef589722b5d12)) - (Tonye Jack)
## <!-- 1 -->🐛 Bug Fixes
- Error getting diff for submodules ([#1473](https://github.com/tj-actions/changed-files/issues/1473)) ([17f3fec](https://github.com/tj-actions/changed-files/commit/17f3fec1edef0c3916d59cbcee1585fcd457e456)) - (Tonye Jack)
- Bug with locating the previous tag ([#1470](https://github.com/tj-actions/changed-files/issues/1470)) ([fc63326](https://github.com/tj-actions/changed-files/commit/fc633265449c7430ee5634b1c673247b313ef8cf)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1466](https://github.com/tj-actions/changed-files/issues/1466))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([e8f1278](https://github.com/tj-actions/changed-files/commit/e8f12786b4779b5208c8e0593863215f52c804e0)) - (tj-actions[bot])
- Update README.md ([f8b4039](https://github.com/tj-actions/changed-files/commit/f8b4039d9628a18c5e26b11a098230dd037e299e)) - (Tonye Jack)
- Update README.md ([0e8eddf](https://github.com/tj-actions/changed-files/commit/0e8eddfd8c525e4d8522d7de71af8ad5e4290b90)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update test ([#1469](https://github.com/tj-actions/changed-files/issues/1469)) ([52dbf3e](https://github.com/tj-actions/changed-files/commit/52dbf3e3cf799a1324a9c148c64948abbf8c3fa6)) - (Tonye Jack)
- **deps:** Update dependency @types/jest to v29.5.4 ([#1472](https://github.com/tj-actions/changed-files/issues/1472)) ([0a814e4](https://github.com/tj-actions/changed-files/commit/0a814e4372753d6beb4a9ec8f4166aea312f679a)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.3 ([#1467](https://github.com/tj-actions/changed-files/issues/1467)) ([18bacaa](https://github.com/tj-actions/changed-files/commit/18bacaab15227e761b04fb4097648318590be71a)) - (renovate[bot])
- Update .eslintrc.json ([#1465](https://github.com/tj-actions/changed-files/issues/1465)) ([819fb64](https://github.com/tj-actions/changed-files/commit/819fb645201f8693c48ca1158b4069d0c7cec64d)) - (Tonye Jack)
- **deps:** Update typescript-eslint monorepo to v6.4.1 ([#1463](https://github.com/tj-actions/changed-files/issues/1463)) ([31003b4](https://github.com/tj-actions/changed-files/commit/31003b45e6faa01151aeb2508de21d895b9024d8)) - (renovate[bot])
- **deps:** Update dependency jest to v29.6.3 ([#1462](https://github.com/tj-actions/changed-files/issues/1462)) ([1f04b16](https://github.com/tj-actions/changed-files/commit/1f04b16682ff06e18be316b672337f43ebd8f768)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1461](https://github.com/tj-actions/changed-files/issues/1461)) ([0a8b04e](https://github.com/tj-actions/changed-files/commit/0a8b04e3e345eae4a8aa28fb46959c1509197ee5)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.1 ([#1460](https://github.com/tj-actions/changed-files/issues/1460)) ([6da496e](https://github.com/tj-actions/changed-files/commit/6da496e2f92930ffc11735db0b53e4e2027e9e26)) - (renovate[bot])
- **deps:** Update actions/setup-node action to v3.8.1 ([#1459](https://github.com/tj-actions/changed-files/issues/1459)) ([68d38a3](https://github.com/tj-actions/changed-files/commit/68d38a3f163ab827c733c45c9f23d607401a34ce)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.6.1 ([#1458](https://github.com/tj-actions/changed-files/issues/1458))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([3645cf9](https://github.com/tj-actions/changed-files/commit/3645cf9fc374b6e501b12888142f2aabc6b3cbf9)) - (tj-actions[bot])
# [37.6.1](https://github.com/tj-actions/changed-files/compare/v37.6.0...v37.6.1) - (2023-08-15)
## <!-- 26 -->🔄 Update
- Update README.md ([9273633](https://github.com/tj-actions/changed-files/commit/927363397d870aec841c3616c5136442218239af)) - (Tonye Jack)
- Update README.md ([a2e7076](https://github.com/tj-actions/changed-files/commit/a2e707696afd3f2f1738328cbfed71c56cd9b744)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update dependency prettier to v3.0.2 ([#1457](https://github.com/tj-actions/changed-files/issues/1457)) ([a0585ff](https://github.com/tj-actions/changed-files/commit/a0585ff9904b77d046192a7846e59783d6ea287b)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.4.0 ([#1456](https://github.com/tj-actions/changed-files/issues/1456)) ([ec3a2a3](https://github.com/tj-actions/changed-files/commit/ec3a2a3b3bf9648f952a5c642013948f99ab154f)) - (renovate[bot])
- **deps:** Update actions/setup-node action to v3.8.0 ([#1455](https://github.com/tj-actions/changed-files/issues/1455)) ([24e2a6f](https://github.com/tj-actions/changed-files/commit/24e2a6fb86042fb1e67a527045d6f8dea53b7d06)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1454](https://github.com/tj-actions/changed-files/issues/1454)) ([1144bc6](https://github.com/tj-actions/changed-files/commit/1144bc6587e8570446c99b3cd5961539c750de3e)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.0 ([#1453](https://github.com/tj-actions/changed-files/issues/1453)) ([fa84d94](https://github.com/tj-actions/changed-files/commit/fa84d9471e31552ac5031e74416776d80f7b3c23)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.4.10 ([#1452](https://github.com/tj-actions/changed-files/issues/1452)) ([71dfd0d](https://github.com/tj-actions/changed-files/commit/71dfd0dc2e7cde599586ee53148fcf31fda68499)) - (renovate[bot])
- **deps:** Update dependency eslint to v8.47.0 ([#1451](https://github.com/tj-actions/changed-files/issues/1451)) ([b941520](https://github.com/tj-actions/changed-files/commit/b941520afb05ff090564ee87734ece045963aaa7)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1450](https://github.com/tj-actions/changed-files/issues/1450)) ([be11012](https://github.com/tj-actions/changed-files/commit/be110124f6253e3471e3c0280329c359fef9b077)) - (renovate[bot])
- **deps:** Update dependency @types/lodash to v4.14.197 ([#1446](https://github.com/tj-actions/changed-files/issues/1446)) ([9dc097c](https://github.com/tj-actions/changed-files/commit/9dc097cfe56dd6dca442b8b71b988aad4c385f94)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.4.9 ([#1444](https://github.com/tj-actions/changed-files/issues/1444)) ([e3b0c8a](https://github.com/tj-actions/changed-files/commit/e3b0c8a681e6f809136066ceeaae9a9203eddf29)) - (renovate[bot])
- Fix typo ([a62be95](https://github.com/tj-actions/changed-files/commit/a62be95af39e3e8d28a0ff4a80d07d30e7d16e17)) - (Tonye Jack)
- **deps:** Update typescript-eslint monorepo to v6.3.0 ([#1442](https://github.com/tj-actions/changed-files/issues/1442)) ([f267068](https://github.com/tj-actions/changed-files/commit/f267068b025785a2b8e6c5fd692c18782759af31)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.6.0 ([#1441](https://github.com/tj-actions/changed-files/issues/1441))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([7f0849b](https://github.com/tj-actions/changed-files/commit/7f0849be06042444c62445709a000389e08d70e6)) - (tj-actions[bot])
# [37.6.0](https://github.com/tj-actions/changed-files/compare/v37.5.2...v37.6.0) - (2023-08-07)
## <!-- 0 -->🚀 Features
- Improve checking local branch history ([#1436](https://github.com/tj-actions/changed-files/issues/1436)) ([d4e6e22](https://github.com/tj-actions/changed-files/commit/d4e6e22e932832260459e972c83fa76adca04a5c)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update README.md ([1e9cd5f](https://github.com/tj-actions/changed-files/commit/1e9cd5f2990496e3dc049d7978a807ed153b11a7)) - (Tonye Jack)
- Update README.md ([6b028b6](https://github.com/tj-actions/changed-files/commit/6b028b63039ee69ccfad97e35166eb997f6807ff)) - (Tonye Jack)
- Updated README.md ([#1432](https://github.com/tj-actions/changed-files/issues/1432))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([b61db78](https://github.com/tj-actions/changed-files/commit/b61db7817fbdc9f587fb205f4276886cda5913c5)) - (tj-actions[bot])
- Update README.md ([6a48a0a](https://github.com/tj-actions/changed-files/commit/6a48a0a0182db1daa7e00603ede7e99364f65ff2)) - (Tonye Jack)
- Update README.md ([3415802](https://github.com/tj-actions/changed-files/commit/3415802ae92f45865a7bb5f80578ad22994f57ea)) - (Tonye Jack)
- Update README.md ([20a19b9](https://github.com/tj-actions/changed-files/commit/20a19b977fa3a78c7d87956e7b388681926d3b56)) - (Tonye Jack)
- Update README.md ([10228bf](https://github.com/tj-actions/changed-files/commit/10228bf07b9286b8db198de83022b52ab908bde7)) - (Tonye Jack)
## <!-- 6 -->🧪 Testing
- Improve test coverage ([#1435](https://github.com/tj-actions/changed-files/issues/1435)) ([29022e8](https://github.com/tj-actions/changed-files/commit/29022e81a423492ed68172112181d0109be5e64e)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Improve test coverage ([#1440](https://github.com/tj-actions/changed-files/issues/1440)) ([87697c0](https://github.com/tj-actions/changed-files/commit/87697c0dca7dd44e37a2b79a79489332556ff1f3)) - (Tonye Jack)
- Simplify code ([#1439](https://github.com/tj-actions/changed-files/issues/1439)) ([0acc1c3](https://github.com/tj-actions/changed-files/commit/0acc1c308efedeb1a3a82d4c3812e380cacc86ec)) - (Tonye Jack)
- **deps:** Lock file maintenance ([#1438](https://github.com/tj-actions/changed-files/issues/1438)) ([312a3d8](https://github.com/tj-actions/changed-files/commit/312a3d8003811361254cc82903f9a5e057bd1d66)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.4.8 ([#1425](https://github.com/tj-actions/changed-files/issues/1425)) ([701bae5](https://github.com/tj-actions/changed-files/commit/701bae514b676a5deb33f611a66c7639c3ee2690)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1437](https://github.com/tj-actions/changed-files/issues/1437)) ([8bffb97](https://github.com/tj-actions/changed-files/commit/8bffb974e49dd3c5f242d8af10b9326194c99740)) - (renovate[bot])
- **deps-dev:** Bump @types/node from 20.4.6 to 20.4.7 ([#1433](https://github.com/tj-actions/changed-files/issues/1433)) ([f762082](https://github.com/tj-actions/changed-files/commit/f76208237d15a696b0174f93dbb00254bc016c65)) - (dependabot[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.5.2 ([#1431](https://github.com/tj-actions/changed-files/issues/1431))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([24ac45c](https://github.com/tj-actions/changed-files/commit/24ac45c74eee7f284e92f053e045dd94823f7255)) - (tj-actions[bot])
# [37.5.2](https://github.com/tj-actions/changed-files/compare/v37.5.1...v37.5.2) - (2023-08-03)
## <!-- 26 -->🔄 Update
- Update README.md ([948fd1a](https://github.com/tj-actions/changed-files/commit/948fd1aec0f923945aefa5b428966a3148c14b6f)) - (Tonye Jack)
- Update README.md ([bde04d3](https://github.com/tj-actions/changed-files/commit/bde04d3ec66f15d1bc7856d05ca626fb6573dc64)) - (Tonye Jack)
- Update README.md ([3fdcd6b](https://github.com/tj-actions/changed-files/commit/3fdcd6b1fa054b93db539c7b381c93fa2268d74e)) - (Tonye Jack)
- Update README.md ([6b62acf](https://github.com/tj-actions/changed-files/commit/6b62acfc401246667fa6575c368224614e69d150)) - (Tonye Jack)
- Updated README.md ([#1420](https://github.com/tj-actions/changed-files/issues/1420))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([c10ebdc](https://github.com/tj-actions/changed-files/commit/c10ebdc85fde7af2ea8c66779702ccdc2c09c3ba)) - (tj-actions[bot])
- Update README.md ([1b00b76](https://github.com/tj-actions/changed-files/commit/1b00b76bc1c9caf00f684c3bb3147d85da101580)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Improve test coverage ([#1430](https://github.com/tj-actions/changed-files/issues/1430)) ([85c8b82](https://github.com/tj-actions/changed-files/commit/85c8b8252fc9893e00b3633a16670e53040e6d71)) - (Tonye Jack)
- **deps:** Update dependency prettier to v3.0.1 ([#1428](https://github.com/tj-actions/changed-files/issues/1428)) ([213a6fb](https://github.com/tj-actions/changed-files/commit/213a6fbf71815875a70e39d3f252fe0b13646e14)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1427](https://github.com/tj-actions/changed-files/issues/1427)) ([c089e39](https://github.com/tj-actions/changed-files/commit/c089e392a94aa3fb0651d7893b8d45513851ca14)) - (renovate[bot])
- **deps-dev:** Bump @types/node from 20.4.5 to 20.4.6 ([#1426](https://github.com/tj-actions/changed-files/issues/1426)) ([387fa91](https://github.com/tj-actions/changed-files/commit/387fa91a199f7def6ffb96525119cce72a40c3d2)) - (dependabot[bot])
- **deps:** Lock file maintenance ([#1424](https://github.com/tj-actions/changed-files/issues/1424)) ([ce7dcea](https://github.com/tj-actions/changed-files/commit/ce7dceac93d38ea5365ee8ec231c4c25529ecbfd)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1423](https://github.com/tj-actions/changed-files/issues/1423)) ([18832c2](https://github.com/tj-actions/changed-files/commit/18832c2f0d0dcbf0a631fb9ae64a5b2c840b72d8)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.2.1 ([#1422](https://github.com/tj-actions/changed-files/issues/1422)) ([2b564ea](https://github.com/tj-actions/changed-files/commit/2b564ea5437173b3e7dcb0d7aec9ee0ad166d488)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1421](https://github.com/tj-actions/changed-files/issues/1421)) ([62411c0](https://github.com/tj-actions/changed-files/commit/62411c0bbfd74101a58615b1443f3b112aab34f7)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1419](https://github.com/tj-actions/changed-files/issues/1419)) ([8ffb34e](https://github.com/tj-actions/changed-files/commit/8ffb34e4dbad285f2f06e6fc82d72b24d5de2534)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.5.1 ([#1418](https://github.com/tj-actions/changed-files/issues/1418))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([81ce706](https://github.com/tj-actions/changed-files/commit/81ce7062432f3f2a5ba687cce3f289de9da66332)) - (tj-actions[bot])
# [37.5.1](https://github.com/tj-actions/changed-files/compare/v37.5.0...v37.5.1) - (2023-07-28)
## <!-- 26 -->🔄 Update
- Update README.md ([ca51c3f](https://github.com/tj-actions/changed-files/commit/ca51c3f4304b9cd96adebaa47025a2014040eb61)) - (Tonye Jack)
- Update README.md ([5716c62](https://github.com/tj-actions/changed-files/commit/5716c6246fcfd7031340a7be53243a6a6b689c3e)) - (Tonye Jack)
- Update README.md ([f6edf88](https://github.com/tj-actions/changed-files/commit/f6edf885b4a59cd97f396367b3e6fe4f26454601)) - (Tonye Jack)
- Update README.md ([331d2da](https://github.com/tj-actions/changed-files/commit/331d2daf96995ca6711e07b13681faa6a55bda62)) - (Tonye Jack)
- Updated README.md ([#1412](https://github.com/tj-actions/changed-files/issues/1412))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([174b246](https://github.com/tj-actions/changed-files/commit/174b246d44adb53ce1a125fc589734fce01e47eb)) - (tj-actions[bot])
- Update README.md ([0bf8395](https://github.com/tj-actions/changed-files/commit/0bf83955a913aa99abe90724dc460e86708af650)) - (Tonye Jack)
- Update README.md ([69c6091](https://github.com/tj-actions/changed-files/commit/69c6091ee4f562b2c6509ded97c4e5330ac95b09)) - (Tonye Jack)
- Update README.md ([ba9054e](https://github.com/tj-actions/changed-files/commit/ba9054e8d5ffe1537ded23c6a65348cb9b78e8c4)) - (Tonye Jack)
- Update README.md ([7e9cc01](https://github.com/tj-actions/changed-files/commit/7e9cc01c5474ea22e06e55ea8a296c8653e64d0c)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update dependency eslint to v8.46.0 ([#1417](https://github.com/tj-actions/changed-files/issues/1417)) ([a96679d](https://github.com/tj-actions/changed-files/commit/a96679dfee2a1e64b1db5a210c0ffaf1f2cb24ce)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1416](https://github.com/tj-actions/changed-files/issues/1416)) ([0c65957](https://github.com/tj-actions/changed-files/commit/0c659577d4b26faf3f99868ea9cabd2775f9b3cb)) - (renovate[bot])
- **deps:** Update dependency jest to v29.6.2 ([#1415](https://github.com/tj-actions/changed-files/issues/1415)) ([ea41e77](https://github.com/tj-actions/changed-files/commit/ea41e772876ff19a8d86e3315c52ceff3dae1941)) - (renovate[bot])
- **deps:** Update dependency @types/lodash to v4.14.196 ([#1413](https://github.com/tj-actions/changed-files/issues/1413)) ([4acaa72](https://github.com/tj-actions/changed-files/commit/4acaa728bbc362e0ced57dad81204885d253a0e6)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.4.5 ([#1409](https://github.com/tj-actions/changed-files/issues/1409)) ([cf02ab9](https://github.com/tj-actions/changed-files/commit/cf02ab960fc3dee58fc4911fac2c6946f4f64552)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1408](https://github.com/tj-actions/changed-files/issues/1408)) ([b50d1ab](https://github.com/tj-actions/changed-files/commit/b50d1ab2d1388e35e9163a8eb2ae8b903e62ca8e)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.5.0 ([#1407](https://github.com/tj-actions/changed-files/issues/1407))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([0f52c86](https://github.com/tj-actions/changed-files/commit/0f52c861db7764988bb85cbb66a0b166787f586b)) - (tj-actions[bot])
# [37.5.0](https://github.com/tj-actions/changed-files/compare/v37.4.0...v37.5.0) - (2023-07-24)
## <!-- 0 -->🚀 Features

365
README.md
View File

@@ -13,43 +13,41 @@
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<div align="center">
<img width="auto" alt="Screen Shot 2021-11-19 at 4 59 21 PM" src="https://user-images.githubusercontent.com/17484350/229027815-eee0bf22-f3e5-444d-9d90-6409c68a0dc9.png">
</div>
## changed-files
Effortlessly track all changed files and directories relative to a target branch, preceding commit or the last remote commit returning **relative paths** from the project root using this GitHub action.
## Table of contents
* [Features](#features)
* [Usage](#usage)
* [On `pull_request`](#on-pull_request)
* [Using local .git history](#using-local-git-history)
* [Using Github's API](#using-githubs-api)
* [On `push`](#on-push)
* [Useful Acronyms](#useful-acronyms)
* [Outputs](#outputs)
* [Inputs](#inputs)
* [Versioning](#versioning)
* [Examples](#examples)
* [Real-world usage](#real-world-usage)
* [Known Limitation](#known-limitation)
* [Migration guide](#migration-guide)
* [Credits](#credits)
* [Report Bugs](#report-bugs)
* [Features 🚀](#features-)
* [Usage 💻](#usage-)
* [On `pull_request` 🔀](#on-pull_request-)
* [Using local .git history 📁](#using-local-git-history-)
* [Using Github's API :octocat:](#using-githubs-api-octocat)
* [On `push` ⬆️](#on-push-)
* [Useful Acronyms 🧮](#useful-acronyms-)
* [Outputs 📤](#outputs-)
* [Inputs ⚙️](#inputs-)
* [Versioning 🏷️](#versioning-)
* [Examples 📄](#examples-)
* [Real-world usage 🌐](#real-world-usage-)
* [Open source projects 📦](#open-source-projects-)
* [Scalability Example 📈](#scalability-example-)
* [Known Limitation ⚠️](#known-limitation-)
* [Migration guide 🔄](#migration-guide-)
* [Credits 👏](#credits-)
* [Report Bugs 🐛](#report-bugs-)
* [Contributors ✨](#contributors-)
## Features
## Features 🚀
* Fast execution, averaging 0-10 seconds.
* Leverages either [Github's REST API](https://docs.github.com/en/rest/reference/repos#list-commits) or [Git's native diff](https://git-scm.com/docs/git-diff) to determine changed files.
* Facilitates easy debugging.
* Scales to handle large repositories.
* Supports Git submodules.
* Supports [merge queues](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) for pull reequests.
* Generates escaped JSON output for running matrix jobs based on changed files.
* Supports [merge queues](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) for pull requests.
* Generates escaped [JSON output for running matrix jobs](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml) based on changed files.
* Lists changed directories.
* Limits matching changed directories to a specified maximum depth.
* Optionally excludes the current directory.
@@ -66,31 +64,33 @@ Effortlessly track all changed files and directories relative to a target branch
* Between the last remote branch commit and the current HEAD.
* Restricts change detection to a subset of files and directories:
* Provides boolean output indicating changes in specific files.
* Uses [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
* Uses [Glob pattern](https://codepen.io/mrmlnc/pen/OXQjMe) matching.
* Supports Globstar.
* 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.
And many more...
## Usage
## Usage 💻
> **Warning**:
> **Warning**
>
> * For `push` events: \*\*When configuring [`actions/checkout`](https://github.com/actions/checkout#usage), make sure to set [`fetch-depth`](https://github.com/actions/checkout#usage) to either `0` or `2`, depending on your use case.
> * For mono repositories where pulling all the branch history might not be desired, you can still use the default [`fetch-depth`](https://github.com/actions/checkout#usage), which is set to `1` for `pull_request` events.
> * For `push` events: When configuring [`actions/checkout`](https://github.com/actions/checkout#usage), make sure to set [`fetch-depth`](https://github.com/actions/checkout#usage) to either `0` or `2`, depending on your use case.
> * For mono repositories where pulling all branch history might not be desired, you can still use the default [`fetch-depth`](https://github.com/actions/checkout#usage), which is set to `1` for `pull_request` events.
> * Avoid using single or double quotes for multiline inputs, as the value is already a string separated by a newline character. See [Examples](#examples) for more information.
> * If [`fetch-depth`](https://github.com/actions/checkout#usage) isn't set to `0`, ensure that `persist-credentials` is set to `true` when configuring [`actions/checkout`](https://github.com/actions/checkout#usage).
> * For repositories that have PRs generated from forks, when configuring [`actions/checkout`](https://github.com/actions/checkout#usage), set the [`repository`](https://github.com/actions/checkout#usage) to `${{ github.event.pull_request.head.repo.full_name }}`. See [Example](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/test.yml#L47-L51).
Visit the [discussions for more information](https://github.com/tj-actions/changed-files/discussions) or [create a new discussion](https://github.com/tj-actions/changed-files/discussions/new/choose) for usage-related questions.
### On `pull_request`
### On `pull_request` 🔀
#### Using local .git history
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
name: CI
@@ -108,20 +108,20 @@ jobs:
runs-on: ubuntu-latest # windows-latest || macos-latest
name: Test changed-files
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
# Example 1
- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
files_yaml: |
doc:
- '**.md'
- '**/*.md'
- docs/**
- docs/README.md
- README.md
test:
- test/**
- '!test/**.md'
@@ -130,7 +130,7 @@ jobs:
# Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml`
- name: Run step if test file(s) change
# NOTE: The key has to start with the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
# NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
run: |
echo "One or more test file(s) has changed."
@@ -145,7 +145,7 @@ jobs:
# Example 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
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:
@@ -160,7 +160,7 @@ jobs:
# Example 3
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
files_ignore: docs/static.js
@@ -172,7 +172,7 @@ jobs:
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
```
#### Using Github's API
#### Using Github's API :octocat:
```yaml
name: CI
@@ -200,7 +200,7 @@ jobs:
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
- name: List all changed files
run: |
@@ -209,7 +209,9 @@ jobs:
done
```
### On `push`
### On `push` ⬆️
Detect changes to files made since the last pushed commit.
```yaml
name: CI
@@ -234,6 +236,8 @@ on:
# tags:
# - '**'
#
# merge_group:
#
# ...and many more
@@ -251,14 +255,13 @@ jobs:
runs-on: ubuntu-latest # windows-latest || macos-latest
name: Test changed-files
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
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@v37
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
...
```
@@ -287,7 +285,7 @@ Support this project with a :star:
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
## Useful Acronyms
## Useful Acronyms 🧮
| Acronym | Meaning |
|:---------:|:------------:|
@@ -300,105 +298,115 @@ Support this project with a :star:
| U | Unmerged |
| X | Unknown |
## Outputs
> **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 📤
<!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section -->
| OUTPUT | TYPE | DESCRIPTION |
|--------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| added\_files | string | Returns only files that are <br>Added (A). |
| added\_files\_count | string | Returns the number of `added_files` |
| all\_changed\_and\_modified\_files | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
| all\_changed\_and\_modified\_files\_count | string | Returns the number of `all_changed_and_modified_files` |
| all\_changed\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
| all\_changed\_files\_count | string | Returns the number of `all_changed_files` |
| all\_modified\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
| all\_modified\_files\_count | string | Returns the number of `all_modified_files` |
| 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) |
| all\_old\_new\_renamed\_files\_count | string | Returns the number of `all_old_new_renamed_files` |
| 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)*. |
| 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) |
| 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)*. |
| copied\_files | string | Returns only files that are <br>Copied (C). |
| copied\_files\_count | string | Returns the number of `copied_files` |
| deleted\_files | string | Returns only files that are <br>Deleted (D). |
| deleted\_files\_count | string | Returns the number of `deleted_files` |
| modified\_files | string | Returns only files that are <br>Modified (M). |
| modified\_files\_count | string | Returns the number of `modified_files` |
| 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)*. |
| only\_deleted | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been deleted. (D) |
| only\_modified | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been modified. (ACMRD). |
| 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)*. |
| other\_changed\_files\_count | string | Returns the number of `other_changed_files` |
| 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)* |
| other\_deleted\_files\_count | string | Returns the number of `other_deleted_files` |
| 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)* |
| other\_modified\_files\_count | string | Returns the number of `other_modified_files` |
| renamed\_files | string | Returns only files that are <br>Renamed (R). |
| renamed\_files\_count | string | Returns the number of `renamed_files` |
| type\_changed\_files | string | Returns only files that have <br>their file type changed (T). |
| type\_changed\_files\_count | string | Returns the number of `type_changed_files` |
| unknown\_files | string | Returns only files that are <br>Unknown (X). |
| unknown\_files\_count | string | Returns the number of `unknown_files` |
| unmerged\_files | string | Returns only files that are <br>Unmerged (U). |
| unmerged\_files\_count | string | Returns the number of `unmerged_files` |
| OUTPUT | TYPE | DESCRIPTION |
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <a name="output_added_files"></a>[added\_files](#output_added_files) | string | Returns only files that are <br>Added (A). |
| <a name="output_added_files_count"></a>[added\_files\_count](#output_added_files_count) | string | Returns the number of `added_files` |
| <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
| <a name="output_all_changed_and_modified_files_count"></a>[all\_changed\_and\_modified\_files\_count](#output_all_changed_and_modified_files_count) | string | Returns the number of `all_changed_and_modified_files` |
| <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
| <a name="output_all_changed_files_count"></a>[all\_changed\_files\_count](#output_all_changed_files_count) | string | Returns the number of `all_changed_files` |
| <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
| <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>*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. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
| <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. *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. *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_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` |
| <a name="output_type_changed_files"></a>[type\_changed\_files](#output_type_changed_files) | string | Returns only files that have <br>their file type changed (T). |
| <a name="output_type_changed_files_count"></a>[type\_changed\_files\_count](#output_type_changed_files_count) | string | Returns the number of `type_changed_files` |
| <a name="output_unknown_files"></a>[unknown\_files](#output_unknown_files) | string | Returns only files that are <br>Unknown (X). |
| <a name="output_unknown_files_count"></a>[unknown\_files\_count](#output_unknown_files_count) | string | Returns the number of `unknown_files` |
| <a name="output_unmerged_files"></a>[unmerged\_files](#output_unmerged_files) | string | Returns only files that are <br>Unmerged (U). |
| <a name="output_unmerged_files_count"></a>[unmerged\_files\_count](#output_unmerged_files_count) | string | Returns the number of `unmerged_files` |
<!-- AUTO-DOC-OUTPUT:END -->
## Inputs
## Inputs ⚙️
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|----------------------------------------------|--------|----------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| api\_url | string | false | `"${{ github.api_url }}"` | Github API URL. |
| base\_sha | string | false | | Specify a different base commit <br>SHA used for comparing changes |
| diff\_relative | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
| dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. |
| dir\_names\_exclude\_current\_dir | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. |
| dir\_names\_max\_depth | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. |
| escape\_json | string | false | `"true"` | Escape JSON output. |
| fetch\_depth | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
| files | string | false | | File and directory patterns used <br>to detect changes (Defaults to the entire repo if unset) **NOTE:** <br>Multiline file/directory patterns should not <br>include quotes. |
| files\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files` input. |
| files\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input |
| files\_ignore | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. |
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore` input |
| files\_ignore\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input |
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore` input |
| files\_ignore\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>ignore changes |
| files\_ignore\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
| files\_ignore\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_yaml_from_source_file` input |
| files\_separator | string | false | `"\n"` | Separator used to split the <br>`files` input |
| files\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>detect changes |
| 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) |
| files\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` 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). |
| json | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. |
| old\_new\_files\_separator | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
| old\_new\_separator | string | false | `","` | Split character for old and <br>new filename pairs. |
| output\_dir | string | false | `".github/outputs"` | Directory to store output files. |
| output\_renamed\_files\_as\_deleted\_and\_added | string | false | `"false"` | Output renamed files as deleted <br>and added files. |
| path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
| quotepath | string | false | `"true"` | Use non-ascii characters to match <br>files and output the filenames <br>completely verbatim by setting this <br>to `false` |
| recover\_deleted\_files | string | false | `"false"` | Recover deleted files. |
| recover\_deleted\_files\_to\_destination | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. |
| recover\_files | string | false | | File and directory patterns used <br>to recover deleted files, defaults <br>to the patterns provided via <br>the `files`, `files_from_source_file`, `files_ignore` and <br>`files_ignore_from_source_file` inputs or all deleted <br>files if no patterns are <br>provided. |
| recover\_files\_ignore | string | false | | File and directory patterns to <br>ignore when recovering deleted files. |
| recover\_files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`recover_files_ignore` input |
| recover\_files\_separator | string | false | `"\n"` | Separator used to split the <br>`recover_files` input |
| separator | string | false | `" "` | Split character for output strings |
| sha | string | false | | Specify a different commit SHA <br>used for comparing changes |
| since | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. |
| since\_last\_remote\_commit | string | false | `"false"` | Use the last commit on <br>the remote branch as the <br>`base_sha`. Defaults to the last <br>non-merge commit on the target <br>branch for pull request events <br>and the previous remote commit <br>of the current branch for <br>push events. |
| skip\_initial\_fetch | string | false | `"false"` | Skip the initial fetch to <br>improve performance for shallow repositories. <br>**NOTE**: This could lead to <br>errors with missing history and <br>the intended use is limited <br>to when you've fetched the <br>history necessary to perform the <br>diff. |
| token | string | false | `"${{ github.token }}"` | Github token used to fetch <br>changed files from Github's API. |
| until | string | false | | Get changed files for commits <br>whose timestamp is earlier than <br>the given time. |
| write\_output\_files | string | false | `"false"` | Write outputs to the `output_dir` <br>defaults to `.github/outputs` folder. **NOTE:** <br>This creates a `.txt` file <br>by default and a `.json` <br>file if `json` is set <br>to `true`. |
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <a name="input_api_url"></a>[api\_url](#input_api_url) | string | false | `"${{ github.api_url }}"` | Github API URL. |
| <a name="input_base_sha"></a>[base\_sha](#input_base_sha) | string | false | | Specify a different base commit <br>SHA used for comparing changes |
| <a name="input_diff_relative"></a>[diff\_relative](#input_diff_relative) | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
| <a name="input_dir_names"></a>[dir\_names](#input_dir_names) | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. |
| <a name="input_dir_names_exclude_current_dir"></a>[dir\_names\_exclude\_current\_dir](#input_dir_names_exclude_current_dir) | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. |
| <a name="input_dir_names_include_files"></a>[dir\_names\_include\_files](#input_dir_names_include_files) | string | false | | Include files in the output <br>when `dir_names` is set to <br>`true`. **NOTE:** This returns only <br>the matching files and also <br>the directory names. |
| <a name="input_dir_names_include_files_separator"></a>[dir\_names\_include\_files\_separator](#input_dir_names_include_files_separator) | string | false | `"\n"` | Separator used to split the <br>`dir_names_include_files` input |
| <a name="input_dir_names_max_depth"></a>[dir\_names\_max\_depth](#input_dir_names_max_depth) | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. |
| <a name="input_escape_json"></a>[escape\_json](#input_escape_json) | string | false | `"true"` | Escape JSON output. |
| <a name="input_fail_on_initial_diff_error"></a>[fail\_on\_initial\_diff\_error](#input_fail_on_initial_diff_error) | string | false | `"false"` | Fail when the initial diff <br>fails. |
| <a name="input_fail_on_submodule_diff_error"></a>[fail\_on\_submodule\_diff\_error](#input_fail_on_submodule_diff_error) | string | false | `"false"` | Fail when the submodule diff <br>fails. |
| <a name="input_fetch_additional_submodule_history"></a>[fetch\_additional\_submodule\_history](#input_fetch_additional_submodule_history) | string | false | `"false"` | Fetch additional history for submodules. |
| <a name="input_fetch_depth"></a>[fetch\_depth](#input_fetch_depth) | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
| <a name="input_files"></a>[files](#input_files) | string | false | | File and directory patterns used <br>to detect changes (Defaults to the entire repo if unset) **NOTE:** <br>Multiline file/directory patterns should not <br>include quotes. |
| <a name="input_files_from_source_file"></a>[files\_from\_source\_file](#input_files_from_source_file) | string | false | | Source file(s) used to populate <br>the `files` input. |
| <a name="input_files_from_source_file_separator"></a>[files\_from\_source\_file\_separator](#input_files_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input |
| <a name="input_files_ignore"></a>[files\_ignore](#input_files_ignore) | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. |
| <a name="input_files_ignore_from_source_file"></a>[files\_ignore\_from\_source\_file](#input_files_ignore_from_source_file) | string | false | | Source file(s) used to populate <br>the `files_ignore` input |
| <a name="input_files_ignore_from_source_file_separator"></a>[files\_ignore\_from\_source\_file\_separator](#input_files_ignore_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input |
| <a name="input_files_ignore_separator"></a>[files\_ignore\_separator](#input_files_ignore_separator) | string | false | `"\n"` | Separator used to split the <br>`files_ignore` input |
| <a name="input_files_ignore_yaml"></a>[files\_ignore\_yaml](#input_files_ignore_yaml) | string | false | | YAML used to define a <br>set of file patterns to <br>ignore changes |
| <a name="input_files_ignore_yaml_from_source_file"></a>[files\_ignore\_yaml\_from\_source\_file](#input_files_ignore_yaml_from_source_file) | string | false | | Source file(s) used to populate <br>the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
| <a name="input_files_ignore_yaml_from_source_file_separator"></a>[files\_ignore\_yaml\_from\_source\_file\_separator](#input_files_ignore_yaml_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_ignore_yaml_from_source_file` input |
| <a name="input_files_separator"></a>[files\_separator](#input_files_separator) | string | false | `"\n"` | Separator used to split the <br>`files` input |
| <a name="input_files_yaml"></a>[files\_yaml](#input_files_yaml) | string | false | | YAML used to define a <br>set of file patterns to <br>detect changes |
| <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. [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. |
| <a name="input_output_renamed_files_as_deleted_and_added"></a>[output\_renamed\_files\_as\_deleted\_and\_added](#input_output_renamed_files_as_deleted_and_added) | string | false | `"false"` | Output renamed files as deleted <br>and added files. |
| <a name="input_path"></a>[path](#input_path) | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
| <a name="input_quotepath"></a>[quotepath](#input_quotepath) | string | false | `"true"` | Use non-ascii characters to match <br>files and output the filenames <br>completely verbatim by setting this <br>to `false` |
| <a name="input_recover_deleted_files"></a>[recover\_deleted\_files](#input_recover_deleted_files) | string | false | `"false"` | Recover deleted files. |
| <a name="input_recover_deleted_files_to_destination"></a>[recover\_deleted\_files\_to\_destination](#input_recover_deleted_files_to_destination) | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. |
| <a name="input_recover_files"></a>[recover\_files](#input_recover_files) | string | false | | File and directory patterns used <br>to recover deleted files, defaults <br>to the patterns provided via <br>the `files`, `files_from_source_file`, `files_ignore` and <br>`files_ignore_from_source_file` inputs or all deleted <br>files if no patterns are <br>provided. |
| <a name="input_recover_files_ignore"></a>[recover\_files\_ignore](#input_recover_files_ignore) | string | false | | File and directory patterns to <br>ignore when recovering deleted files. |
| <a name="input_recover_files_ignore_separator"></a>[recover\_files\_ignore\_separator](#input_recover_files_ignore_separator) | string | false | `"\n"` | Separator used to split the <br>`recover_files_ignore` input |
| <a name="input_recover_files_separator"></a>[recover\_files\_separator](#input_recover_files_separator) | string | false | `"\n"` | Separator used to split the <br>`recover_files` input |
| <a name="input_separator"></a>[separator](#input_separator) | string | false | `" "` | Split character for output strings |
| <a name="input_sha"></a>[sha](#input_sha) | string | false | | Specify a different commit SHA <br>used for comparing changes |
| <a name="input_since"></a>[since](#input_since) | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. |
| <a name="input_since_last_remote_commit"></a>[since\_last\_remote\_commit](#input_since_last_remote_commit) | string | false | `"false"` | Use the last commit on <br>the remote branch as the <br>`base_sha`. Defaults to the last <br>non-merge commit on the target <br>branch for pull request events <br>and the previous remote commit <br>of the current branch for <br>push events. |
| <a name="input_skip_initial_fetch"></a>[skip\_initial\_fetch](#input_skip_initial_fetch) | string | false | `"false"` | Skip the initial fetch to <br>improve performance for shallow repositories. <br>**NOTE**: This could lead to <br>errors with missing history and <br>the intended use is limited <br>to when you've fetched the <br>history necessary to perform the <br>diff. |
| <a name="input_token"></a>[token](#input_token) | string | false | `"${{ github.token }}"` | Github token used to fetch <br>changed files from Github's API. |
| <a name="input_until"></a>[until](#input_until) | string | false | | Get changed files for commits <br>whose timestamp is earlier than <br>the given time. |
| <a name="input_write_output_files"></a>[write\_output\_files](#input_write_output_files) | string | false | `"false"` | Write outputs to the `output_dir` <br>defaults to `.github/outputs` folder. **NOTE:** <br>This creates a `.txt` file <br>by default and a `.json` <br>file if `json` is set <br>to `true`. |
<!-- AUTO-DOC-INPUT:END -->
## Versioning
## Versioning 🏷️
This GitHub Action follows the principles of [Semantic Versioning](https://semver.org) for versioning releases.
@@ -410,7 +418,7 @@ The format of the version string is as follows:
* patch: indicates bug fixes or other small changes that are backward compatible.
## Examples
## Examples 📄
<details>
<summary>Get all changed files in the current branch</summary>
@@ -419,7 +427,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
...
```
@@ -432,7 +440,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@v37
uses: tj-actions/changed-files@v39
with:
separator: ","
...
@@ -449,7 +457,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
- name: List all added files
run: |
@@ -470,7 +478,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
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')
@@ -530,7 +538,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
files: |
my-file.txt
@@ -538,7 +546,7 @@ See [outputs](#outputs) for a list of all available outputs.
*.png
!*.md
test_directory
**.sql
**/*.sql
...
```
@@ -553,7 +561,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
files: |
my-file.txt
@@ -561,7 +569,7 @@ See [inputs](#inputs) for more information.
*.png
!*.md
test_directory
**.sql
**/*.sql
- name: Run step if any of the listed files above change
if: steps.changed-files-specific.outputs.any_changed == 'true'
@@ -600,7 +608,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@v37
uses: tj-actions/changed-files@v39
with:
files_from_source_file: test/changed-files-list.txt
...
@@ -617,7 +625,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@v37
uses: tj-actions/changed-files@v39
with:
files_from_source_file: |
test/changed-files-list.txt
@@ -638,7 +646,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different SHA
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
sha: ${{ github.event.pull_request.head.sha }}
...
@@ -655,7 +663,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different base SHA
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ github.event.pull_request.base.sha }}
...
@@ -681,17 +689,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
- name: Get changed files in the .github folder
id: changed-files-specific
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
files: .github/**
@@ -714,14 +722,14 @@ See [inputs](#inputs) for more information.
```yaml
...
- name: Checkout into dir1
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
path: dir1
- name: Run changed-files with defaults in dir1
id: changed-files-for-dir1
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
path: dir1
@@ -744,7 +752,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with quotepath disabled
id: changed-files-quotepath
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
quotepath: "false"
@@ -783,7 +791,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@v37
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
...
@@ -810,7 +818,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@v37
uses: tj-actions/changed-files@v39
with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
...
@@ -820,7 +828,9 @@ See [inputs](#inputs) for more information.
</li>
</ul>
> **Warning**: This setting overrides the commit sha used by setting `since_last_remote_commit` to true.
> **Warning**
>
> This setting overrides the commit sha used by setting `since_last_remote_commit` to true.
> It is recommended to use either solution that works for your use case.
See [inputs](#inputs) for more information.
@@ -834,7 +844,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with dir_names
id: changed-files-dir-names
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
dir_names: "true"
...
@@ -851,7 +861,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with JSON output
id: changed-files-json
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v39
with:
json: "true"
...
@@ -868,13 +878,13 @@ See [inputs](#inputs) for more information.
...
- name: Get changed-files since 2022-08-19
id: changed-files-since
uses: tj-actions/changed-files@v37
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@v37
uses: tj-actions/changed-files@v39
with:
until: "2022-08-20"
...
@@ -884,7 +894,9 @@ See [inputs](#inputs) for more information.
</details>
## Real-world usage
## Real-world usage 🌐
### Open source projects 📦
* [vitejs/vite: uses tj-actions/changed-files to automate testing](https://github.com/vitejs/vite/blob/8da04227d6f818a8ad9efc0056101968037c2e36/.github/workflows/ci.yml#L61)
@@ -902,20 +914,24 @@ See [inputs](#inputs) for more information.
* [nhost: uses tj-actions/changed-files to automate testing based on changes detected](https://github.com/nhost/nhost/blob/main/.github/workflows/ci.yaml#L44-L48)
![image](https://github.com/tj-actions/changed-files/assets/17484350/23767413-4c51-42fb-ab1c-39ef72c44904)
* [qmk\_firmware uses tj-actions/changed-files to run linters](https://github.com/qmk/qmk_firmware/blob/7a737235ffd49c32d2c5561e8fe53fd96baa7f96/.github/workflows/lint.yml#L30)
And many more...
## Known Limitation
### Scalability Example 📈
> **Warning**:
![image](https://github.com/tj-actions/changed-files/assets/17484350/23767413-4c51-42fb-ab1c-39ef72c44904)
## Known Limitation ⚠️
> **Warning**
>
> * Spaces in file names can introduce bugs when using bash loops. See: [#216](https://github.com/tj-actions/changed-files/issues/216)
> However, this action will handle spaces in file names, with a recommendation of using a separator to prevent any hidden issues.
>
> ![Screen Shot 2021-10-23 at 9 37 34 AM](https://user-images.githubusercontent.com/17484350/138558767-b13c90bf-a1ae-4e86-9520-70a6a4624f41.png)
## Migration guide
## Migration guide 🔄
With the switch from using grep's Extended regex to match files to the natively supported workflow glob pattern matching syntax introduced in [v13](https://github.com/tj-actions/changed-files/releases/tag/v13) you'll need to modify patterns used to match `files`.
@@ -929,14 +945,13 @@ With the switch from using grep's Extended regex to match files to the natively
- \.sh$
- .(sql|py)$
- ^(dir1|dir2)
+ *.{sh,sql,py}
+ dir1
+ dir2
+ **/*.{sh,sql,py}
+ {dir1,dir2}/**
```
* Free software: [MIT license](LICENSE)
## Credits
## Credits 👏
This package was created with [cookiecutter-action](https://github.com/tj-actions/cookiecutter-action).
@@ -947,7 +962,7 @@ This package was created with [cookiecutter-action](https://github.com/tj-action
* [tj-actions/demo3](https://github.com/tj-actions/demo3)
* [tj-actions/release-tagger](https://github.com/tj-actions/release-tagger)
## Report Bugs
## Report Bugs 🐛
Report bugs at https://github.com/tj-actions/changed-files/issues.

View File

@@ -112,8 +112,16 @@ inputs:
description: "Exclude the current directory represented by `.` from the output when `dir_names` is set to `true`."
required: false
default: "false"
dir_names_include_files:
description: "Include files in the output when `dir_names` is set to `true`. **NOTE:** This returns only the matching files and also the directory names."
required: false
default: ""
dir_names_include_files_separator:
description: "Separator used to split the `dir_names_include_files` input"
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:
@@ -128,6 +136,10 @@ inputs:
description: "Skip the initial fetch to improve performance for shallow repositories. **NOTE**: This could lead to errors with missing history and the intended use is limited to when you've fetched the history necessary to perform the diff."
required: false
default: "false"
fetch_additional_submodule_history:
description: "Fetch additional history for submodules."
required: false
default: "false"
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."
required: false
@@ -176,6 +188,14 @@ inputs:
description: "Github API URL."
required: false
default: ${{ github.api_url }}
fail_on_initial_diff_error:
description: "Fail when the initial diff fails."
required: false
default: "false"
fail_on_submodule_diff_error:
description: "Fail when the submodule diff fails."
required: false
default: "false"
outputs:
added_files:
@@ -223,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:
@@ -235,7 +255,7 @@ 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:
@@ -252,7 +272,7 @@ outputs:
description: "Returns the number of `other_deleted_files`"
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
branding:

932
dist/index.js generated vendored

File diff suppressed because it is too large Load Diff

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": "37.4.0",
"version": "39.0.2",
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
"main": "lib/main.js",
"publishConfig": {
@@ -10,7 +10,7 @@
"build": "tsc",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"lint": "eslint **/*.ts --max-warnings 0",
"lint:fix": "eslint --fix src/**/*.ts",
"package": "ncc build lib/main.js --source-map --license licenses.txt",
"test": "jest --coverage",
@@ -35,7 +35,7 @@
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1",
"@octokit/rest": "^19.0.13",
"@octokit/rest": "^20.0.1",
"lodash": "^4.17.21",
"micromatch": "^4.0.5",
"yaml": "^2.3.1"
@@ -48,11 +48,12 @@
"@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",
"eslint-plugin-prettier": "^5.0.0-alpha.2",
"eslint-config-prettier": "^9.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.0",

578
src/__tests__/utils.test.ts Normal file
View File

@@ -0,0 +1,578 @@
import {ChangeTypeEnum} from '../changedFiles'
import {
getDirname,
getDirnameMaxDepth,
getFilteredChangedFiles,
normalizeSeparators
} from '../utils'
const originalPlatform = process.platform
function mockedPlatform(platform: string): void {
Object.defineProperty(process, 'platform', {
value: platform
})
}
describe('utils test', () => {
afterEach(() => {
Object.defineProperty(process, 'platform', {
value: originalPlatform
})
})
describe('getDirnameMaxDepth_function', () => {
// Tests that the function returns the correct dirname when the relative path has multiple directories
it('test_multiple_directories', () => {
const result = getDirnameMaxDepth({
relativePath: 'path/to/some/file',
dirNamesMaxDepth: 2,
excludeCurrentDir: false
})
expect(result).toEqual('path/to')
})
// Tests that the function returns the correct dirname when the relative path has only one directory
it('test_single_directory', () => {
const result = getDirnameMaxDepth({
relativePath: 'path/to',
dirNamesMaxDepth: 1,
excludeCurrentDir: false
})
expect(result).toEqual('path')
})
// Tests that the function returns the correct dirname when the relative path has no directories
it('test_no_directories', () => {
const result = getDirnameMaxDepth({
relativePath: 'file.txt',
dirNamesMaxDepth: 1,
excludeCurrentDir: false
})
expect(result).toEqual('.')
})
// Tests that the function returns the correct dirname when dirNamesMaxDepth is set to a value less than the number of directories in the relative path
it('test_dirnames_max_depth_less_than_num_directories', () => {
const result = getDirnameMaxDepth({
relativePath: 'path/to/some/file',
dirNamesMaxDepth: 1,
excludeCurrentDir: false
})
expect(result).toEqual('path')
})
// Tests that the function returns an empty string when excludeCurrentDir is true and the output is '.'
it('test_exclude_current_dir_is_true_and_output_is_dot', () => {
const result = getDirnameMaxDepth({
relativePath: '.',
dirNamesMaxDepth: 1,
excludeCurrentDir: true
})
expect(result).toEqual('')
})
// Tests that the function returns the correct dirname when the relative path is a Windows drive root and excludeCurrentDir is true
it('test_windows_drive_root_and_exclude_current_dir_is_true', () => {
mockedPlatform('win32')
const result = getDirnameMaxDepth({
relativePath: 'C:\\',
dirNamesMaxDepth: 1,
excludeCurrentDir: true
})
expect(result).toEqual('')
})
// Tests that getDirnameMaxDepth handles a relative path with a trailing separator correctly
it('test_trailing_separator', () => {
const input = {
relativePath: 'path/to/dir/',
dirNamesMaxDepth: 2,
excludeCurrentDir: true
}
const expectedOutput = 'path/to'
const actualOutput = getDirnameMaxDepth(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that getDirnameMaxDepth returns an empty string when excludeCurrentDir is true and the output is '.'
it('test_trailing_separator_exclude_current_dir', () => {
const input = {
relativePath: 'file',
excludeCurrentDir: true
}
const expectedOutput = ''
const actualOutput = getDirnameMaxDepth(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that getDirnameMaxDepth returns the correct output for a Windows UNC root path
it('test_windows_unc_root', () => {
mockedPlatform('win32')
const input = {
relativePath: '\\hello',
dirNamesMaxDepth: 2,
excludeCurrentDir: true
}
const expectedOutput = ''
expect(getDirnameMaxDepth(input)).toEqual(expectedOutput)
})
// Tests that getDirnameMaxDepth returns an empty string when given a Windows UNC root and excludeCurrentDir is true
it('test_windows_unc_root_exclude_current_dir', () => {
mockedPlatform('win32')
const relativePath = '\\hello'
const result = getDirnameMaxDepth({
relativePath,
excludeCurrentDir: true
})
expect(result).toEqual('')
})
// Tests that getDirnameMaxDepth returns the correct dirname with a relative path that contains both forward and backward slashes
it('test_relative_path_with_slashes', () => {
const relativePath = 'path/to\file'
const expectedOutput = 'path'
const actualOutput = getDirnameMaxDepth({relativePath})
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that getDirnameMaxDepth returns the correct dirname for a relative path that contains special characters
it('test_special_characters', () => {
const relativePath =
'path/with/special/characters/!@#$%^&*()_+{}|:<>?[];,./'
const expectedDirname = 'path/with/special/characters'
const actualDirname = getDirnameMaxDepth({relativePath})
expect(actualDirname).toEqual(expectedDirname)
})
})
describe('getDirname_function', () => {
// Tests that the function returns the correct dirname for a valid path
it('test valid path', () => {
expect(getDirname('/path/to/file')).toEqual('/path/to')
})
// Tests that the function returns the correct dirname for a valid Windows UNC root path
it('test windows unc root path', () => {
mockedPlatform('win32')
expect(getDirname('\\helloworld')).toEqual('.')
})
// Tests that the function returns the correct dirname for a path with a trailing slash
it('test path with trailing slash', () => {
expect(getDirname('/path/to/file/')).toEqual('/path/to')
})
// Tests that the function returns the correct dirname for a Windows UNC root path with a trailing slash
it('test windows unc root path with trailing slash', () => {
mockedPlatform('win32')
expect(getDirname('\\hello\\world\\')).toEqual('.')
})
// Tests that the function returns the correct dirname for a path with multiple slashes
it('test path with multiple slashes', () => {
expect(getDirname('/path//to/file')).toEqual('/path/to')
})
// Tests that the function returns the correct dirname for a Windows UNC root path with multiple slashes
it('test windows unc root path with multiple slashes', () => {
mockedPlatform('win32')
expect(getDirname('\\hello\\world')).toEqual('.')
})
})
describe('normalizeSeparators_function', () => {
// Tests that forward slashes are normalized on Linux
it('test forward slashes linux', () => {
const input = 'path/to/file'
const expectedOutput = 'path/to/file'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that backslashes are normalized on Windows
it('test backslashes windows', () => {
mockedPlatform('win32')
const input = 'path\\to\\file'
const expectedOutput = 'path\\to\\file'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that forward slashes are normalized on Windows
it('test mixed slashes windows', () => {
mockedPlatform('win32')
const input = 'path/to/file'
const expectedOutput = 'path\\to\\file'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that mixed slashes are normalized on Windows
it('test mixed slashes windows', () => {
mockedPlatform('win32')
const input = 'path\\to/file'
const expectedOutput = 'path\\to\\file'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that an empty string returns an empty string
it('test empty string', () => {
const input = ''
const expectedOutput = ''
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that multiple consecutive slashes are removed
it('test multiple consecutive slashes', () => {
const input = 'path//to//file'
const expectedOutput = 'path/to/file'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that UNC format is preserved on Windows
it('test unc format windows', () => {
mockedPlatform('win32')
const input = '\\\\hello\\world'
const expectedOutput = '\\\\hello\\world'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
// Tests that a drive root is preserved on Windows
it('test drive root windows', () => {
mockedPlatform('win32')
const input = 'C:\\'
const expectedOutput = 'C:\\'
const actualOutput = normalizeSeparators(input)
expect(actualOutput).toEqual(expectedOutput)
})
})
describe('getFilteredChangedFiles', () => {
// Tests that the function returns an empty object when allDiffFiles and filePatterns are empty
it('should return an empty object when allDiffFiles and filePatterns are empty', async () => {
const result = await getFilteredChangedFiles({
allDiffFiles: {
[ChangeTypeEnum.Added]: [],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
},
filePatterns: []
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: [],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns allDiffFiles when filePatterns is empty
it('should return allDiffFiles when filePatterns is empty', async () => {
const allDiffFiles = {
[ChangeTypeEnum.Added]: ['file1.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: []
})
expect(result).toEqual(allDiffFiles)
})
// Tests that the function returns an empty object when allDiffFiles is empty
it('should return an empty object when allDiffFiles is empty', async () => {
const result = await getFilteredChangedFiles({
allDiffFiles: {
[ChangeTypeEnum.Added]: [],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
},
filePatterns: ['*.txt']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: [],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns only the files that match the file patterns on non windows platforms
it('should return only the files that match the file patterns', async () => {
const allDiffFiles = {
[ChangeTypeEnum.Added]: [
'file1.txt',
'file2.md',
'file3.txt',
'test/dir/file4.txt',
'test/dir/file5.txt',
'dir/file6.md'
],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['*.txt']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: ['file1.txt', 'file3.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns only the files that match the file patterns on windows
it('should return only the files that match the file patterns on windows', async () => {
mockedPlatform('win32')
const allDiffFiles = {
[ChangeTypeEnum.Added]: [
'file1.txt',
'file2.md',
'file3.txt',
'test\\dir\\file4.txt',
'test\\dir\\file5.txt',
'dir\\file6.md'
],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['*.txt']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: ['file1.txt', 'file3.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns only the files that match the file patterns with globstar on non windows platforms
it('should return only the files that match the file patterns with globstar', async () => {
const allDiffFiles = {
[ChangeTypeEnum.Added]: [
'file1.txt',
'file2.md',
'file3.txt',
'test/dir/file4.txt',
'test/dir/file5.txt',
'dir/file6.md'
],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['**.txt']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: [
'file1.txt',
'file3.txt',
'test/dir/file4.txt',
'test/dir/file5.txt'
],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns only the files that match the file patterns with globstar on windows
it('should return only the files that match the file patterns with globstar on windows', async () => {
mockedPlatform('win32')
const allDiffFiles = {
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['test/**']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function returns an empty object when there are no files that match the file patterns
it('should return an empty object when there are no files that match the file patterns', async () => {
const allDiffFiles = {
[ChangeTypeEnum.Added]: ['file1.md', 'file2.md', 'file3.md'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['*.txt']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: [],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that the function can handle file names with special characters
it('should handle file names with special characters', async () => {
const allDiffFiles = {
[ChangeTypeEnum.Added]: [
'file1.txt',
'file2 with spaces.txt',
'file3$$.txt'
],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const result = await getFilteredChangedFiles({
allDiffFiles,
filePatterns: ['file2*.txt']
})
expect(result).toEqual({
[ChangeTypeEnum.Added]: ['file2 with spaces.txt'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
})
})
// Tests that getFilteredChangedFiles correctly filters files using glob patterns
it('should filter files using glob patterns', async () => {
const allDiffFiles = {
[ChangeTypeEnum.Added]: ['test/migrations/test.sql'],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const filePatterns = ['test/migrations/**']
const filteredFiles = await getFilteredChangedFiles({
allDiffFiles,
filePatterns
})
expect(filteredFiles[ChangeTypeEnum.Added]).toEqual([
'test/migrations/test.sql'
])
})
// Tests that getFilteredChangedFiles correctly filters files using ignore glob patterns
it('should filter files using ignore glob patterns', async () => {
const allDiffFiles = {
[ChangeTypeEnum.Added]: [],
[ChangeTypeEnum.Copied]: [],
[ChangeTypeEnum.Deleted]: [],
[ChangeTypeEnum.Modified]: [
'assets/scripts/configure-minikube-linux.sh'
],
[ChangeTypeEnum.Renamed]: [],
[ChangeTypeEnum.TypeChanged]: [],
[ChangeTypeEnum.Unmerged]: [],
[ChangeTypeEnum.Unknown]: []
}
const filePatterns = [
'assets/scripts/**.sh',
'!assets/scripts/configure-minikube-linux.sh'
]
const filteredFiles = await getFilteredChangedFiles({
allDiffFiles,
filePatterns
})
expect(filteredFiles[ChangeTypeEnum.Modified]).toEqual([])
})
})
})

View File

@@ -2,18 +2,89 @@ import * as core from '@actions/core'
import * as github from '@actions/github'
import type {RestEndpointMethodTypes} from '@octokit/rest'
import flatten from 'lodash/flatten'
import mm from 'micromatch'
import * as path from 'path'
import {setChangedFilesOutput} from './changedFilesOutput'
import {DiffResult} from './commitSha'
import {Inputs} from './inputs'
import {
canDiffCommits,
getAllChangedFiles,
getDirnameMaxDepth,
getDirNamesIncludeFilesPattern,
getFilteredChangedFiles,
gitRenamedFiles,
gitSubmoduleDiffSHA,
isWindows,
jsonOutput
} 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 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()
}
}
export const getRenamedFiles = async ({
inputs,
workingDirectory,
@@ -51,11 +122,29 @@ export const getRenamedFiles = async ({
)
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
let diff = '...'
if (
!(await canDiffCommits({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff
}))
) {
let message = `Unable to use three dot diff for: ${submodulePath} submodule. Falling back to two dot diff. You can set 'fetch_additional_submodule_history: true' to fetch additional submodule history in order to use three dot diff`
if (inputs.fetchSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`
}
core.info(message)
diff = '..'
}
const submoduleRenamedFiles = await gitRenamedFiles({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff: diffResult.diff,
diff,
oldNewSeparator: inputs.oldNewSeparator,
isSubmodule: true,
parentDir: submodulePath
@@ -98,20 +187,27 @@ export const getAllDiffFiles = async ({
hasSubmodule,
diffResult,
submodulePaths,
outputRenamedFilesAsDeletedAndAdded
outputRenamedFilesAsDeletedAndAdded,
fetchSubmoduleHistory,
failOnInitialDiffError,
failOnSubmoduleDiffError
}: {
workingDirectory: string
hasSubmodule: boolean
diffResult: DiffResult
submodulePaths: string[]
outputRenamedFilesAsDeletedAndAdded: boolean
fetchSubmoduleHistory: boolean
failOnInitialDiffError: boolean
failOnSubmoduleDiffError: boolean
}): Promise<ChangedFiles> => {
const files = await getAllChangedFiles({
cwd: workingDirectory,
sha1: diffResult.previousSha,
sha2: diffResult.currentSha,
diff: diffResult.diff,
outputRenamedFilesAsDeletedAndAdded
outputRenamedFilesAsDeletedAndAdded,
failOnInitialDiffError
})
if (hasSubmodule) {
@@ -130,14 +226,33 @@ export const getAllDiffFiles = async ({
)
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
let diff = '...'
if (
!(await canDiffCommits({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff
}))
) {
let message = `Set 'fetch_additional_submodule_history: true' to fetch additional submodule history for: ${submodulePath}`
if (fetchSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`
}
core.warning(message)
diff = '..'
}
const submoduleFiles = await getAllChangedFiles({
cwd: submoduleWorkingDirectory,
sha1: submoduleShaResult.previousSha,
sha2: submoduleShaResult.currentSha,
diff: diffResult.diff,
diff,
isSubmodule: true,
parentDir: submodulePath,
outputRenamedFilesAsDeletedAndAdded
outputRenamedFilesAsDeletedAndAdded,
failOnSubmoduleDiffError
})
for (const changeType of Object.keys(
@@ -155,6 +270,35 @@ export const getAllDiffFiles = async ({
return files
}
function* getFilePaths({
inputs,
filePaths,
dirNamesIncludeFilePatterns
}: {
inputs: Inputs
filePaths: string[]
dirNamesIncludeFilePatterns: string[]
}): Generator<string> {
for (const filePath of filePaths) {
if (inputs.dirNames) {
if (dirNamesIncludeFilePatterns.length > 0) {
const isWin = isWindows()
const matchOptions = {dot: true, windows: isWin, noext: true}
if (mm.isMatch(filePath, dirNamesIncludeFilePatterns, matchOptions)) {
yield filePath
}
}
yield getDirnameMaxDepth({
relativePath: filePath,
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
})
} else {
yield filePath
}
}
}
function* getChangeTypeFilesGenerator({
inputs,
changedFiles,
@@ -164,18 +308,21 @@ function* getChangeTypeFilesGenerator({
changedFiles: ChangedFiles
changeTypes: ChangeTypeEnum[]
}): Generator<string> {
const dirNamesIncludeFilePatterns = getDirNamesIncludeFilesPattern({inputs})
core.debug(
`Dir names include file patterns: ${JSON.stringify(
dirNamesIncludeFilePatterns
)}`
)
for (const changeType of changeTypes) {
const files = changedFiles[changeType] || []
for (const file of files) {
if (inputs.dirNames) {
yield getDirnameMaxDepth({
pathStr: file,
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
})
} else {
yield file
}
const filePaths = changedFiles[changeType] || []
for (const filePath of getFilePaths({
inputs,
filePaths,
dirNamesIncludeFilePatterns
})) {
yield filePath
}
}
}
@@ -188,20 +335,15 @@ export const getChangeTypeFiles = async ({
inputs: Inputs
changedFiles: ChangedFiles
changeTypes: ChangeTypeEnum[]
}): Promise<{paths: string; count: string}> => {
}): Promise<{paths: string[] | string; count: string}> => {
const files = [
...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes}))
].filter(Boolean)
if (inputs.json) {
return {
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
count: files.length.toString()
}
}
const paths = inputs.json ? files : files.join(inputs.separator)
return {
paths: files.join(inputs.separator),
paths,
count: files.length.toString()
}
}
@@ -213,16 +355,21 @@ function* getAllChangeTypeFilesGenerator({
inputs: Inputs
changedFiles: ChangedFiles
}): Generator<string> {
for (const file of flatten(Object.values(changedFiles))) {
if (inputs.dirNames) {
yield getDirnameMaxDepth({
pathStr: file,
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
})
} else {
yield file
}
const dirNamesIncludeFilePatterns = getDirNamesIncludeFilesPattern({inputs})
core.debug(
`Dir names include file patterns: ${JSON.stringify(
dirNamesIncludeFilePatterns
)}`
)
const filePaths = flatten(Object.values(changedFiles))
for (const filePath of getFilePaths({
inputs,
filePaths,
dirNamesIncludeFilePatterns
})) {
yield filePath
}
}
@@ -232,20 +379,15 @@ export const getAllChangeTypeFiles = async ({
}: {
inputs: Inputs
changedFiles: ChangedFiles
}): Promise<{paths: string; count: string}> => {
}): Promise<{paths: string[] | string; count: string}> => {
const files = [
...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles}))
].filter(Boolean)
if (inputs.json) {
return {
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
count: files.length.toString()
}
}
const paths = inputs.json ? files : files.join(inputs.separator)
return {
paths: files.join(inputs.separator),
paths,
count: files.length.toString()
}
}
@@ -278,9 +420,10 @@ export const getChangedFilesFromGithubAPI = async ({
per_page: 100
})
const paginatedResponse = await octokit.paginate<
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
>(options)
const paginatedResponse =
await octokit.paginate<
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
>(options)
core.info(`Found ${paginatedResponse.length} changed files from GitHub API`)
const statusMap: Record<string, ChangeTypeEnum> = {

View File

@@ -6,29 +6,32 @@ import {
getChangeTypeFiles
} from './changedFiles'
import {Inputs} from './inputs'
import {getFilteredChangedFiles, setOutput} from './utils'
import {setOutput} from './utils'
const getOutputKey = (key: string, outputPrefix: string): string => {
return outputPrefix ? `${outputPrefix}_${key}` : key
}
const getArrayFromPaths = (
paths: string | string[],
inputs: Inputs
): string[] => {
return Array.isArray(paths) ? paths : paths.split(inputs.separator)
}
export const setChangedFilesOutput = async ({
allDiffFiles,
allFilteredDiffFiles,
inputs,
filePatterns = [],
outputPrefix = ''
}: {
allDiffFiles: ChangedFiles
allFilteredDiffFiles: ChangedFiles
inputs: Inputs
filePatterns?: string[]
outputPrefix?: string
}): Promise<void> => {
const allFilteredDiffFiles = await getFilteredChangedFiles({
allDiffFiles,
filePatterns
})
core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`)
const addedFiles = await getChangeTypeFiles({
inputs,
changedFiles: allFilteredDiffFiles,
@@ -38,12 +41,16 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('added_files', outputPrefix),
value: addedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('added_files_count', outputPrefix),
value: addedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const copiedFiles = await getChangeTypeFiles({
@@ -55,13 +62,17 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('copied_files', outputPrefix),
value: copiedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('copied_files_count', outputPrefix),
value: copiedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const modifiedFiles = await getChangeTypeFiles({
@@ -73,13 +84,17 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('modified_files', outputPrefix),
value: modifiedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('modified_files_count', outputPrefix),
value: modifiedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const renamedFiles = await getChangeTypeFiles({
@@ -91,13 +106,17 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('renamed_files', outputPrefix),
value: renamedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('renamed_files_count', outputPrefix),
value: renamedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const typeChangedFiles = await getChangeTypeFiles({
@@ -109,13 +128,17 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('type_changed_files', outputPrefix),
value: typeChangedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('type_changed_files_count', outputPrefix),
value: typeChangedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const unmergedFiles = await getChangeTypeFiles({
@@ -127,13 +150,17 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('unmerged_files', outputPrefix),
value: unmergedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('unmerged_files_count', outputPrefix),
value: unmergedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const unknownFiles = await getChangeTypeFiles({
@@ -145,13 +172,17 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('unknown_files', outputPrefix),
value: unknownFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('unknown_files_count', outputPrefix),
value: unknownFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const allChangedAndModifiedFiles = await getAllChangeTypeFiles({
@@ -166,13 +197,17 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('all_changed_and_modified_files', outputPrefix),
value: allChangedAndModifiedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
value: allChangedAndModifiedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const allChangedFiles = await getChangeTypeFiles({
@@ -189,19 +224,25 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('all_changed_files', outputPrefix),
value: allChangedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('all_changed_files_count', outputPrefix),
value: allChangedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
await setOutput({
key: getOutputKey('any_changed', outputPrefix),
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
const allOtherChangedFiles = await getChangeTypeFiles({
@@ -216,12 +257,18 @@ export const setChangedFilesOutput = async ({
})
core.debug(`All other changed files: ${JSON.stringify(allOtherChangedFiles)}`)
const otherChangedFiles = allOtherChangedFiles.paths
.split(inputs.separator)
.filter(
(filePath: string) =>
!allChangedFiles.paths.split(inputs.separator).includes(filePath)
)
const allOtherChangedFilesPaths: string[] = getArrayFromPaths(
allOtherChangedFiles.paths,
inputs
)
const allChangedFilesPaths: string[] = getArrayFromPaths(
allChangedFiles.paths,
inputs
)
const otherChangedFiles = allOtherChangedFilesPaths.filter(
(filePath: string) => !allChangedFilesPaths.includes(filePath)
)
const onlyChanged =
otherChangedFiles.length === 0 &&
@@ -231,19 +278,27 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('only_changed', outputPrefix),
value: onlyChanged,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
await setOutput({
key: getOutputKey('other_changed_files', outputPrefix),
value: otherChangedFiles.join(inputs.separator),
inputs
value: inputs.json
? otherChangedFiles
: otherChangedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('other_changed_files_count', outputPrefix),
value: otherChangedFiles.length.toString(),
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const allModifiedFiles = await getChangeTypeFiles({
@@ -261,19 +316,25 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('all_modified_files', outputPrefix),
value: allModifiedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('all_modified_files_count', outputPrefix),
value: allModifiedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
await setOutput({
key: getOutputKey('any_modified', outputPrefix),
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
const allOtherModifiedFiles = await getChangeTypeFiles({
@@ -288,12 +349,19 @@ export const setChangedFilesOutput = async ({
]
})
const otherModifiedFiles = allOtherModifiedFiles.paths
.split(inputs.separator)
.filter(
(filePath: string) =>
!allModifiedFiles.paths.split(inputs.separator).includes(filePath)
)
const allOtherModifiedFilesPaths: string[] = getArrayFromPaths(
allOtherModifiedFiles.paths,
inputs
)
const allModifiedFilesPaths: string[] = getArrayFromPaths(
allModifiedFiles.paths,
inputs
)
const otherModifiedFiles = allOtherModifiedFilesPaths.filter(
(filePath: string) => !allModifiedFilesPaths.includes(filePath)
)
const onlyModified =
otherModifiedFiles.length === 0 &&
@@ -303,19 +371,27 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('only_modified', outputPrefix),
value: onlyModified,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
await setOutput({
key: getOutputKey('other_modified_files', outputPrefix),
value: otherModifiedFiles.join(inputs.separator),
inputs
value: inputs.json
? otherModifiedFiles
: otherModifiedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('other_modified_files_count', outputPrefix),
value: otherModifiedFiles.length.toString(),
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
const deletedFiles = await getChangeTypeFiles({
@@ -327,19 +403,25 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('deleted_files', outputPrefix),
value: deletedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('deleted_files_count', outputPrefix),
value: deletedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
await setOutput({
key: getOutputKey('any_deleted', outputPrefix),
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
const allOtherDeletedFiles = await getChangeTypeFiles({
@@ -348,11 +430,19 @@ export const setChangedFilesOutput = async ({
changeTypes: [ChangeTypeEnum.Deleted]
})
const otherDeletedFiles = allOtherDeletedFiles.paths
.split(inputs.separator)
.filter(
filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath)
)
const allOtherDeletedFilesPaths: string[] = getArrayFromPaths(
allOtherDeletedFiles.paths,
inputs
)
const deletedFilesPaths: string[] = getArrayFromPaths(
deletedFiles.paths,
inputs
)
const otherDeletedFiles = allOtherDeletedFilesPaths.filter(
filePath => !deletedFilesPaths.includes(filePath)
)
const onlyDeleted =
otherDeletedFiles.length === 0 &&
@@ -362,18 +452,26 @@ export const setChangedFilesOutput = async ({
await setOutput({
key: getOutputKey('only_deleted', outputPrefix),
value: onlyDeleted,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
await setOutput({
key: getOutputKey('other_deleted_files', outputPrefix),
value: otherDeletedFiles.join(inputs.separator),
inputs
value: inputs.json
? otherDeletedFiles
: otherDeletedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
})
await setOutput({
key: getOutputKey('other_deleted_files_count', outputPrefix),
value: otherDeletedFiles.length.toString(),
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
}

View File

@@ -93,56 +93,70 @@ export const getSHAForNonPullRequestEvent = async (
const currentBranch = targetBranch
let initialCommit = false
if (isShallow && !inputs.skipInitialFetch) {
core.info('Repository is shallow, fetching more history...')
if (!inputs.skipInitialFetch) {
if (isShallow) {
core.info('Repository is shallow, fetching more history...')
if (isTag) {
let sourceBranch = ''
if (isTag) {
let sourceBranch = ''
if (github.context.payload.base_ref) {
sourceBranch = github.context.payload.base_ref.replace(
'refs/heads/',
''
)
} else if (github.context.payload.release?.target_commitish) {
sourceBranch = github.context.payload.release?.target_commitish
if (github.context.payload.base_ref) {
sourceBranch = github.context.payload.base_ref.replace(
'refs/heads/',
''
)
} else if (github.context.payload.release?.target_commitish) {
sourceBranch = github.context.payload.release?.target_commitish
}
await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${sourceBranch}:refs/remotes/origin/${sourceBranch}`
]
})
} else {
await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
]
})
}
await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${sourceBranch}:refs/remotes/origin/${sourceBranch}`
]
})
if (hasSubmodule) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
})
}
} else {
await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
]
})
}
if (hasSubmodule) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
})
if (hasSubmodule && inputs.fetchSubmoduleHistory) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
})
}
}
}
@@ -288,55 +302,68 @@ export const getSHAForPullRequestEvent = async (
targetBranch = currentBranch
}
if (isShallow && !inputs.skipInitialFetch) {
if (!inputs.skipInitialFetch) {
core.info('Repository is shallow, fetching more history...')
let prFetchExitCode = await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
'origin',
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
]
})
if (prFetchExitCode !== 0) {
prFetchExitCode = await gitFetch({
if (isShallow) {
let prFetchExitCode = await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${currentBranch}*:refs/remotes/origin/${currentBranch}*`
]
})
}
if (prFetchExitCode !== 0) {
throw new Error(
'Failed to fetch pull request branch. Please ensure "persist-credentials" is set to "true" when checking out the repository. See: https://github.com/actions/checkout#usage'
)
}
if (!inputs.sinceLastRemoteCommit) {
core.debug('Fetching target branch...')
await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
]
})
if (hasSubmodule) {
if (prFetchExitCode !== 0) {
prFetchExitCode = await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${currentBranch}*:refs/remotes/origin/${currentBranch}*`
]
})
}
if (prFetchExitCode !== 0) {
throw new Error(
'Failed to fetch pull request branch. Please ensure "persist-credentials" is set to "true" when checking out the repository. See: https://github.com/actions/checkout#usage'
)
}
if (!inputs.sinceLastRemoteCommit) {
core.debug('Fetching target branch...')
await gitFetch({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
]
})
if (hasSubmodule) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
})
}
}
} else {
if (hasSubmodule && inputs.fetchSubmoduleHistory) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
@@ -392,31 +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)
) {
core.warning(
'Unable to locate the remote branch head sha. 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

@@ -29,9 +29,12 @@ export type Inputs = {
dirNames: boolean
dirNamesMaxDepth?: number
dirNamesExcludeCurrentDir: boolean
dirNamesIncludeFiles: string
dirNamesIncludeFilesSeparator: string
json: boolean
escapeJson: boolean
fetchDepth?: number
fetchSubmoduleHistory: boolean
sinceLastRemoteCommit: boolean
writeOutputFiles: boolean
outputDir: string
@@ -45,6 +48,8 @@ export type Inputs = {
token: string
apiUrl: string
skipInitialFetch: boolean
failOnInitialDiffError: boolean
failOnSubmoduleDiffError: boolean
}
export const getInputs = (): Inputs => {
@@ -135,6 +140,16 @@ export const getInputs = (): Inputs => {
required: false
}
)
const dirNamesIncludeFiles = core.getInput('dir_names_include_files', {
required: false
})
const dirNamesIncludeFilesSeparator = core.getInput(
'dir_names_include_files_separator',
{
required: false,
trimWhitespace: false
}
)
const json = core.getBooleanInput('json', {required: false})
const escapeJson = core.getBooleanInput('escape_json', {required: false})
const fetchDepth = core.getInput('fetch_depth', {required: false})
@@ -177,6 +192,24 @@ export const getInputs = (): Inputs => {
const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', {
required: false
})
const fetchSubmoduleHistory = core.getBooleanInput(
'fetch_additional_submodule_history',
{
required: false
}
)
const failOnInitialDiffError = core.getBooleanInput(
'fail_on_initial_diff_error',
{
required: false
}
)
const failOnSubmoduleDiffError = core.getBooleanInput(
'fail_on_submodule_diff_error',
{
required: false
}
)
const inputs: Inputs = {
files,
@@ -193,6 +226,8 @@ export const getInputs = (): Inputs => {
filesIgnoreYaml,
filesIgnoreYamlFromSourceFile,
filesIgnoreYamlFromSourceFileSeparator,
failOnInitialDiffError,
failOnSubmoduleDiffError,
separator,
// Not Supported via REST API
sha,
@@ -212,17 +247,20 @@ export const getInputs = (): Inputs => {
includeAllOldNewRenamedFiles,
oldNewSeparator,
oldNewFilesSeparator,
skipInitialFetch,
fetchSubmoduleHistory,
// End Not Supported via REST API
dirNames,
dirNamesExcludeCurrentDir,
dirNamesIncludeFiles,
dirNamesIncludeFilesSeparator,
json,
escapeJson,
writeOutputFiles,
outputDir,
outputRenamedFilesAsDeletedAndAdded,
token,
apiUrl,
skipInitialFetch
apiUrl
}
if (fetchDepth) {

View File

@@ -2,17 +2,16 @@ 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,
getSHAForPullRequestEvent,
getSHAForNonPullRequestEvent
getSHAForNonPullRequestEvent,
getSHAForPullRequestEvent
} from './commitSha'
import {Env, getEnv} from './env'
import {getInputs, Inputs} from './inputs'
@@ -30,54 +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')
await setChangedFilesOutput({
allDiffFiles,
filePatterns,
inputs
})
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}`)
await setChangedFilesOutput({
allDiffFiles,
filePatterns: yamlFilePatterns[key],
outputPrefix: key,
inputs
})
core.info('All Done!')
core.endGroup()
}
}
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
core.startGroup('changed-files-all')
await setChangedFilesOutput({
allDiffFiles,
inputs
})
core.info('All Done!')
core.endGroup()
}
}
const getChangedFilesFromLocalGit = async ({
const getChangedFilesFromLocalGitHistory = async ({
inputs,
env,
workingDirectory,
@@ -170,7 +122,10 @@ const getChangedFilesFromLocalGit = async ({
hasSubmodule,
diffResult,
submodulePaths,
outputRenamedFilesAsDeletedAndAdded
outputRenamedFilesAsDeletedAndAdded,
fetchSubmoduleHistory: inputs.fetchSubmoduleHistory,
failOnInitialDiffError: inputs.failOnInitialDiffError,
failOnSubmoduleDiffError: inputs.failOnSubmoduleDiffError
})
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`)
core.info('All Done!')
@@ -193,7 +148,7 @@ const getChangedFilesFromLocalGit = async ({
})
}
await changedFilesOutput({
await processChangedFiles({
filePatterns,
allDiffFiles,
inputs,
@@ -213,12 +168,16 @@ const getChangedFilesFromLocalGit = async ({
await setOutput({
key: 'all_old_new_renamed_files',
value: allOldNewRenamedFiles.paths,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
await setOutput({
key: 'all_old_new_renamed_files_count',
value: allOldNewRenamedFiles.count,
inputs
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
})
core.info('All Done!')
core.endGroup()
@@ -240,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,
@@ -294,7 +253,11 @@ export async function run(): Promise<void> {
'sinceLastRemoteCommit',
'recoverDeletedFiles',
'recoverDeletedFilesToDestination',
'includeAllOldNewRenamedFiles'
'recoverFiles',
'recoverFilesIgnore',
'includeAllOldNewRenamedFiles',
'skipInitialFetch',
'fetchSubmoduleHistory'
]
for (const input of unsupportedInputs) {
@@ -318,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,20 +9,22 @@ import * as path from 'path'
import {createInterface} from 'readline'
import {parseDocument} from 'yaml'
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
import {Inputs} from './inputs'
const IS_WINDOWS = process.platform === 'win32'
const MINIMUM_GIT_VERSION = '2.18.0'
export const isWindows = (): boolean => {
return process.platform === 'win32'
}
/**
* Normalize file path separators to '/' on Windows and Linux/macOS
* @param p file path
* Normalize file path separators to '/' on Linux/macOS and '\\' on Windows
* @param p - file path
* @returns file path with normalized separators
*/
const normalizeSeparators = (p: string): string => {
export const normalizeSeparators = (p: string): string => {
// Windows
if (IS_WINDOWS) {
if (isWindows()) {
// Convert slashes on Windows
p = p.replace(/\//g, '\\')
@@ -37,7 +39,7 @@ const normalizeSeparators = (p: string): string => {
/**
* Trims unnecessary trailing slash from file path
* @param p file path
* @param p - file path
* @returns file path without unnecessary trailing slash
*/
const safeTrimTrailingSeparator = (p: string): string => {
@@ -60,7 +62,7 @@ const safeTrimTrailingSeparator = (p: string): string => {
}
// On Windows, avoid trimming the drive root, e.g. C:\ or \\hello
if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) {
if (isWindows() && /^[A-Z]:\\$/i.test(p)) {
return p
}
@@ -68,12 +70,18 @@ const safeTrimTrailingSeparator = (p: string): string => {
return p.substring(0, p.length - 1)
}
const dirname = (p: string): string => {
/**
* Gets the dirname of a path, similar to the Node.js path.dirname() function except that this function
* also works for Windows UNC root paths, e.g. \\hello\world
* @param p - file path
* @returns dirname of path
*/
export const getDirname = (p: string): string => {
// Normalize slashes and trim unnecessary trailing slash
p = safeTrimTrailingSeparator(p)
// Windows UNC root, e.g. \\hello or \\hello\world
if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) {
if (isWindows() && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) {
return p
}
@@ -81,18 +89,31 @@ const dirname = (p: string): string => {
let result = path.dirname(p)
// Trim trailing slash for Windows UNC root, e.g. \\hello\world\
if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) {
if (isWindows() && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) {
result = safeTrimTrailingSeparator(result)
}
return result
}
/**
* Converts the version string to a number
* @param version - version string
* @returns version number
*/
const versionToNumber = (version: string): number => {
const [major, minor, patch] = version.split('.').map(Number)
return major * 1000000 + minor * 1000 + patch
}
/**
* Verifies the minimum required git version
* @returns minimum required git version
* @throws Minimum git version requirement is not met
* @throws Git is not installed
* @throws Git is not found in PATH
* @throws An unexpected error occurred
*/
export const verifyMinimumGitVersion = async (): Promise<void> => {
const {exitCode, stdout, stderr} = await exec.getExecOutput(
'git',
@@ -113,6 +134,11 @@ export const verifyMinimumGitVersion = async (): Promise<void> => {
}
}
/**
* Checks if a path exists
* @param filePath - path to check
* @returns path exists
*/
const exists = async (filePath: string): Promise<boolean> => {
try {
await fs.access(filePath)
@@ -122,6 +148,11 @@ const exists = async (filePath: string): Promise<boolean> => {
}
}
/**
* Generates lines of a file as an async iterable iterator
* @param filePath - path of file to read
* @param excludedFiles - whether to exclude files
*/
async function* lineOfFileGenerator({
filePath,
excludedFiles
@@ -153,6 +184,11 @@ async function* lineOfFileGenerator({
}
}
/**
* Gets the file patterns from a source file
* @param filePaths - paths of files to read
* @param excludedFiles - whether to exclude the file patterns
*/
const getFilesFromSourceFile = async ({
filePaths,
excludedFiles = false
@@ -169,6 +205,12 @@ const getFilesFromSourceFile = async ({
return lines
}
/**
* Sets the global git configs
* @param name - name of config
* @param value - value of config
* @throws Couldn't update git global config
*/
export const updateGitGlobalConfig = async ({
name,
value
@@ -191,6 +233,11 @@ export const updateGitGlobalConfig = async ({
}
}
/**
* Checks if a git repository is shallow
* @param cwd - working directory
* @returns repository is shallow
*/
export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
const {stdout} = await exec.getExecOutput(
'git',
@@ -204,6 +251,11 @@ export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
return stdout.trim() === 'true'
}
/**
* Checks if a submodule exists
* @param cwd - working directory
* @returns submodule exists
*/
export const submoduleExists = async ({
cwd
}: {
@@ -227,6 +279,11 @@ export const submoduleExists = async ({
return stdout.trim() !== ''
}
/**
* Fetches the git repository
* @param args - arguments for fetch command
* @param cwd - working directory
*/
export const gitFetch = async ({
args,
cwd
@@ -243,6 +300,11 @@ export const gitFetch = async ({
return exitCode
}
/**
* Fetches the git repository submodules
* @param args - arguments for fetch command
* @param cwd - working directory
*/
export const gitFetchSubmodules = async ({
args,
cwd
@@ -266,10 +328,10 @@ export const gitFetchSubmodules = async ({
}
}
const normalizePath = (p: string): string => {
return p.replace(/\\/g, '/')
}
/**
* Retrieves all the submodule paths
* @param cwd - working directory
*/
export const getSubmodulePath = async ({
cwd
}: {
@@ -293,9 +355,17 @@ export const getSubmodulePath = async ({
return stdout
.trim()
.split('\n')
.map((line: string) => normalizePath(line.trim().split(' ')[1]))
.map((line: string) => normalizeSeparators(line.trim().split(' ')[1]))
}
/**
* Retrieves commit sha of a submodule from a parent commit
* @param cwd - working directory
* @param parentSha1 - parent commit sha
* @param parentSha2 - parent commit sha
* @param submodulePath - path of submodule
* @param diff - diff type between parent commits (`..` or `...`)
*/
export const gitSubmoduleDiffSHA = async ({
cwd,
parentSha1,
@@ -311,7 +381,7 @@ export const gitSubmoduleDiffSHA = async ({
}): Promise<{previousSha?: string; currentSha?: string}> => {
const {stdout} = await exec.getExecOutput(
'git',
['diff', parentSha1, parentSha2, '--', submodulePath],
['diff', `${parentSha1}${diff}${parentSha2}`, '--', submodulePath],
{
cwd,
silent: !core.isDebug()
@@ -398,16 +468,30 @@ export const gitRenamedFiles = async ({
core.debug(`Renamed file: ${line}`)
const [, oldPath, newPath] = line.split('\t')
if (isSubmodule) {
return `${normalizePath(
return `${normalizeSeparators(
path.join(parentDir, oldPath)
)}${oldNewSeparator}${normalizePath(path.join(parentDir, newPath))}`
)}${oldNewSeparator}${normalizeSeparators(
path.join(parentDir, newPath)
)}`
}
return `${normalizePath(oldPath)}${oldNewSeparator}${normalizePath(
newPath
)}`
return `${normalizeSeparators(
oldPath
)}${oldNewSeparator}${normalizeSeparators(newPath)}`
})
}
/**
* Retrieves all the changed files between two commits
* @param cwd - working directory
* @param sha1 - commit sha
* @param sha2 - commit sha
* @param diff - diff type between parent commits (`..` or `...`)
* @param isSubmodule - is the repo a submodule
* @param parentDir - parent directory of the submodule
* @param outputRenamedFilesAsDeletedAndAdded - output renamed files as deleted and added
* @param failOnInitialDiffError - fail if the initial diff fails
* @param failOnSubmoduleDiffError - fail if the submodule diff fails
*/
export const getAllChangedFiles = async ({
cwd,
sha1,
@@ -415,7 +499,9 @@ export const getAllChangedFiles = async ({
diff,
isSubmodule = false,
parentDir = '',
outputRenamedFilesAsDeletedAndAdded = false
outputRenamedFilesAsDeletedAndAdded = false,
failOnInitialDiffError = false,
failOnSubmoduleDiffError = false
}: {
cwd: string
sha1: string
@@ -424,6 +510,8 @@ export const getAllChangedFiles = async ({
isSubmodule?: boolean
parentDir?: string
outputRenamedFilesAsDeletedAndAdded?: boolean
failOnInitialDiffError?: boolean
failOnSubmoduleDiffError?: boolean
}): Promise<ChangedFiles> => {
const {exitCode, stdout, stderr} = await exec.getExecOutput(
'git',
@@ -451,6 +539,18 @@ export const getAllChangedFiles = async ({
[ChangeTypeEnum.Unknown]: []
}
if (exitCode !== 0) {
if (failOnInitialDiffError && !isSubmodule) {
throw new Error(
`Failed to get changed files between: ${sha1}${diff}${sha2}: ${stderr}`
)
} else if (failOnSubmoduleDiffError && isSubmodule) {
throw new Error(
`Failed to get changed files for submodule between: ${sha1}${diff}${sha2}: ${stderr}`
)
}
}
if (exitCode !== 0) {
if (isSubmodule) {
core.warning(
@@ -474,11 +574,11 @@ export const getAllChangedFiles = async ({
for (const line of lines) {
const [changeType, filePath, newPath = ''] = line.split('\t')
const normalizedFilePath = isSubmodule
? normalizePath(path.join(parentDir, filePath))
: normalizePath(filePath)
? normalizeSeparators(path.join(parentDir, filePath))
: normalizeSeparators(filePath)
const normalizedNewPath = isSubmodule
? normalizePath(path.join(parentDir, newPath))
: normalizePath(newPath)
? normalizeSeparators(path.join(parentDir, newPath))
: normalizeSeparators(newPath)
if (changeType.startsWith('R')) {
if (outputRenamedFilesAsDeletedAndAdded) {
@@ -494,6 +594,11 @@ export const getAllChangedFiles = async ({
return changedFiles
}
/**
* Filters the changed files by the file patterns
* @param allDiffFiles - all the changed files
* @param filePatterns - file patterns to filter by
*/
export const getFilteredChangedFiles = async ({
allDiffFiles,
filePatterns
@@ -512,15 +617,16 @@ export const getFilteredChangedFiles = async ({
[ChangeTypeEnum.Unknown]: []
}
const hasFilePatterns = filePatterns.length > 0
const isWin = isWindows()
for (const changeType of Object.keys(allDiffFiles)) {
const files = allDiffFiles[changeType as ChangeTypeEnum]
if (hasFilePatterns) {
changedFiles[changeType as ChangeTypeEnum] = mm(files, filePatterns, {
dot: true,
windows: IS_WINDOWS,
windows: isWin,
noext: true
})
}).map(normalizeSeparators)
} else {
changedFiles[changeType as ChangeTypeEnum] = files
}
@@ -650,7 +756,7 @@ export const getPreviousGitTag = async ({
}): Promise<{tag: string; sha: string}> => {
const {stdout} = await exec.getExecOutput(
'git',
['tag', '--sort=-version:refname'],
['tag', '--sort=-creatordate'],
{
cwd,
silent: !core.isDebug()
@@ -691,9 +797,58 @@ export const canDiffCommits = async ({
sha2: string
diff: string
}): Promise<boolean> => {
const {exitCode, stderr} = await exec.getExecOutput(
if (diff === '...') {
const mergeBase = await getMergeBase(cwd, sha1, sha2)
if (!mergeBase) {
core.warning(`Unable to find merge base between ${sha1} and ${sha2}`)
return false
}
const {exitCode, stderr} = await exec.getExecOutput(
'git',
['log', '--format=%H', `${mergeBase}..${sha2}`],
{
cwd,
ignoreReturnCode: true,
silent: !core.isDebug()
}
)
if (exitCode !== 0) {
core.warning(stderr || `Error checking commit history`)
return false
}
return true
} else {
const {exitCode, stderr} = await exec.getExecOutput(
'git',
['diff', '--quiet', sha1, sha2],
{
cwd,
ignoreReturnCode: true,
silent: !core.isDebug()
}
)
if (exitCode !== 0) {
core.warning(stderr || `Error checking commit history`)
return false
}
return true
}
}
const getMergeBase = async (
cwd: string,
sha1: string,
sha2: string
): Promise<string | null> => {
const {exitCode, stdout} = await exec.getExecOutput(
'git',
['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`],
['merge-base', sha1, sha2],
{
cwd,
ignoreReturnCode: true,
@@ -702,23 +857,22 @@ export const canDiffCommits = async ({
)
if (exitCode !== 0) {
core.warning(stderr || `Unable find merge base between ${sha1} and ${sha2}`)
return false
return null
}
return true
return stdout.trim()
}
export const getDirnameMaxDepth = ({
pathStr,
relativePath,
dirNamesMaxDepth,
excludeCurrentDir
}: {
pathStr: string
relativePath: string
dirNamesMaxDepth?: number
excludeCurrentDir?: boolean
}): string => {
const pathArr = dirname(pathStr).split(path.sep)
const pathArr = getDirname(relativePath).split(path.sep)
const maxDepth = Math.min(dirNamesMaxDepth || pathArr.length, pathArr.length)
let output = pathArr[0]
@@ -730,14 +884,14 @@ export const getDirnameMaxDepth = ({
return ''
}
return normalizePath(output)
return normalizeSeparators(output)
}
export const jsonOutput = ({
value,
shouldEscape
}: {
value: string | string[]
value: string | string[] | boolean
shouldEscape: boolean
}): string => {
const result = JSON.stringify(value)
@@ -745,6 +899,16 @@ export const jsonOutput = ({
return shouldEscape ? result.replace(/"/g, '\\"') : result
}
export const getDirNamesIncludeFilesPattern = ({
inputs
}: {
inputs: Inputs
}): string[] => {
return inputs.dirNamesIncludeFiles
.split(inputs.dirNamesIncludeFilesSeparator)
.filter(Boolean)
}
export const getFilePatterns = async ({
inputs,
workingDirectory
@@ -754,7 +918,7 @@ export const getFilePatterns = async ({
}): Promise<string[]> => {
let filePatterns = inputs.files
.split(inputs.filesSeparator)
.filter(p => p !== '')
.filter(Boolean)
.join('\n')
if (inputs.filesFromSourceFile !== '') {
@@ -815,12 +979,12 @@ export const getFilePatterns = async ({
filePatterns = filePatterns.concat('\n', filesIgnoreFromSourceFiles)
}
if (IS_WINDOWS) {
if (isWindows()) {
filePatterns = filePatterns.replace(/\r\n/g, '\n')
filePatterns = filePatterns.replace(/\r/g, '\n')
}
core.debug(`file patterns: ${filePatterns}`)
core.debug(`Input file patterns: ${filePatterns}`)
return filePatterns
.trim()
@@ -830,10 +994,10 @@ export const getFilePatterns = async ({
if (pattern.endsWith('/')) {
return `${pattern}**`
} else {
const pathParts = pattern.split(path.sep)
const pathParts = pattern.split('/')
const lastPart = pathParts[pathParts.length - 1]
if (!lastPart.includes('.')) {
return `${pattern}${path.sep}**`
return `${pattern}/**`
} else {
return pattern
}
@@ -1061,18 +1225,29 @@ export const getRecoverFilePatterns = ({
export const setOutput = async ({
key,
value,
inputs
writeOutputFiles,
outputDir,
json = false,
shouldEscape = false
}: {
key: string
value: string | boolean
inputs: Inputs
value: string | string[] | boolean
writeOutputFiles: boolean
outputDir: string
json?: boolean
shouldEscape?: boolean
}): Promise<void> => {
const cleanedValue = value.toString().trim()
let cleanedValue
if (json) {
cleanedValue = jsonOutput({value, shouldEscape})
} else {
cleanedValue = value.toString().trim()
}
core.setOutput(key, cleanedValue)
if (inputs.writeOutputFiles) {
const outputDir = inputs.outputDir
const extension = inputs.json ? 'json' : 'txt'
if (writeOutputFiles) {
const extension = json ? 'json' : 'txt'
const outputFilePath = path.join(outputDir, `${key}.${extension}`)
if (!(await exists(outputDir))) {
@@ -1129,7 +1304,7 @@ export const recoverDeletedFiles = async ({
if (recoverPatterns.length > 0) {
recoverableDeletedFiles = mm(deletedFiles, recoverPatterns, {
dot: true,
windows: IS_WINDOWS,
windows: isWindows(),
noext: true
})
core.debug(`filtered recoverable deleted files: ${recoverableDeletedFiles}`)

1648
yarn.lock

File diff suppressed because it is too large Load Diff