Compare commits

..

176 Commits
v41 ... v43

Author SHA1 Message Date
tj-actions[bot]
77af4bed28 Updated README.md (#1989)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-03-13 22:28:45 +00:00
Tonye Jack
a5cf6aa30c feat: add support for returning true for any_{changed, modified, deleted} outputs when no patterns are specified (#1988)
Co-authored-by: GitHub Action <action@github.com>
2024-03-13 22:19:50 +00:00
renovate[bot]
15807c9c84 chore(deps): update dependency @types/node to v20.11.27 2024-03-13 16:39:47 +00:00
renovate[bot]
dc458cf753 chore(deps): update peter-evans/create-pull-request action to v6.0.2 2024-03-12 16:01:39 +00:00
renovate[bot]
92ca3eebd0 chore(deps): update dependency @types/lodash to v4.17.0 2024-03-12 11:21:16 +00:00
renovate[bot]
f591d0c7f0 chore(deps): update dependency @typescript-eslint/eslint-plugin to v7.2.0 2024-03-11 23:32:55 +00:00
renovate[bot]
35023362e2 chore(deps): update dependency @types/node to v20.11.26 2024-03-11 23:20:54 +00:00
renovate[bot]
e436cb6d85 chore(deps): update dependency @typescript-eslint/parser to v7.2.0 2024-03-11 18:12:31 +00:00
renovate[bot]
257d47dfba chore(deps): lock file maintenance 2024-03-11 01:16:09 +00:00
tj-actions[bot]
4918e11830 Upgraded to v42.1.0 (#1977)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-09 20:14:28 +00:00
tj-actions[bot]
aa08304bd4 Updated README.md (#1976)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-03-09 01:29:44 +00:00
Tonye Jack
008ba8ceec feat: add matrix alias to simplify using outputs for matrix jobs (#1975)
Co-authored-by: GitHub Action <action@github.com>
2024-03-09 01:20:45 +00:00
tj-actions[bot]
fe6c3ea0ca Upgraded to v42.0.7 (#1974)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-07 22:21:22 +00:00
GitHub Action
7fc073d922 Added missing changes and modified dist assets. 2024-03-07 22:11:09 +00:00
renovate[bot]
7e4bfc2f1f chore(deps): lock file maintenance 2024-03-07 22:11:09 +00:00
Tonye Jack
ef3a7f51d6 chore: add test for detecting changed-files in a nested directory (#1972) 2024-03-07 21:34:48 +00:00
Tonye Jack
a65c2f2100 Update README.md 2024-03-06 21:25:13 -07:00
GitHub Action
ea042d8095 Added missing changes and modified dist assets. 2024-03-06 18:49:07 +00:00
renovate[bot]
8293f8c984 chore(deps): update dependency typescript to v5.4.2 2024-03-06 18:49:07 +00:00
renovate[bot]
0ff732eeb3 chore(deps): update dependency @types/node to v20.11.25 2024-03-06 18:39:17 +00:00
tj-actions[bot]
8df6fc260f Upgraded to v42.0.6 (#1968)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-06 16:42:51 +00:00
GitHub Action
d516645658 Added missing changes and modified dist assets. 2024-03-06 12:50:33 +00:00
renovate[bot]
2c97e7ea24 fix(deps): update dependency yaml to v2.4.1 2024-03-06 12:50:33 +00:00
renovate[bot]
1c8e606958 chore(deps): update typescript-eslint monorepo to v7.1.1 2024-03-04 18:15:53 +00:00
GitHub Action
74605cb326 Added missing changes and modified dist assets. 2024-03-04 00:18:25 +00:00
renovate[bot]
aa15b58e8a chore(deps): lock file maintenance 2024-03-04 00:18:25 +00:00
renovate[bot]
0a392e7438 chore(deps): update dependency eslint-plugin-github to v4.10.2 2024-02-29 23:36:05 +00:00
renovate[bot]
85efc7df8e chore(deps): update dependency @types/node to v20.11.24 2024-02-29 18:22:25 +00:00
renovate[bot]
2a095d24c2 chore(deps): update dependency @types/node to v20.11.23 2024-02-29 12:45:48 +00:00
renovate[bot]
ac3dc5e392 chore(deps): update tj-actions/verify-changed-files action to v19 (#1960)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-29 01:16:44 +00:00
renovate[bot]
dd7e9d3b17 chore(deps): update dependency @types/node to v20.11.22 2024-02-28 20:16:24 +00:00
renovate[bot]
0647a31f54 chore(deps): update peter-evans/create-pull-request action to v6.0.1 2024-02-28 04:49:44 +00:00
renovate[bot]
9d67dd3dbe chore(deps): update dependency @types/node to v20.11.21 2024-02-28 00:41:14 +00:00
renovate[bot]
5acd7e3646 chore(deps): update typescript-eslint monorepo to v7.1.0 2024-02-26 20:18:46 +00:00
tj-actions[bot]
9f4af73d05 Upgraded to v42.0.5 (#1955)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-26 07:25:53 +00:00
renovate[bot]
800a282599 chore(deps): lock file maintenance 2024-02-26 02:02:02 +00:00
GitHub Action
31c4d150e6 Added missing changes and modified dist assets. 2024-02-25 16:58:14 +00:00
renovate[bot]
2a2a5b6b9c fix(deps): update dependency yaml to v2.4.0 2024-02-25 16:58:14 +00:00
Tonye Jack
d8dcc13244 chore: Update README.md (#1952) 2024-02-25 16:48:32 +00:00
renovate[bot]
639ce0e105 chore(deps): update dependency eslint to v8.57.0 2024-02-23 22:38:47 +00:00
GitHub Action
9d447b9959 Added missing changes and modified dist assets. 2024-02-23 04:24:39 +00:00
renovate[bot]
83bfc72efa chore(deps): lock file maintenance 2024-02-23 04:24:39 +00:00
renovate[bot]
879c8388c8 chore(deps): update dependency @types/node to v20.11.20 2024-02-22 19:58:37 +00:00
Tonye Jack
bb7502bd15 Update README.md 2024-02-21 07:20:22 -07:00
renovate[bot]
5c5539ced9 chore(deps): update typescript-eslint monorepo to v7.0.2 2024-02-19 19:54:17 +00:00
GitHub Action
c2039de114 Added missing changes and modified dist assets. 2024-02-19 00:16:07 +00:00
renovate[bot]
0cbc9bc448 chore(deps): lock file maintenance 2024-02-19 00:16:07 +00:00
tj-actions[bot]
9ef20a69dd Updated README.md (#1943)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-18 05:12:36 +00:00
Tonye Jack
a617853c0f chore: update action.yml (#1942) 2024-02-17 21:58:39 -07:00
tj-actions[bot]
5c1bceb76c Upgraded to v42.0.4 (#1941)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-18 03:31:45 +00:00
Tonye Jack
3f54ebb830 chore: update formatting and add missing dist changes (#1940) 2024-02-17 20:20:58 -07:00
tj-actions[bot]
6f070cff38 Upgraded to v42.0.3 (#1939)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2024-02-17 22:43:08 +00:00
tj-actions[bot]
ec75ae5ab7 Updated README.md (#1938)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-17 15:32:19 -07:00
allcontributors[bot]
4333ab5b20 docs: add codesculpture as a contributor for code, and bug (#1937)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-02-17 15:31:24 -07:00
Aravind
e3cac49049 fix(payload_api, git_diff): Accessing correct property in payload and Replacing --quiet with --no-patch in git diff (#1934) 2024-02-17 15:31:02 -07:00
renovate[bot]
68bd4537bd chore(deps): update github artifact actions to v4 (major) (#1936)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-17 13:36:07 +00:00
renovate[bot]
f0ce41b71c chore(deps): update dependency eslint-plugin-jest to v27.9.0 2024-02-16 19:21:56 +00:00
renovate[bot]
ce451bf430 chore(deps): update dependency @types/node to v20.11.19 2024-02-15 19:08:56 +00:00
renovate[bot]
7592e9e855 chore(deps): update dependency @types/node to v20.11.18 2024-02-15 14:12:15 +00:00
renovate[bot]
999653c672 chore(deps): lock file maintenance 2024-02-13 21:04:48 +00:00
renovate[bot]
6cf4c21fdf chore(deps): update dependency eslint-plugin-jest to v27.8.0 2024-02-13 18:16:15 +00:00
Tonye Jack
09ee51bee3 chore: update codacy-analysis.yml (#1929) 2024-02-13 16:34:23 +00:00
Tonye Jack
8eced8a5df Update README.md 2024-02-13 09:20:59 -07:00
renovate[bot]
13fa1402a7 chore(deps): update typescript-eslint monorepo to v7 (major) (#1927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-12 22:21:01 +00:00
GitHub Action
07ac0ac168 Added missing changes and modified dist assets. 2024-02-12 01:14:37 +00:00
renovate[bot]
049d7fd639 chore(deps): lock file maintenance 2024-02-12 01:14:37 +00:00
renovate[bot]
2e90fbb74b chore(deps): update dependency @types/node to v20.11.17 2024-02-08 21:32:12 +00:00
renovate[bot]
2a9db54a6d chore(deps): update codacy/codacy-analysis-cli-action action to v4.4.0 2024-02-08 16:41:50 +00:00
renovate[bot]
d0d5671ef7 chore(deps): update actions/setup-node action to v4.0.2 2024-02-07 05:44:30 +00:00
Tonye Jack
97120ff1f5 chore: update README.md (#1922) 2024-02-06 22:33:30 -07:00
Tonye Jack
b2d4e1b488 Update README.md 2024-02-06 20:33:25 -07:00
Tonye Jack
9299962a59 chore: update workflow-run-example.yml (#1921) 2024-02-06 20:29:12 -07:00
KeisukeYamashita
ea35f7ea00 fix: broken link to matrix example workflow (#1918)
Co-authored-by: Tonye Jack <jtonye@ymail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-02-06 20:18:39 -07:00
tj-actions[bot]
3399f8837f Updated README.md (#1920)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-06 16:50:49 -07:00
allcontributors[bot]
ac897da4f1 docs: add KeisukeYamashita as a contributor for doc (#1919)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-02-06 16:48:51 -07:00
tj-actions[bot]
8e56bc097a Updated README.md (#1917)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-05 19:51:58 +00:00
Tonye Jack
f6d3fe5179 Update action.yml 2024-02-05 12:42:54 -07:00
Tonye Jack
efa99ea361 Update README.md 2024-02-05 12:38:05 -07:00
Tonye Jack
6d8f9bd379 Update README.md 2024-02-05 12:34:02 -07:00
renovate[bot]
589fb70c81 chore(deps): update typescript-eslint monorepo to v6.21.0 2024-02-05 19:18:51 +00:00
tj-actions[bot]
7daee9e7cf Updated README.md (#1915)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-05 05:03:52 +00:00
Tonye Jack
99c80bdd47 Update README.md 2024-02-04 21:55:53 -07:00
renovate[bot]
5e7cbf5fdb chore(deps): update dependency prettier to v3.2.5 2024-02-04 06:22:00 +00:00
renovate[bot]
b4d6d28988 chore(deps): lock file maintenance 2024-02-04 04:15:55 +00:00
renovate[bot]
8370e6e6ef chore(deps): update tj-actions/verify-changed-files action to v18 (#1912)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-03 23:01:22 +00:00
tj-actions[bot]
aa31060851 Updated README.md (#1911)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-02-02 06:23:08 -07:00
Daniel Hill
54c56103aa correct bash loop in examples (#1908)
Co-authored-by: Tonye Jack <jtonye@ymail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-02-02 06:21:28 -07:00
allcontributors[bot]
e57fb1b8eb docs: add dan-hill2802 as a contributor for doc (#1910)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-02-02 06:20:26 -07:00
Tonye Jack
926735a61e chore: create greetings workflow (#1909) 2024-02-02 13:15:54 +00:00
Tonye Jack
d3ac2a064b Update README.md 2024-02-02 05:26:23 -07:00
renovate[bot]
91df40b882 chore(deps): update dependency @types/node to v20.11.16 2024-02-02 00:55:22 +00:00
renovate[bot]
28396e9658 chore(deps): update dependency @types/jest to v29.5.12 2024-02-01 21:32:44 +00:00
renovate[bot]
3a66e2a7e4 chore(deps): update dependency @types/node to v20.11.15 2024-02-01 14:05:35 +00:00
renovate[bot]
35f3202fd5 chore(deps): update dependency @types/node to v20.11.14 2024-01-31 23:17:50 +00:00
renovate[bot]
2b30af482a chore(deps): update peter-evans/create-pull-request action to v6 (#1903)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-31 13:06:56 +00:00
renovate[bot]
a93bcf46e0 chore(deps): update dependency @types/node to v20.11.13 2024-01-31 00:55:34 +00:00
renovate[bot]
6d4c555c7d chore(deps): update dependency @types/node to v20.11.12 2024-01-30 22:58:15 +00:00
renovate[bot]
507a8c703d chore(deps): update dependency @types/node to v20.11.11 2024-01-30 20:28:06 +00:00
Tonye Jack
3a7052c24a chore: update test (#1899) 2024-01-30 15:58:53 +00:00
renovate[bot]
782eb123a9 chore(deps): update typescript-eslint monorepo to v6.20.0 2024-01-29 17:33:03 +00:00
renovate[bot]
9134dac8f6 chore(deps): lock file maintenance 2024-01-29 02:23:13 +00:00
tj-actions[bot]
df12603b45 Updated README.md (#1896)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-28 23:00:58 +00:00
allcontributors[bot]
bb9b5e8363 docs: add levenleven as a contributor for doc (#1893)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-01-28 15:53:00 -07:00
tj-actions[bot]
31b9c0a541 Updated README.md (#1894)
Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com>
2024-01-28 20:24:30 +00:00
renovate[bot]
ba0a561b13 chore(deps): update dependency @types/node to v20.11.10 2024-01-28 20:15:14 +00:00
Aleksey Levenstein
8d35cbb00f chore: fix broken matrix example links (#1891)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-01-28 20:02:05 +00:00
renovate[bot]
82dd6547dc chore(deps): update dependency @types/node to v20.11.9 2024-01-28 11:16:18 +00:00
renovate[bot]
6d42539842 chore(deps): lock file maintenance 2024-01-28 02:15:30 +00:00
renovate[bot]
08dedfb681 chore(deps): update dependency @types/node to v20.11.8 2024-01-27 16:43:26 +00:00
renovate[bot]
f6d9fa10e0 chore(deps): update dependency @types/node to v20.11.7 2024-01-26 07:40:09 +00:00
renovate[bot]
9eb0d763ae chore(deps): update dependency @types/uuid to v9.0.8 2024-01-26 01:13:50 +00:00
tj-actions[bot]
51d2f88f07 Upgraded to v42.0.2 (#1886)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-25 19:37:33 +00:00
Tonye Jack
90a06d6ba9 feat: enhance error handling for non-git directories (#1885)
Co-authored-by: GitHub Action <action@github.com>
2024-01-25 18:46:48 +00:00
tj-actions[bot]
2cb2c9234e Upgraded to v42.0.1 (#1884)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-24 22:06:48 -07:00
renovate[bot]
ac21d93904 chore(deps): update dependency @types/node to v20.11.6 2024-01-24 08:44:11 +00:00
renovate[bot]
a4637ea6e7 chore(deps): update typescript-eslint monorepo to v6.19.1 2024-01-22 19:25:19 +00:00
renovate[bot]
fd9998cf5f chore(deps): update dependency ts-jest to v29.1.2 2024-01-22 16:38:49 +00:00
GitHub Action
ea024b2d7f Added missing changes and modified dist assets. 2024-01-22 00:53:04 +00:00
renovate[bot]
db4e584844 chore(deps): lock file maintenance 2024-01-22 00:53:04 +00:00
Tonye Jack
c6543c497a chore: rename example worflows from test to example (#1878) 2024-01-21 05:54:00 +00:00
Tonye Jack
88f9f3efbb chore: update README.md (#1877) 2024-01-20 21:42:48 -07:00
GitHub Action
3af07c2040 Added missing changes and modified dist assets. 2024-01-18 05:49:14 +00:00
Tonye Jack
3680129aa2 Update env.ts 2024-01-18 05:49:14 +00:00
renovate[bot]
5d866cbe77 chore(deps): lock file maintenance 2024-01-18 05:49:14 +00:00
renovate[bot]
346f237a17 chore(deps): update tj-actions/eslint-changed-files action to v23 (#1875)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-18 05:36:12 +00:00
tj-actions[bot]
c037f1e7c5 Upgraded to v42 (#1874)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-18 05:12:24 +00:00
Tonye Jack
ae82ed4ae0 feat: add support for include/exclude all nested files when a directory is specified and ends with a slash (#1873)
Co-authored-by: GitHub Action <action@github.com>
2024-01-17 21:57:33 -07:00
Tonye Jack
cbd59070e8 rename: unsupported REST API inputs constant name (#1872) 2024-01-18 03:39:20 +00:00
Tonye Jack
6c9dcea443 fix: update input warning (#1870)
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2024-01-17 20:27:20 -07:00
renovate[bot]
79b060d445 chore(deps): update dependency prettier to v3.2.4 2024-01-17 11:20:13 +00:00
tj-actions[bot]
434b67ebc3 Upgraded to v41.1.2 (#1869)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-17 01:02:16 -07:00
renovate[bot]
cbda684547 chore(deps): update dependency @types/node to v20.11.5 2024-01-17 07:29:39 +00:00
Tonye Jack
3f8189989b fix: bug with incorrect action path (#1866)
Co-authored-by: GitHub Action <action@github.com>
2024-01-17 07:20:30 +00:00
renovate[bot]
67a1f54f6f chore(deps): update dependency prettier to v3.2.3 2024-01-17 05:17:08 +00:00
renovate[bot]
99248a4438 chore(deps): update tj-actions/eslint-changed-files action to v22 (#1864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-16 22:31:01 +00:00
renovate[bot]
878743189b chore(deps): update dependency @types/node to v20.11.4 2024-01-16 11:36:30 +00:00
renovate[bot]
98d1d84e2f chore(deps): update dependency @types/node to v20.11.3 2024-01-15 22:18:38 +00:00
Tonye Jack
a60bf3759e feat: enhance error handling and working directory resolution (#1859)
Co-authored-by: GitHub Action <action@github.com>
2024-01-15 11:54:08 -07:00
renovate[bot]
bc46e4c422 chore(deps): update typescript-eslint monorepo to v6.19.0 2024-01-15 18:51:11 +00:00
renovate[bot]
fba4067348 chore(deps): update dependency @types/node to v20.11.2 2024-01-15 13:13:53 +00:00
renovate[bot]
e4b8674732 chore(deps): update dependency @types/node to v20.11.1 2024-01-15 04:26:58 +00:00
renovate[bot]
bc2b5aef20 chore(deps): lock file maintenance 2024-01-15 02:09:33 +00:00
renovate[bot]
63c36a563a chore(deps): update dependency prettier to v3.2.2 2024-01-14 05:44:42 +00:00
tj-actions[bot]
44b77505fe Upgraded to v41.1.1 (#1854)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-13 22:07:22 +00:00
Tonye Jack
62f4729b5d fix: bug with inaccurate warnings (#1853)
Co-authored-by: GitHub Action <action@github.com>
2024-01-13 21:53:17 +00:00
tj-actions[bot]
e0579abf95 Upgraded to v41.1.0 (#1852)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-13 10:27:11 +00:00
Tonye Jack
8e0194b29b fix: permission with release workflow (#1851) 2024-01-13 03:16:09 -07:00
tj-actions[bot]
3649d2842d Updated README.md (#1850)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-13 08:58:40 +00:00
Tonye Jack
0ca1c07b47 feat: add support for forcing the use of GitHub’s REST API (#1849)
Co-authored-by: GitHub Action <action@github.com>
2024-01-13 08:48:42 +00:00
Tonye Jack
a57f4dcc81 chore: update top level workflow permissions (#1848) 2024-01-13 07:31:45 +00:00
renovate[bot]
9c39b0b6e9 chore(deps): update dependency prettier to v3.2.1 2024-01-12 23:37:28 +00:00
renovate[bot]
8b141f3906 chore(deps): update dependency eslint-plugin-jest to v27.6.3 2024-01-12 17:54:52 +00:00
Tonye Jack
17e07d8bc0 chore: create multi-job-test.yml (#1843)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-01-12 17:43:51 +00:00
Tonye Jack
13fa1c06fc chore: update warning message (#1845)
Co-authored-by: GitHub Action <action@github.com>
2024-01-12 10:28:21 -07:00
renovate[bot]
0deb29d192 chore(deps): update dependency prettier to v3.2.0 2024-01-12 17:07:01 +00:00
renovate[bot]
28267ee8b7 chore(deps): update dependency @types/node to v20.11.0 2024-01-11 08:04:44 +00:00
renovate[bot]
094d3441f8 chore(deps): update dependency eslint-plugin-jest to v27.6.2 2024-01-10 11:27:40 +00:00
renovate[bot]
aeec36b035 chore(deps): update dependency eslint-plugin-prettier to v5.1.3 2024-01-10 05:05:32 +00:00
dependabot[bot]
2d0270c489 chore(deps-dev): bump @types/node from 20.10.7 to 20.10.8 (#1836)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-10 01:23:30 +00:00
renovate[bot]
0e0adfa0d3 chore(deps): update typescript-eslint monorepo to v6.18.1 2024-01-09 01:42:46 +00:00
Tonye Jack
5313e6bbe3 chore: update jest.config.js (#1834) 2024-01-08 13:53:44 +00:00
renovate[bot]
54789be3a1 chore(deps): lock file maintenance 2024-01-08 00:42:20 +00:00
renovate[bot]
1675238cfd chore(deps): update dependency @types/node to v20.10.7 2024-01-07 17:13:54 +00:00
tj-actions[bot]
3fbf5fb588 Updated README.md (#1830)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2024-01-07 06:40:56 -07:00
Tonye Jack
95230678db Update README.md 2024-01-07 06:37:07 -07:00
Tonye Jack
fdccafbb6e chore: create workflow-run-test.yml (#1828) 2024-01-06 10:50:54 -07:00
renovate[bot]
0e8d796ee0 chore(deps): update typescript-eslint monorepo to v6.18.0 2024-01-06 16:49:14 +00:00
renovate[bot]
0c6f2ac488 chore(deps): update dependency eslint-plugin-jest to v27.6.1 2024-01-01 22:49:49 +00:00
renovate[bot]
1db97adba4 chore(deps): update typescript-eslint monorepo to v6.17.0 2024-01-01 19:03:11 +00:00
renovate[bot]
fb8f6db383 chore(deps): lock file maintenance 2023-12-31 19:28:53 +00:00
renovate[bot]
efd7ecef11 chore(deps): update dependency @types/node to v20.10.6 2023-12-30 02:47:54 +00:00
renovate[bot]
4f8e12c098 chore(deps): update tj-actions/verify-changed-files action to v17 (#1820)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-29 04:36:04 +00:00
Tonye Jack
032add13e8 Update README.md 2023-12-28 11:36:43 -07:00
renovate[bot]
0f0747e79d chore(deps): update typescript-eslint monorepo to v6.16.0 2023-12-25 20:16:19 +00:00
Tonye Jack
0c2a758b81 chore: update matrix-test.yml (#1814) 2023-12-24 18:06:18 +00:00
tj-actions[bot]
1b6d7b6fb6 Upgraded to v41.0.1 (#1816)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-12-24 17:48:54 +00:00
31 changed files with 2663 additions and 1238 deletions

View File

@@ -208,6 +208,43 @@
"test", "test",
"bug" "bug"
] ]
},
{
"login": "levenleven",
"name": "Aleksey Levenstein",
"avatar_url": "https://avatars.githubusercontent.com/u/6463364?v=4",
"profile": "https://github.com/levenleven",
"contributions": [
"doc"
]
},
{
"login": "dan-hill2802",
"name": "Daniel Hill",
"avatar_url": "https://avatars.githubusercontent.com/u/5046322?v=4",
"profile": "https://github.com/dan-hill2802",
"contributions": [
"doc"
]
},
{
"login": "KeisukeYamashita",
"name": "KeisukeYamashita",
"avatar_url": "https://avatars.githubusercontent.com/u/23056537?v=4",
"profile": "https://keisukeyamashita.com",
"contributions": [
"doc"
]
},
{
"login": "codesculpture",
"name": "Aravind",
"avatar_url": "https://avatars.githubusercontent.com/u/63452117?v=4",
"profile": "https://github.com/codesculpture",
"contributions": [
"code",
"bug"
]
} }
], ],
"contributorsPerLine": 7, "contributorsPerLine": 7,

View File

@@ -17,13 +17,13 @@ on:
schedule: schedule:
- cron: '15 16 * * 2' - cron: '15 16 * * 2'
permissions:
actions: read
contents: read
security-events: write
jobs: jobs:
codacy-security-scan: codacy-security-scan:
# Cancel other workflows that are running for the same branch
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: Codacy Security Scan name: Codacy Security Scan
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -34,7 +34,7 @@ jobs:
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI - name: Run Codacy Analysis CLI
continue-on-error: true continue-on-error: true
uses: codacy/codacy-analysis-cli-action@v4.3.0 uses: codacy/codacy-analysis-cli-action@v4.4.0
with: with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations # You can also omit the token and run the tools that support default configurations

View File

@@ -20,6 +20,11 @@ on:
schedule: schedule:
- cron: '44 20 * * 0' - cron: '44 20 * * 0'
permissions:
actions: read
contents: read
security-events: write
jobs: jobs:
analyze: analyze:
name: Analyze name: Analyze

18
.github/workflows/greetings.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Greetings
on: [pull_request_target, issues]
permissions:
pull-requests: write
issues: write
jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
continue-on-error: true
with:
repo-token: ${{ secrets.PAT_TOKEN }}
issue-message: "Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience."
pr-message: "Thanks for implementing a fix, could you ensure that the test covers your changes if applicable."

View File

@@ -1,4 +1,8 @@
name: Issue Comment Test name: Issue Comment Job Example
permissions:
contents: read
on: on:
issue_comment: issue_comment:

View File

@@ -1,9 +1,11 @@
name: Manual Test name: Manual Triggered Job Example
permissions:
contents: read
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
test: test:
name: Test changed-files name: Test changed-files

View File

@@ -1,4 +1,7 @@
name: Matrix Test name: Matrix Example
permissions:
contents: read
on: on:
workflow_dispatch: workflow_dispatch:
@@ -21,9 +24,7 @@ jobs:
id: changed-files id: changed-files
uses: ./ uses: ./
with: with:
json: true matrix: true
quotepath: false
escape_json: false
- name: List all changed files - name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' run: echo '${{ steps.changed-files.outputs.all_changed_files }}'

67
.github/workflows/multi-job-example.yml vendored Normal file
View File

@@ -0,0 +1,67 @@
name: Multi Job Example
permissions:
contents: read
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
changed-files:
name: Get changed files
runs-on: ubuntu-latest
outputs:
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: ./
- name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
view-changed-files:
name: View all changed files
runs-on: ubuntu-latest
needs: [changed-files]
steps:
- name: List all changed files
run: |
echo '${{ needs.changed-files.outputs.all_changed_files }}'
changed-files-rest-api:
name: Get changed files using REST API
runs-on: ubuntu-latest
outputs:
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
continue-on-error: ${{ github.event_name == 'push' }}
uses: ./
with:
use_rest_api: true
- name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
view-changed-files-rest-api:
name: View all changed files using REST API
runs-on: ubuntu-latest
needs: [changed-files-rest-api]
steps:
- name: List all changed files
run: |
echo '${{ needs.changed-files-rest-api.outputs.all_changed_files }}'

View File

@@ -1,4 +1,9 @@
name: Update release version. name: Update release version
permissions:
contents: write
pull-requests: write
on: on:
release: release:
types: [published] types: [published]
@@ -32,7 +37,7 @@ jobs:
- name: Run git-cliff - name: Run git-cliff
uses: tj-actions/git-cliff@v1 uses: tj-actions/git-cliff@v1
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.2 uses: peter-evans/create-pull-request@v6.0.2
with: with:
base: "main" base: "main"
labels: "merge when passing" labels: "merge when passing"

View File

@@ -1,5 +1,8 @@
name: CI name: CI
permissions:
contents: read
on: on:
push: push:
branches: branches:
@@ -31,6 +34,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
files_changed: ${{ steps.changed_files.outputs.files_changed }} files_changed: ${{ steps.changed_files.outputs.files_changed }}
permissions:
contents: read
pull-requests: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -39,7 +45,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Use Node.js 20.x - name: Use Node.js 20.x
uses: actions/setup-node@v4.0.1 uses: actions/setup-node@v4.0.2
with: with:
cache: 'yarn' cache: 'yarn'
node-version: '20.x' node-version: '20.x'
@@ -54,7 +60,7 @@ jobs:
yarn install yarn install
- name: Run eslint on changed files - name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v21 uses: tj-actions/eslint-changed-files@v23
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
with: with:
token: ${{ secrets.PAT_TOKEN }} token: ${{ secrets.PAT_TOKEN }}
@@ -66,7 +72,7 @@ jobs:
yarn all yarn all
- name: Verify Changed files - name: Verify Changed files
uses: tj-actions/verify-changed-files@v16 uses: tj-actions/verify-changed-files@v19
id: changed_files id: changed_files
with: with:
files: | files: |
@@ -90,7 +96,7 @@ jobs:
branch: ${{ github.head_ref }} branch: ${{ github.head_ref }}
- name: Upload build assets - name: Upload build assets
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: build-assets name: build-assets
path: dist path: dist
@@ -107,6 +113,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout into dir1 - name: Checkout into dir1
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -117,7 +125,7 @@ jobs:
path: dir1 path: dir1
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
path: dir1/dist path: dir1/dist
@@ -143,7 +151,7 @@ jobs:
bash bash
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
path: dir2/dist path: dir2/dist
@@ -181,7 +189,8 @@ jobs:
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true' if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -190,7 +199,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -239,6 +248,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -248,7 +259,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -281,6 +292,8 @@ jobs:
github.event_name == 'push' || github.event_name == 'push' ||
github.event_name == 'pull_request' github.event_name == 'pull_request'
) && needs.build.outputs.files_changed != 'true' ) && needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -290,7 +303,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -311,6 +324,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
@@ -327,7 +342,7 @@ jobs:
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -350,6 +365,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true' if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
@@ -358,7 +375,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -377,6 +394,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true' if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -392,7 +411,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -411,13 +430,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -465,13 +485,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -531,7 +552,7 @@ jobs:
path: dir1 path: dir1
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
path: dir1/dist path: dir1/dist
@@ -546,11 +567,83 @@ jobs:
shell: shell:
bash bash
test-dir-names-nested-folder:
name: Test changed-files with dir-names in a nested folder
runs-on: ubuntu-latest
needs: build
if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
fetch-depth: 0
- name: Download build assets
uses: actions/download-artifact@v4
with:
name: build-assets
path: dist
- name: Get changed files in the .github folder
id: changed-files
uses: ./
with:
path: .github
json: true
escape_json: false
dir_names: true
dir_names_exclude_current_dir: true
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files.outputs) }}"
shell:
bash
test-non-existing-repository:
name: Test changed-files with non existing repository
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps:
- name: Checkout into dir1
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
fetch-depth: 0
path: dir1
- name: Download build assets
uses: actions/download-artifact@v4
with:
name: build-assets
path: dir1/dist
- name: Run changed-files with non existing repository
id: changed-files
continue-on-error: true
uses: ./dir1
- name: Verify failed
if: steps.changed-files.outcome != 'failure'
run: |
echo "Expected: (failure) got ${{ steps.changed-files.outcome }}"
exit 1
test-submodules: test-submodules:
name: Test changed-files with submodule name: Test changed-files with submodule
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -566,7 +659,7 @@ jobs:
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -594,6 +687,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -609,7 +704,7 @@ jobs:
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -669,6 +764,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -684,7 +781,7 @@ jobs:
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -859,6 +956,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -892,6 +991,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -933,6 +1034,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -949,7 +1052,7 @@ jobs:
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
@@ -983,6 +1086,8 @@ jobs:
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
needs: build needs: build
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 4 max-parallel: 4
@@ -998,7 +1103,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-assets name: build-assets
- name: Dump GitHub context - name: Dump GitHub context
@@ -1013,7 +1118,7 @@ jobs:
echo '${{ toJSON(steps.changed-files.outputs) }}' echo '${{ toJSON(steps.changed-files.outputs) }}'
shell: shell:
bash bash
- name: Run changed-files with dir name - name: Run changed-files with dir name pattern
id: changed-files-dir-name id: changed-files-dir-name
uses: ./ uses: ./
with: with:

View File

@@ -1,5 +1,9 @@
name: Format README.md name: Format README.md
permissions:
contents: read
pull-requests: write
on: on:
push: push:
branches: branches:
@@ -23,7 +27,7 @@ jobs:
uses: tj-actions/remark@v3 uses: tj-actions/remark@v3
- name: Verify Changed files - name: Verify Changed files
uses: tj-actions/verify-changed-files@v16 uses: tj-actions/verify-changed-files@v19
id: verify_changed_files id: verify_changed_files
with: with:
files: | files: |
@@ -37,7 +41,7 @@ jobs:
- name: Create Pull Request - name: Create Pull Request
if: failure() if: failure()
uses: peter-evans/create-pull-request@v5 uses: peter-evans/create-pull-request@v6
with: with:
base: "main" base: "main"
labels: "merge when passing" labels: "merge when passing"

View File

@@ -0,0 +1,41 @@
name: Workflow Run Example
on:
workflow_run:
workflows: [Matrix Example]
types: [completed]
permissions:
contents: read
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: ./
- name: Echo list of changed files on success
run: |
echo "Changed files on success:"
echo "${{ steps.changed-files.outputs.all_changed_files }}"
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: ./
- name: Echo list of changed files on failure
run: |
echo "Changed files on failure:"
echo "${{ steps.changed-files.outputs.all_changed_files }}"

File diff suppressed because it is too large Load Diff

165
README.md
View File

@@ -1,25 +1,25 @@
[![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge\&logo=ubuntu\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on) [![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge\&logo=ubuntu\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
[![Mac OS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\&logo=macos\&logoColor=F0F0F0)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on) [![Mac OS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\&logo=macos\&logoColor=F0F0F0)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
[![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\&logo=windows\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on) [![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\&logo=windows\&logoColor=white)](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
[![Public workflows that use this action.](https://img.shields.io/endpoint?style=for-the-badge\&url=https%3A%2F%2Fused-by.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Fchanged-files%26badge%3Dtrue)](https://github.com/search?o=desc\&q=tj-actions+changed-files+language%3AYAML\&s=\&type=Code) [![Public workflows that use this action.](https://img.shields.io/endpoint?style=for-the-badge\&url=https%3A%2F%2Fused-by.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Fchanged-files%26package_id%3DUGFja2FnZS0yOTQyNTU4MDk5%26badge%3Dtrue)](https://github.com/search?o=desc\&q=tj-actions+changed-files+language%3AYAML\&s=\&type=Code)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/4a625e9b62794b5b98e169c15c0e673c)](https://app.codacy.com/gh/tj-actions/changed-files/dashboard?utm_source=gh\&utm_medium=referral\&utm_content=\&utm_campaign=Badge_grade) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/4fe2f49c3ab144b0bbe4effc85a061a0)](https://app.codacy.com/gh/tj-actions/changed-files/dashboard?utm_source=gh\&utm_medium=referral\&utm_content=\&utm_campaign=Badge_grade)
[![CI](https://github.com/tj-actions/changed-files/actions/workflows/test.yml/badge.svg)](https://github.com/tj-actions/changed-files/actions/workflows/test.yml) [![CI](https://github.com/tj-actions/changed-files/actions/workflows/test.yml/badge.svg)](https://github.com/tj-actions/changed-files/actions/workflows/test.yml)
[![Update release version.](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml/badge.svg)](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml) [![Update release version.](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml/badge.svg)](https://github.com/tj-actions/changed-files/actions/workflows/sync-release-version.yml)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors-) [![All Contributors](https://img.shields.io/badge/all_contributors-26-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END --> <!-- ALL-CONTRIBUTORS-BADGE:END -->
## changed-files ## 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. Effortlessly track all changed files and directories relative to a target branch, the current branch (preceding commit or the last remote commit), multiple branches, or custom commits returning **relative paths** from the project root using this GitHub action.
> \[!NOTE] > \[!NOTE]
> >
> * This action solely identifies files that have changed within the context of events such as `pull_request*`, `push`, and more. However, it doesn't detect pending uncommitted changes created during the workflow execution. > * This action solely identifies files that have changed for events such as [`pull_request*`, `push`, `merge_group`, `release`, and many more](#other-supported-events-electron). However, it doesn't detect pending uncommitted changes created during the workflow execution.
> >
> See: https://github.com/tj-actions/verify-changed-files instead > See: https://github.com/tj-actions/verify-changed-files instead
@@ -28,7 +28,7 @@ Effortlessly track all changed files and directories relative to a target branch
* [Features 🚀](#features-) * [Features 🚀](#features-)
* [Usage 💻](#usage-) * [Usage 💻](#usage-)
* [On `pull_request` 🔀](#on-pull_request-) * [On `pull_request` 🔀](#on-pull_request-)
* [Using local .git history 📁](#using-local-git-history-) * [Using local .git directory 📁](#using-local-git-directory-)
* [Using Github's API :octocat:](#using-githubs-api-octocat) * [Using Github's API :octocat:](#using-githubs-api-octocat)
* [On `push` ⬆️](#on-push-) * [On `push` ⬆️](#on-push-)
* [Other supported events :electron:](#other-supported-events-electron) * [Other supported events :electron:](#other-supported-events-electron)
@@ -54,7 +54,7 @@ Effortlessly track all changed files and directories relative to a target branch
* Scales to handle large/mono repositories. * Scales to handle large/mono repositories.
* Supports Git submodules. * 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 requests. * 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. * Generates escaped [JSON output for running matrix jobs](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-example.yml) based on changed files.
* Lists changed directories. * Lists changed directories.
* Limits matching changed directories to a specified maximum depth. * Limits matching changed directories to a specified maximum depth.
* Optionally excludes the current directory. * Optionally excludes the current directory.
@@ -97,7 +97,7 @@ Visit the [discussions for more information](https://github.com/tj-actions/chang
Detect changes to all files in a Pull request relative to the target branch or since the last pushed commit. Detect changes to all files in a Pull request relative to the target branch or since the last pushed commit.
#### Using local .git history 📁 #### Using local .git directory 📁
```yaml ```yaml
name: CI name: CI
@@ -119,10 +119,12 @@ jobs:
with: with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
# -----------------------------------------------------------------------------------------------------------
# Example 1 # Example 1
# -----------------------------------------------------------------------------------------------------------
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g # To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with: # with:
# since_last_remote_commit: true # since_last_remote_commit: true
@@ -131,14 +133,16 @@ jobs:
env: env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: | run: |
for file in "$ALL_CHANGED_FILES"; do for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed" echo "$file was changed"
done done
# -----------------------------------------------------------------------------------------------------------
# Example 2 # Example 2
# -----------------------------------------------------------------------------------------------------------
- name: Get all changed markdown files - name: Get all changed markdown files
id: changed-markdown-files id: changed-markdown-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
# Avoid using single or double quotes for multiline patterns # Avoid using single or double quotes for multiline patterns
files: | files: |
@@ -149,20 +153,21 @@ jobs:
env: env:
ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }}
run: | run: |
for file in "$ALL_CHANGED_FILES"; do for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed" echo "$file was changed"
done done
# -----------------------------------------------------------------------------------------------------------
# Example 3 # Example 3
# -----------------------------------------------------------------------------------------------------------
- name: Get all test, doc and src files that have changed - name: Get all test, doc and src files that have changed
id: changed-files-yaml id: changed-files-yaml
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
files_yaml: | files_yaml: |
doc: doc:
- '**.md' - '**.md'
- docs/** - docs/**
- README.md
test: test:
- test/** - test/**
- '!test/**.md' - '!test/**.md'
@@ -187,10 +192,12 @@ jobs:
echo "One or more doc file(s) has changed." echo "One or more doc file(s) has changed."
echo "List all the files that have changed: $DOC_ALL_CHANGED_FILES" echo "List all the files that have changed: $DOC_ALL_CHANGED_FILES"
# Example 3 # -----------------------------------------------------------------------------------------------------------
# Example 4
# -----------------------------------------------------------------------------------------------------------
- name: Get changed files in the docs folder - name: Get changed files in the docs folder
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
files: docs/*.{js,html} # Alternatively using: `docs/**` files: docs/*.{js,html} # Alternatively using: `docs/**`
files_ignore: docs/static.js files_ignore: docs/static.js
@@ -232,13 +239,13 @@ jobs:
steps: steps:
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
- name: List all changed files - name: List all changed files
env: env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: | run: |
for file in "$ALL_CHANGED_FILES"; do for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed" echo "$file was changed"
done done
``` ```
@@ -275,14 +282,14 @@ jobs:
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit. # NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
- name: List all changed files - name: List all changed files
env: env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: | run: |
for file in "$ALL_CHANGED_FILES"; do for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed" echo "$file was changed"
done done
... ...
@@ -293,6 +300,7 @@ jobs:
* [schedule](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) * [schedule](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule)
* [release](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release) * [release](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)
* [workflow\_dispatch](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) * [workflow\_dispatch](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch)
* [workflow\_run](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run)
* [merge\_group](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#merge_group) * [merge\_group](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#merge_group)
* [issue\_comment](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment) * [issue\_comment](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment)
* ...and many more * ...and many more
@@ -313,14 +321,15 @@ Support this project with a :star:
> >
> * When using `files_yaml*` inputs: > * When using `files_yaml*` inputs:
> * All keys must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`. > * All keys must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
> For example, `test` or `test_key` or `tesT-key` are all valid. >
> For example, `test` or `test_key` or `test-key` or `_test_key` are all valid.
## Inputs ⚙️ ## Inputs ⚙️
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section --> <!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
```yaml ```yaml
- uses: tj-actions/changed-files@v41 - uses: tj-actions/changed-files@v42
id: changed-files id: changed-files
with: with:
# Github API URL. # Github API URL.
@@ -479,11 +488,18 @@ Support this project with a :star:
# Output list of changed files in a JSON formatted # Output list of changed files in a JSON formatted
# string which can be used for matrix jobs. Example: # string which can be used for matrix jobs. Example:
# https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml # https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-example.yml
# Type: boolean # Type: boolean
# Default: "false" # Default: "false"
json: '' json: ''
# Output changed files in a format that can be
# used for matrix jobs. Alias for setting inputs `json`
# to `true` and `escape_json` to `false`.
# Type: boolean
# Default: "false"
matrix: ''
# Apply the negation patterns first. NOTE: This affects how # Apply the negation patterns first. NOTE: This affects how
# changed files are matched. # changed files are matched.
# Type: boolean # Type: boolean
@@ -584,10 +600,10 @@ Support this project with a :star:
# Default: "false" # Default: "false"
since_last_remote_commit: '' since_last_remote_commit: ''
# Skip the initial fetch to improve performance for shallow # Skip initially fetching additional history to improve performance for
# repositories. NOTE: This could lead to errors with missing # shallow repositories. NOTE: This could lead to errors with
# history and the intended use is limited to when # missing history. It's intended to be used when you've
# you've fetched the history necessary to perform the diff. # fetched all necessary history to perform the diff.
# Type: boolean # Type: boolean
# Default: "false" # Default: "false"
skip_initial_fetch: '' skip_initial_fetch: ''
@@ -603,6 +619,12 @@ Support this project with a :star:
# Type: string # Type: string
until: '' until: ''
# Force the use of Github's REST API even when
# a local copy of the repository exists
# Type: boolean
# Default: "false"
use_rest_api: ''
# Write outputs to the `output_dir` defaults to `.github/outputs` folder. # Write outputs to the `output_dir` defaults to `.github/outputs` folder.
# NOTE: This creates a `.txt` file by default and # NOTE: This creates a `.txt` file by default and
# a `.json` file if `json` is set to `true`. # a `.json` file if `json` is set to `true`.
@@ -650,9 +672,9 @@ Support this project with a :star:
| <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` | | <a name="output_all_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"></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_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_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 have changed. This <br>defaults to `true` when no <br>patterns are specified. i.e. *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_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 have been deleted. <br>This defaults to `true` when <br>no patterns are specified. (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_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 have been modified. <br>This defaults to `true` when <br>no patterns are specified. i.e. <br>*includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
| <a name="output_changed_keys"></a>[changed\_keys](#output_changed_keys) | string | Returns all changed YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)* | | <a name="output_changed_keys"></a>[changed\_keys](#output_changed_keys) | string | Returns all changed YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)* |
| <a name="output_copied_files"></a>[copied\_files](#output_copied_files) | string | Returns only files that are <br>Copied (C). | | <a name="output_copied_files"></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_copied_files_count"></a>[copied\_files\_count](#output_copied_files_count) | string | Returns the number of `copied_files` |
@@ -661,9 +683,9 @@ Support this project with a :star:
| <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"></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_modified_files_count"></a>[modified\_files\_count](#output_modified_files_count) | string | Returns the number of `modified_files` |
| <a name="output_modified_keys"></a>[modified\_keys](#output_modified_keys) | string | Returns all modified YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)* | | <a name="output_modified_keys"></a>[modified\_keys](#output_modified_keys) | string | Returns all modified YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)* |
| <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. | | <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have 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_deleted"></a>[only\_deleted](#output_only_deleted) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have 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_only_modified"></a>[only\_modified](#output_only_modified) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have 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"></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_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"></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)* |
@@ -702,7 +724,7 @@ The format of the version string is as follows:
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
... ...
``` ```
@@ -715,7 +737,7 @@ The format of the version string is as follows:
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection. safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
@@ -723,7 +745,7 @@ The format of the version string is as follows:
env: env:
ADDED_FILES: ${{ steps.changed-files.outputs.added_files }} ADDED_FILES: ${{ steps.changed-files.outputs.added_files }}
run: | run: |
for file in "$ADDED_FILES"; do for file in ${ADDED_FILES}; do
echo "$file was added" echo "$file was added"
done done
... ...
@@ -738,7 +760,7 @@ The format of the version string is as follows:
... ...
- name: Get all changed files and use a comma separator in the output - name: Get all changed files and use a comma separator in the output
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
separator: "," separator: ","
... ...
@@ -755,13 +777,13 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
- name: List all added files - name: List all added files
env: env:
ADDED_FILES: ${{ steps.changed-files.outputs.added_files }} ADDED_FILES: ${{ steps.changed-files.outputs.added_files }}
run: | run: |
for file in "$ADDED_FILES"; do for file in ${ADDED_FILES}; do
echo "$file was added" echo "$file was added"
done done
... ...
@@ -778,7 +800,7 @@ See [outputs](#outputs) for a list of all available outputs.
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
- name: Run a step if my-file.txt was modified - name: Run a step if my-file.txt was modified
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt') if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
@@ -799,7 +821,7 @@ See [outputs](#outputs) for a list of all available outputs.
- name: Get changed files and write the outputs to a Txt file - name: Get changed files and write the outputs to a Txt file
id: changed-files-write-output-files-txt id: changed-files-write-output-files-txt
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
write_output_files: true write_output_files: true
@@ -818,7 +840,7 @@ See [outputs](#outputs) for a list of all available outputs.
... ...
- name: Get changed files and write the outputs to a JSON file - name: Get changed files and write the outputs to a JSON file
id: changed-files-write-output-files-json id: changed-files-write-output-files-json
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
json: true json: true
write_output_files: true write_output_files: true
@@ -838,7 +860,7 @@ See [outputs](#outputs) for a list of all available outputs.
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -861,7 +883,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files - name: Get changed files
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -886,7 +908,7 @@ See [inputs](#inputs) for more information.
env: env:
DELETED_FILES: ${{ steps.changed-files-specific.outputs.deleted_files }} DELETED_FILES: ${{ steps.changed-files-specific.outputs.deleted_files }}
run: | run: |
for file in "$DELETED_FILES"; do for file in ${DELETED_FILES}; do
echo "$file was deleted" echo "$file was deleted"
done done
@@ -895,7 +917,7 @@ See [inputs](#inputs) for more information.
env: env:
DELETED_FILES: ${{ steps.changed-files-specific.outputs.deleted_files }} DELETED_FILES: ${{ steps.changed-files-specific.outputs.deleted_files }}
run: | run: |
for file in "$DELETED_FILES"; do for file in ${DELETED_FILES}; do
echo "$file was deleted" echo "$file was deleted"
done done
... ...
@@ -912,7 +934,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. - name: Get changed files using a source file or list of file(s) to populate to files input.
id: changed-files-specific-source-file id: changed-files-specific-source-file
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
files_from_source_file: test/changed-files-list.txt files_from_source_file: test/changed-files-list.txt
... ...
@@ -929,7 +951,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. - 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 id: changed-files-specific-source-file-and-specify-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
files_from_source_file: | files_from_source_file: |
test/changed-files-list.txt test/changed-files-list.txt
@@ -950,7 +972,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files using a different SHA - name: Get changed files using a different SHA
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
sha: ${{ github.event.pull_request.head.sha }} sha: ${{ github.event.pull_request.head.sha }}
... ...
@@ -967,7 +989,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files using a different base SHA - name: Get changed files using a different base SHA
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
base_sha: ${{ github.event.pull_request.base.sha }} base_sha: ${{ github.event.pull_request.base.sha }}
... ...
@@ -999,13 +1021,18 @@ jobs:
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
- name: List changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "List all the files that have changed: $ALL_CHANGED_FILES"
- name: Get changed files in the .github folder - name: Get changed files in the .github folder
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
files: .github/** files: .github/**
- name: Run step if any file(s) in the .github folder change - name: Run step if any file(s) in the .github folder change
@@ -1035,7 +1062,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with defaults in dir1 - name: Run changed-files with defaults in dir1
id: changed-files-for-dir1 id: changed-files-for-dir1
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
path: dir1 path: dir1
@@ -1044,7 +1071,7 @@ See [inputs](#inputs) for more information.
ADDED_FILES: |- ADDED_FILES: |-
${{ steps.changed-files-for-dir1.outputs.added_files }} ${{ steps.changed-files-for-dir1.outputs.added_files }}
run: | run: |
for file in "$ADDED_FILES"; do for file in ${ADDED_FILES}; do
echo "$file was added" echo "$file was added"
done done
... ...
@@ -1061,13 +1088,13 @@ See [inputs](#inputs) for more information.
... ...
- name: Run changed-files with quotepath disabled - name: Run changed-files with quotepath disabled
id: changed-files-quotepath id: changed-files-quotepath
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
quotepath: "false" quotepath: "false"
- name: Run changed-files with quotepath disabled for a specified list of file(s) - name: Run changed-files with quotepath disabled for a specified list of file(s)
id: changed-files-quotepath-specific id: changed-files-quotepath-specific
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
files: test/test-è.txt files: test/test-è.txt
quotepath: "false" quotepath: "false"
@@ -1100,7 +1127,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with the commit of the last successful test workflow run - name: Run changed-files with the commit of the last successful test workflow run
id: changed-files-base-sha-push id: changed-files-base-sha-push
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }} base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
... ...
@@ -1127,7 +1154,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 - 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 id: changed-files-base-sha-pull-request
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }} base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
... ...
@@ -1153,7 +1180,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Run changed-files with dir_names - name: Run changed-files with dir_names
id: changed-files-dir-names id: changed-files-dir-names
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
dir_names: "true" dir_names: "true"
... ...
@@ -1170,7 +1197,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Run changed-files with JSON output - name: Run changed-files with JSON output
id: changed-files-json id: changed-files-json
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
json: "true" json: "true"
... ...
@@ -1187,13 +1214,13 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed-files since 2022-08-19 - name: Get changed-files since 2022-08-19
id: changed-files-since id: changed-files-since
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
since: "2022-08-19" since: "2022-08-19"
- name: Get changed-files until 2022-08-20 - name: Get changed-files until 2022-08-20
id: changed-files-until id: changed-files-until
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v42
with: with:
until: "2022-08-20" until: "2022-08-20"
... ...
@@ -1213,7 +1240,7 @@ See [inputs](#inputs) for more information.
* [coder/code-server: uses tj-actions/changed-files to automate detecting changes and run steps based on the outcome](https://github.com/coder/code-server/blob/c32a31d802f679846876b8ad9aacff6cf7b5361d/.github/workflows/build.yaml#L48) * [coder/code-server: uses tj-actions/changed-files to automate detecting changes and run steps based on the outcome](https://github.com/coder/code-server/blob/c32a31d802f679846876b8ad9aacff6cf7b5361d/.github/workflows/build.yaml#L48)
* [tldr-pages/tldr: uses tj-actions/changed-files to automate detecting spelling errors](https://github.com/tldr-pages/tldr/blob/main/.github/workflows/codespell.yml#L14) * [tldr-pages/tldr: uses tj-actions/changed-files to automate detecting spelling errors](https://github.com/tldr-pages/tldr/blob/c1b714c55cb0048037b79a681a10d7f3ddb0164c/.github/workflows/codespell.yml#L18-L26)
* [nodejs/docker-node: uses tj-actions/changed-files to generate matrix jobs based on changes detected](https://github.com/nodejs/docker-node/blob/3c4fa6daf06a4786d202f2f610351837806a0380/.github/workflows/build-test.yml#L29) * [nodejs/docker-node: uses tj-actions/changed-files to generate matrix jobs based on changes detected](https://github.com/nodejs/docker-node/blob/3c4fa6daf06a4786d202f2f610351837806a0380/.github/workflows/build-test.yml#L29)
@@ -1221,10 +1248,14 @@ See [inputs](#inputs) for more information.
* [aws-doc-sdk-examples: uses tj-actions/changed-files to automate testing](https://github.com/awsdocs/aws-doc-sdk-examples/blob/2393723ef6b0cad9502f4852f5c72f7be58ca89d/.github/workflows/javascript.yml#L22) * [aws-doc-sdk-examples: uses tj-actions/changed-files to automate testing](https://github.com/awsdocs/aws-doc-sdk-examples/blob/2393723ef6b0cad9502f4852f5c72f7be58ca89d/.github/workflows/javascript.yml#L22)
* [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) * [nhost: uses tj-actions/changed-files to automate testing based on changes detected](https://github.com/nhost/nhost/blob/71a8ce444618a8ac4d660518172fba4883c4014b/.github/workflows/ci.yaml#L44-L48)
* [qmk\_firmware uses tj-actions/changed-files to run linters](https://github.com/qmk/qmk_firmware/blob/7a737235ffd49c32d2c5561e8fe53fd96baa7f96/.github/workflows/lint.yml#L30) * [qmk\_firmware uses tj-actions/changed-files to run linters](https://github.com/qmk/qmk_firmware/blob/7a737235ffd49c32d2c5561e8fe53fd96baa7f96/.github/workflows/lint.yml#L30)
* [argo-cd uses tj-actions/chnaged-files to detect changed frontend or backend files](https://github.com/argoproj/argo-cd/blob/5bc1850aa1d26301043be9f2fb825d88c80c111c/.github/workflows/ci-build.yaml#L33)
* [argo-workflows uses tj-actions/changed-files to run specific jobs based on changes detected](https://github.com/argoproj/argo-workflows/blob/baef4856ff2603c76dbe277c825eaa3f9788fc91/.github/workflows/ci-build.yaml#L34)
And many more... And many more...
### Scalability Example 📈 ### Scalability Example 📈
@@ -1322,6 +1353,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
</tr> </tr>
<tr> <tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rodrigorfk"><img src="https://avatars.githubusercontent.com/u/1995033?v=4?s=100" width="100px;" alt="Rodrigo Fior Kuntzer"/><br /><sub><b>Rodrigo Fior Kuntzer</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=rodrigorfk" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=rodrigorfk" title="Tests">⚠️</a> <a href="https://github.com/tj-actions/changed-files/issues?q=author%3Arodrigorfk" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/rodrigorfk"><img src="https://avatars.githubusercontent.com/u/1995033?v=4?s=100" width="100px;" alt="Rodrigo Fior Kuntzer"/><br /><sub><b>Rodrigo Fior Kuntzer</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=rodrigorfk" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=rodrigorfk" title="Tests">⚠️</a> <a href="https://github.com/tj-actions/changed-files/issues?q=author%3Arodrigorfk" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/levenleven"><img src="https://avatars.githubusercontent.com/u/6463364?v=4?s=100" width="100px;" alt="Aleksey Levenstein"/><br /><sub><b>Aleksey Levenstein</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=levenleven" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dan-hill2802"><img src="https://avatars.githubusercontent.com/u/5046322?v=4?s=100" width="100px;" alt="Daniel Hill"/><br /><sub><b>Daniel Hill</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=dan-hill2802" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://keisukeyamashita.com"><img src="https://avatars.githubusercontent.com/u/23056537?v=4?s=100" width="100px;" alt="KeisukeYamashita"/><br /><sub><b>KeisukeYamashita</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=KeisukeYamashita" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/codesculpture"><img src="https://avatars.githubusercontent.com/u/63452117?v=4?s=100" width="100px;" alt="Aravind"/><br /><sub><b>Aravind</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=codesculpture" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/issues?q=author%3Acodesculpture" title="Bug reports">🐛</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@@ -127,7 +127,7 @@ inputs:
required: false required: false
default: "false" default: "false"
json: json:
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" 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-example.yml"
required: false required: false
default: "false" default: "false"
escape_json: escape_json:
@@ -144,8 +144,8 @@ inputs:
default: "50" default: "50"
skip_initial_fetch: skip_initial_fetch:
description: | description: |
Skip the initial fetch to improve performance for shallow repositories. Skip initially fetching additional history 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. NOTE: This could lead to errors with missing history. It's intended to be used when you've fetched all necessary history to perform the diff.
required: false required: false
default: "false" default: "false"
fetch_additional_submodule_history: fetch_additional_submodule_history:
@@ -203,6 +203,10 @@ inputs:
description: "Github API URL." description: "Github API URL."
required: false required: false
default: ${{ github.api_url }} default: ${{ github.api_url }}
use_rest_api:
description: "Force the use of Github's REST API even when a local copy of the repository exists"
required: false
default: "false"
fail_on_initial_diff_error: fail_on_initial_diff_error:
description: "Fail when the initial diff fails." description: "Fail when the initial diff fails."
required: false required: false
@@ -215,6 +219,10 @@ inputs:
description: "Apply the negation patterns first. NOTE: This affects how changed files are matched." description: "Apply the negation patterns first. NOTE: This affects how changed files are matched."
required: false required: false
default: "false" default: "false"
matrix:
description: "Output changed files in a format that can be used for matrix jobs. Alias for setting inputs `json` to `true` and `escape_json` to `false`."
required: false
default: "false"
outputs: outputs:
added_files: added_files:
@@ -262,9 +270,9 @@ outputs:
all_changed_files_count: all_changed_files_count:
description: "Returns the number of `all_changed_files`" description: "Returns the number of `all_changed_files`"
any_changed: any_changed:
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)*." description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have changed. This defaults to `true` when no patterns are specified. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
only_changed: only_changed:
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)*." description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
other_changed_files: other_changed_files:
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)*." 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: other_changed_files_count:
@@ -274,17 +282,17 @@ outputs:
all_modified_files_count: all_modified_files_count:
description: "Returns the number of `all_modified_files`" description: "Returns the number of `all_modified_files`"
any_modified: any_modified:
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)*." description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been modified. This defaults to `true` when no patterns are specified. i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
only_modified: only_modified:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)." description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been modified. (ACMRD)."
other_modified_files: other_modified_files:
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*" description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
other_modified_files_count: other_modified_files_count:
description: "Returns the number of `other_modified_files`" description: "Returns the number of `other_modified_files`"
any_deleted: any_deleted:
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been deleted. This defaults to `true` when no patterns are specified. (D)"
only_deleted: only_deleted:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been deleted. (D)"
other_deleted_files: other_deleted_files:
description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*" description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
other_deleted_files_count: other_deleted_files_count:

549
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

@@ -10,4 +10,4 @@ module.exports = {
setupFiles: [ setupFiles: [
"<rootDir>/jest/setupEnv.cjs" "<rootDir>/jest/setupEnv.cjs"
] ]
} };

View File

@@ -1,6 +1,6 @@
{ {
"name": "@tj-actions/changed-files", "name": "@tj-actions/changed-files",
"version": "41.0.0", "version": "42.1.0",
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.", "description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
"main": "lib/main.js", "main": "lib/main.js",
"publishConfig": { "publishConfig": {
@@ -46,8 +46,8 @@
"@types/micromatch": "^4.0.2", "@types/micromatch": "^4.0.2",
"@types/node": "^20.3.2", "@types/node": "^20.3.2",
"@types/uuid": "^9.0.2", "@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^6.0.0", "@typescript-eslint/parser": "^7.0.0",
"@vercel/ncc": "^0.38.0", "@vercel/ncc": "^0.38.0",
"eslint": "^8.43.0", "eslint": "^8.43.0",
"eslint-plugin-github": "^4.8.0", "eslint-plugin-github": "^4.8.0",

View File

@@ -0,0 +1,343 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getInputs should correctly parse boolean inputs 1`] = `
{
"apiUrl": undefined,
"baseSha": undefined,
"diffRelative": "false",
"dirNames": "false",
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": "false",
"dirNamesExcludeCurrentDir": "false",
"dirNamesIncludeFiles": undefined,
"dirNamesIncludeFilesSeparator": undefined,
"escapeJson": false,
"failOnInitialDiffError": "false",
"failOnSubmoduleDiffError": "false",
"fetchAdditionalSubmoduleHistory": "false",
"files": undefined,
"filesFromSourceFile": undefined,
"filesFromSourceFileSeparator": undefined,
"filesIgnore": undefined,
"filesIgnoreFromSourceFile": undefined,
"filesIgnoreFromSourceFileSeparator": undefined,
"filesIgnoreSeparator": undefined,
"filesIgnoreYaml": undefined,
"filesIgnoreYamlFromSourceFile": undefined,
"filesIgnoreYamlFromSourceFileSeparator": undefined,
"filesSeparator": undefined,
"filesYaml": undefined,
"filesYamlFromSourceFile": undefined,
"filesYamlFromSourceFileSeparator": undefined,
"includeAllOldNewRenamedFiles": "false",
"json": true,
"negationPatternsFirst": "false",
"oldNewFilesSeparator": undefined,
"oldNewSeparator": undefined,
"outputDir": undefined,
"outputRenamedFilesAsDeletedAndAdded": "false",
"path": undefined,
"quotepath": "false",
"recoverDeletedFiles": "false",
"recoverDeletedFilesToDestination": undefined,
"recoverFiles": undefined,
"recoverFilesIgnore": undefined,
"recoverFilesIgnoreSeparator": undefined,
"recoverFilesSeparator": undefined,
"safeOutput": "false",
"separator": undefined,
"sha": undefined,
"since": undefined,
"sinceLastRemoteCommit": "false",
"skipInitialFetch": "true",
"token": undefined,
"until": undefined,
"useRestApi": "false",
"writeOutputFiles": "false",
}
`;
exports[`getInputs should correctly parse numeric inputs 1`] = `
{
"apiUrl": "",
"baseSha": "",
"diffRelative": true,
"dirNames": false,
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
"dirNamesExcludeCurrentDir": false,
"dirNamesIncludeFiles": "",
"dirNamesIncludeFilesSeparator": "",
"dirNamesMaxDepth": 2,
"escapeJson": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
"fetchDepth": 5,
"files": "",
"filesFromSourceFile": "",
"filesFromSourceFileSeparator": "",
"filesIgnore": "",
"filesIgnoreFromSourceFile": "",
"filesIgnoreFromSourceFileSeparator": "",
"filesIgnoreSeparator": "",
"filesIgnoreYaml": "",
"filesIgnoreYamlFromSourceFile": "",
"filesIgnoreYamlFromSourceFileSeparator": "",
"filesSeparator": "",
"filesYaml": "",
"filesYamlFromSourceFile": "",
"filesYamlFromSourceFileSeparator": "",
"includeAllOldNewRenamedFiles": false,
"json": false,
"negationPatternsFirst": false,
"oldNewFilesSeparator": "",
"oldNewSeparator": "",
"outputDir": "",
"outputRenamedFilesAsDeletedAndAdded": false,
"path": "",
"quotepath": true,
"recoverDeletedFiles": false,
"recoverDeletedFilesToDestination": "",
"recoverFiles": "",
"recoverFilesIgnore": "",
"recoverFilesIgnoreSeparator": "",
"recoverFilesSeparator": "",
"safeOutput": false,
"separator": "",
"sha": "",
"since": "",
"sinceLastRemoteCommit": false,
"skipInitialFetch": false,
"token": "",
"until": "",
"useRestApi": false,
"writeOutputFiles": false,
}
`;
exports[`getInputs should correctly parse string inputs 1`] = `
{
"apiUrl": "https://api.github.com",
"baseSha": "",
"diffRelative": true,
"dirNames": false,
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
"dirNamesExcludeCurrentDir": false,
"dirNamesIncludeFiles": "",
"dirNamesIncludeFilesSeparator": "",
"escapeJson": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
"files": "",
"filesFromSourceFile": "",
"filesFromSourceFileSeparator": "",
"filesIgnore": "",
"filesIgnoreFromSourceFile": "",
"filesIgnoreFromSourceFileSeparator": "",
"filesIgnoreSeparator": "",
"filesIgnoreYaml": "",
"filesIgnoreYamlFromSourceFile": "",
"filesIgnoreYamlFromSourceFileSeparator": "",
"filesSeparator": "",
"filesYaml": "",
"filesYamlFromSourceFile": "",
"filesYamlFromSourceFileSeparator": "",
"includeAllOldNewRenamedFiles": false,
"json": false,
"negationPatternsFirst": false,
"oldNewFilesSeparator": "",
"oldNewSeparator": "",
"outputDir": "",
"outputRenamedFilesAsDeletedAndAdded": false,
"path": "",
"quotepath": true,
"recoverDeletedFiles": false,
"recoverDeletedFilesToDestination": "",
"recoverFiles": "",
"recoverFilesIgnore": "",
"recoverFilesIgnoreSeparator": "",
"recoverFilesSeparator": "",
"safeOutput": false,
"separator": "",
"sha": "",
"since": "",
"sinceLastRemoteCommit": false,
"skipInitialFetch": false,
"token": "token",
"until": "",
"useRestApi": false,
"writeOutputFiles": false,
}
`;
exports[`getInputs should handle invalid numeric inputs correctly 1`] = `
{
"apiUrl": "",
"baseSha": "",
"diffRelative": true,
"dirNames": false,
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
"dirNamesExcludeCurrentDir": false,
"dirNamesIncludeFiles": "",
"dirNamesIncludeFilesSeparator": "",
"dirNamesMaxDepth": 2,
"escapeJson": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
"fetchDepth": NaN,
"files": "",
"filesFromSourceFile": "",
"filesFromSourceFileSeparator": "",
"filesIgnore": "",
"filesIgnoreFromSourceFile": "",
"filesIgnoreFromSourceFileSeparator": "",
"filesIgnoreSeparator": "",
"filesIgnoreYaml": "",
"filesIgnoreYamlFromSourceFile": "",
"filesIgnoreYamlFromSourceFileSeparator": "",
"filesSeparator": "",
"filesYaml": "",
"filesYamlFromSourceFile": "",
"filesYamlFromSourceFileSeparator": "",
"includeAllOldNewRenamedFiles": false,
"json": false,
"negationPatternsFirst": false,
"oldNewFilesSeparator": "",
"oldNewSeparator": "",
"outputDir": "",
"outputRenamedFilesAsDeletedAndAdded": false,
"path": "",
"quotepath": true,
"recoverDeletedFiles": false,
"recoverDeletedFilesToDestination": "",
"recoverFiles": "",
"recoverFilesIgnore": "",
"recoverFilesIgnoreSeparator": "",
"recoverFilesSeparator": "",
"safeOutput": false,
"separator": "",
"sha": "",
"since": "",
"sinceLastRemoteCommit": false,
"skipInitialFetch": false,
"token": "",
"until": "",
"useRestApi": false,
"writeOutputFiles": false,
}
`;
exports[`getInputs should handle negative numeric inputs correctly 1`] = `
{
"apiUrl": "",
"baseSha": "",
"diffRelative": true,
"dirNames": false,
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
"dirNamesExcludeCurrentDir": false,
"dirNamesIncludeFiles": "",
"dirNamesIncludeFilesSeparator": "",
"dirNamesMaxDepth": -2,
"escapeJson": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
"fetchDepth": 2,
"files": "",
"filesFromSourceFile": "",
"filesFromSourceFileSeparator": "",
"filesIgnore": "",
"filesIgnoreFromSourceFile": "",
"filesIgnoreFromSourceFileSeparator": "",
"filesIgnoreSeparator": "",
"filesIgnoreYaml": "",
"filesIgnoreYamlFromSourceFile": "",
"filesIgnoreYamlFromSourceFileSeparator": "",
"filesSeparator": "",
"filesYaml": "",
"filesYamlFromSourceFile": "",
"filesYamlFromSourceFileSeparator": "",
"includeAllOldNewRenamedFiles": false,
"json": false,
"negationPatternsFirst": false,
"oldNewFilesSeparator": "",
"oldNewSeparator": "",
"outputDir": "",
"outputRenamedFilesAsDeletedAndAdded": false,
"path": "",
"quotepath": true,
"recoverDeletedFiles": false,
"recoverDeletedFilesToDestination": "",
"recoverFiles": "",
"recoverFilesIgnore": "",
"recoverFilesIgnoreSeparator": "",
"recoverFilesSeparator": "",
"safeOutput": false,
"separator": "",
"sha": "",
"since": "",
"sinceLastRemoteCommit": false,
"skipInitialFetch": false,
"token": "",
"until": "",
"useRestApi": false,
"writeOutputFiles": false,
}
`;
exports[`getInputs should return default values when no inputs are provided 1`] = `
{
"apiUrl": undefined,
"baseSha": undefined,
"diffRelative": true,
"dirNames": false,
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
"dirNamesExcludeCurrentDir": false,
"dirNamesIncludeFiles": undefined,
"dirNamesIncludeFilesSeparator": undefined,
"escapeJson": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
"files": undefined,
"filesFromSourceFile": undefined,
"filesFromSourceFileSeparator": undefined,
"filesIgnore": undefined,
"filesIgnoreFromSourceFile": undefined,
"filesIgnoreFromSourceFileSeparator": undefined,
"filesIgnoreSeparator": undefined,
"filesIgnoreYaml": undefined,
"filesIgnoreYamlFromSourceFile": undefined,
"filesIgnoreYamlFromSourceFileSeparator": undefined,
"filesSeparator": undefined,
"filesYaml": undefined,
"filesYamlFromSourceFile": undefined,
"filesYamlFromSourceFileSeparator": undefined,
"includeAllOldNewRenamedFiles": false,
"json": false,
"negationPatternsFirst": false,
"oldNewFilesSeparator": undefined,
"oldNewSeparator": undefined,
"outputDir": undefined,
"outputRenamedFilesAsDeletedAndAdded": false,
"path": undefined,
"quotepath": true,
"recoverDeletedFiles": false,
"recoverDeletedFilesToDestination": undefined,
"recoverFiles": undefined,
"recoverFilesIgnore": undefined,
"recoverFilesIgnoreSeparator": undefined,
"recoverFilesSeparator": undefined,
"safeOutput": false,
"separator": undefined,
"sha": undefined,
"since": undefined,
"sinceLastRemoteCommit": false,
"skipInitialFetch": false,
"token": undefined,
"until": undefined,
"useRestApi": false,
"writeOutputFiles": false,
}
`;

View File

@@ -0,0 +1,153 @@
import * as core from '@actions/core'
import {getInputs, Inputs} from '../inputs'
import {DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS} from '../constant'
jest.mock('@actions/core')
describe('getInputs', () => {
afterEach(() => {
jest.clearAllMocks()
})
test('should return default values when no inputs are provided', () => {
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
return (DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[camelCaseName] ||
'') as string
})
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
return (DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[camelCaseName] ||
false) as boolean
})
expect(getInputs()).toMatchSnapshot()
})
test('should correctly parse boolean inputs', () => {
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
return (DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[camelCaseName] ||
'') as string
})
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
switch (name) {
case 'matrix':
return 'true'
case 'skip_initial_fetch':
return 'true'
default:
return 'false'
}
})
expect(getInputs()).toMatchSnapshot()
})
test('should handle matrix alias correctly', () => {
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
return name === 'matrix' ? 'true' : 'false'
})
const inputs = getInputs()
expect(inputs).toHaveProperty('json', true)
expect(inputs).toHaveProperty('escapeJson', false)
})
test('should correctly parse string inputs', () => {
;(core.getInput as jest.Mock).mockImplementation(name => {
switch (name) {
case 'token':
return 'token'
case 'api_url':
return 'https://api.github.com'
default:
return ''
}
})
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
return (DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[camelCaseName] ||
false) as boolean
})
expect(getInputs()).toMatchSnapshot()
})
test('should correctly parse numeric inputs', () => {
;(core.getInput as jest.Mock).mockImplementation(name => {
switch (name) {
case 'fetch_depth':
return '5'
case 'dir_names_max_depth':
return '2'
default:
return ''
}
})
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
return (DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[camelCaseName] ||
false) as boolean
})
expect(getInputs()).toMatchSnapshot()
})
test('should handle invalid numeric inputs correctly', () => {
;(core.getInput as jest.Mock).mockImplementation(name => {
// TODO: Add validation for invalid numbers which should result in an error instead of NaN
switch (name) {
case 'fetch_depth':
return 'invalid'
case 'dir_names_max_depth':
return '2'
default:
return ''
}
})
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
return (DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[camelCaseName] ||
false) as boolean
})
expect(getInputs()).toMatchSnapshot()
})
test('should handle negative numeric inputs correctly', () => {
;(core.getInput as jest.Mock).mockImplementation(name => {
// TODO: Add validation for negative numbers which should result in an error
switch (name) {
case 'fetch_depth':
return '-5'
case 'dir_names_max_depth':
return '-2'
default:
return ''
}
})
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
return (DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[camelCaseName] ||
false) as boolean
})
expect(getInputs()).toMatchSnapshot()
})
})

View File

@@ -1,9 +1,12 @@
import * as core from '@actions/core'
import {ChangeTypeEnum} from '../changedFiles' import {ChangeTypeEnum} from '../changedFiles'
import {Inputs} from '../inputs'
import { import {
getDirname, getDirname,
getDirnameMaxDepth, getDirnameMaxDepth,
getFilteredChangedFiles, getFilteredChangedFiles,
normalizeSeparators normalizeSeparators,
warnUnsupportedRESTAPIInputs
} from '../utils' } from '../utils'
const originalPlatform = process.platform const originalPlatform = process.platform
@@ -575,4 +578,77 @@ describe('utils test', () => {
expect(filteredFiles[ChangeTypeEnum.Modified]).toEqual([]) expect(filteredFiles[ChangeTypeEnum.Modified]).toEqual([])
}) })
}) })
describe('warnUnsupportedRESTAPIInputs', () => {
// Warns about unsupported inputs when using the REST API.
it('should warn about unsupported inputs when all inputs are supported', async () => {
const inputs: Inputs = {
files: '',
filesSeparator: '\n',
filesFromSourceFile: '',
filesFromSourceFileSeparator: '\n',
filesYaml: '',
filesYamlFromSourceFile: '',
filesYamlFromSourceFileSeparator: '\n',
filesIgnore: '',
filesIgnoreSeparator: '\n',
filesIgnoreFromSourceFile: '',
filesIgnoreFromSourceFileSeparator: '\n',
filesIgnoreYaml: '',
filesIgnoreYamlFromSourceFile: '',
filesIgnoreYamlFromSourceFileSeparator: '\n',
separator: ' ',
includeAllOldNewRenamedFiles: false,
oldNewSeparator: ',',
oldNewFilesSeparator: ' ',
sha: '1313123',
baseSha: '',
since: '',
until: '',
path: '.',
quotepath: true,
diffRelative: true,
dirNames: false,
dirNamesMaxDepth: undefined,
dirNamesExcludeCurrentDir: false,
dirNamesIncludeFiles: '',
dirNamesIncludeFilesSeparator: '\n',
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false,
json: false,
escapeJson: true,
safeOutput: true,
fetchDepth: 50,
fetchAdditionalSubmoduleHistory: false,
sinceLastRemoteCommit: false,
writeOutputFiles: false,
outputDir: '.github/outputs',
outputRenamedFilesAsDeletedAndAdded: false,
recoverDeletedFiles: false,
recoverDeletedFilesToDestination: '',
recoverFiles: '',
recoverFilesSeparator: '\n',
recoverFilesIgnore: '',
recoverFilesIgnoreSeparator: '\n',
token: '${{ github.token }}',
apiUrl: '${{ github.api_url }}',
skipInitialFetch: false,
failOnInitialDiffError: false,
failOnSubmoduleDiffError: false,
negationPatternsFirst: false,
useRestApi: false
}
const coreWarningSpy = jest.spyOn(core, 'warning')
await warnUnsupportedRESTAPIInputs({
inputs
})
expect(coreWarningSpy).toHaveBeenCalledWith(
'Input "sha" is not supported when using GitHub\'s REST API to get changed files'
)
expect(coreWarningSpy).toHaveBeenCalledTimes(1)
})
})
}) })

View File

@@ -166,7 +166,7 @@ export const getRenamedFiles = async ({
})) }))
) { ) {
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` 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) { if (inputs.fetchAdditionalSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input` message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`
} }
core.info(message) core.info(message)
@@ -221,7 +221,7 @@ export const getAllDiffFiles = async ({
diffResult, diffResult,
submodulePaths, submodulePaths,
outputRenamedFilesAsDeletedAndAdded, outputRenamedFilesAsDeletedAndAdded,
fetchSubmoduleHistory, fetchAdditionalSubmoduleHistory,
failOnInitialDiffError, failOnInitialDiffError,
failOnSubmoduleDiffError failOnSubmoduleDiffError
}: { }: {
@@ -230,7 +230,7 @@ export const getAllDiffFiles = async ({
diffResult: DiffResult diffResult: DiffResult
submodulePaths: string[] submodulePaths: string[]
outputRenamedFilesAsDeletedAndAdded: boolean outputRenamedFilesAsDeletedAndAdded: boolean
fetchSubmoduleHistory: boolean fetchAdditionalSubmoduleHistory: boolean
failOnInitialDiffError: boolean failOnInitialDiffError: boolean
failOnSubmoduleDiffError: boolean failOnSubmoduleDiffError: boolean
}): Promise<ChangedFiles> => { }): Promise<ChangedFiles> => {
@@ -270,7 +270,7 @@ export const getAllDiffFiles = async ({
})) }))
) { ) {
let message = `Set 'fetch_additional_submodule_history: true' to fetch additional submodule history for: ${submodulePath}` let message = `Set 'fetch_additional_submodule_history: true' to fetch additional submodule history for: ${submodulePath}`
if (fetchSubmoduleHistory) { if (fetchAdditionalSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input` message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`
} }
core.warning(message) core.warning(message)

View File

@@ -247,7 +247,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
await setOutput({ await setOutput({
key: getOutputKey('any_changed', outputPrefix), key: getOutputKey('any_changed', outputPrefix),
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0, value: allChangedFiles.paths.length > 0,
writeOutputFiles: inputs.writeOutputFiles, writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir, outputDir: inputs.outputDir,
json: inputs.json json: inputs.json
@@ -336,7 +336,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
await setOutput({ await setOutput({
key: getOutputKey('any_modified', outputPrefix), key: getOutputKey('any_modified', outputPrefix),
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0, value: allModifiedFiles.paths.length > 0,
writeOutputFiles: inputs.writeOutputFiles, writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir, outputDir: inputs.outputDir,
json: inputs.json json: inputs.json
@@ -442,7 +442,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
await setOutput({ await setOutput({
key: getOutputKey('any_deleted', outputPrefix), key: getOutputKey('any_deleted', outputPrefix),
value: deletedFiles.paths.length > 0 && filePatterns.length > 0, value: deletedFiles.paths.length > 0,
writeOutputFiles: inputs.writeOutputFiles, writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir, outputDir: inputs.outputDir,
json: inputs.json json: inputs.json
@@ -496,7 +496,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
}) })
return { return {
anyModified: allModifiedFiles.paths.length > 0 && filePatterns.length > 0, anyModified: allModifiedFiles.paths.length > 0,
anyChanged: allChangedFiles.paths.length > 0 && filePatterns.length > 0 anyChanged: allChangedFiles.paths.length > 0
} }
} }

View File

@@ -152,7 +152,7 @@ export const getSHAForNonPullRequestEvent = async (
}) })
} }
} else { } else {
if (hasSubmodule && inputs.fetchSubmoduleHistory) { if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
await gitFetchSubmodules({ await gitFetchSubmodules({
cwd: workingDirectory, cwd: workingDirectory,
args: [ args: [
@@ -382,7 +382,7 @@ export const getSHAForPullRequestEvent = async (
} }
} }
} else { } else {
if (hasSubmodule && inputs.fetchSubmoduleHistory) { if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
await gitFetchSubmodules({ await gitFetchSubmodules({
cwd: workingDirectory, cwd: workingDirectory,
args: [ args: [
@@ -429,7 +429,7 @@ export const getSHAForPullRequestEvent = async (
if ( if (
!github.context.payload.pull_request?.base?.ref || !github.context.payload.pull_request?.base?.ref ||
github.context.payload.head?.repo?.fork === 'true' github.context.payload.pull_request?.head?.repo?.fork === true
) { ) {
diff = '..' diff = '..'
} }

24
src/constant.ts Normal file
View File

@@ -0,0 +1,24 @@
import {Inputs} from './inputs'
export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
sha: '',
baseSha: '',
since: '',
until: '',
path: '.',
quotepath: true,
diffRelative: true,
sinceLastRemoteCommit: false,
recoverDeletedFiles: false,
recoverDeletedFilesToDestination: '',
recoverFiles: '',
recoverFilesSeparator: '\n',
recoverFilesIgnore: '',
recoverFilesIgnoreSeparator: '\n',
includeAllOldNewRenamedFiles: false,
oldNewSeparator: ',',
oldNewFilesSeparator: ' ',
skipInitialFetch: false,
fetchAdditionalSubmoduleHistory: false,
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false
}

View File

@@ -5,8 +5,9 @@ export type Env = {
GITHUB_REF: string GITHUB_REF: string
GITHUB_WORKSPACE: string GITHUB_WORKSPACE: string
} }
export const getEnv = async (): Promise<Env> => { export const getEnv = async (): Promise<Env> => {
core.debug(`Process Env: ${JSON.stringify(process.env, null, 2)}`) core.debug(`Env: ${JSON.stringify(process.env, null, 2)}`)
return { return {
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '', GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',

View File

@@ -24,7 +24,7 @@ export type Inputs = {
since: string since: string
until: string until: string
path: string path: string
quotePath: boolean quotepath: boolean
diffRelative: boolean diffRelative: boolean
dirNames: boolean dirNames: boolean
dirNamesMaxDepth?: number dirNamesMaxDepth?: number
@@ -36,7 +36,7 @@ export type Inputs = {
escapeJson: boolean escapeJson: boolean
safeOutput: boolean safeOutput: boolean
fetchDepth?: number fetchDepth?: number
fetchSubmoduleHistory: boolean fetchAdditionalSubmoduleHistory: boolean
sinceLastRemoteCommit: boolean sinceLastRemoteCommit: boolean
writeOutputFiles: boolean writeOutputFiles: boolean
outputDir: string outputDir: string
@@ -53,6 +53,7 @@ export type Inputs = {
failOnInitialDiffError: boolean failOnInitialDiffError: boolean
failOnSubmoduleDiffError: boolean failOnSubmoduleDiffError: boolean
negationPatternsFirst: boolean negationPatternsFirst: boolean
useRestApi: boolean
} }
export const getInputs = (): Inputs => { export const getInputs = (): Inputs => {
@@ -131,7 +132,7 @@ export const getInputs = (): Inputs => {
const since = core.getInput('since', {required: false}) const since = core.getInput('since', {required: false})
const until = core.getInput('until', {required: false}) const until = core.getInput('until', {required: false})
const path = core.getInput('path', {required: false}) const path = core.getInput('path', {required: false})
const quotePath = core.getBooleanInput('quotepath', {required: false}) const quotepath = core.getBooleanInput('quotepath', {required: false})
const diffRelative = core.getBooleanInput('diff_relative', {required: false}) const diffRelative = core.getBooleanInput('diff_relative', {required: false})
const dirNames = core.getBooleanInput('dir_names', {required: false}) const dirNames = core.getBooleanInput('dir_names', {required: false})
const dirNamesMaxDepth = core.getInput('dir_names_max_depth', { const dirNamesMaxDepth = core.getInput('dir_names_max_depth', {
@@ -153,8 +154,15 @@ export const getInputs = (): Inputs => {
trimWhitespace: false trimWhitespace: false
} }
) )
const json = core.getBooleanInput('json', {required: false}) let json = core.getBooleanInput('json', {required: false})
const escapeJson = core.getBooleanInput('escape_json', {required: false}) let escapeJson = core.getBooleanInput('escape_json', {required: false})
const matrix = core.getBooleanInput('matrix', {required: false})
if (matrix) {
json = true
escapeJson = false
}
const safeOutput = core.getBooleanInput('safe_output', {required: false}) const safeOutput = core.getBooleanInput('safe_output', {required: false})
const fetchDepth = core.getInput('fetch_depth', {required: false}) const fetchDepth = core.getInput('fetch_depth', {required: false})
const sinceLastRemoteCommit = core.getBooleanInput( const sinceLastRemoteCommit = core.getBooleanInput(
@@ -196,7 +204,7 @@ export const getInputs = (): Inputs => {
const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', { const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', {
required: false required: false
}) })
const fetchSubmoduleHistory = core.getBooleanInput( const fetchAdditionalSubmoduleHistory = core.getBooleanInput(
'fetch_additional_submodule_history', 'fetch_additional_submodule_history',
{ {
required: false required: false
@@ -228,6 +236,10 @@ export const getInputs = (): Inputs => {
} }
) )
const useRestApi = core.getBooleanInput('use_rest_api', {
required: false
})
const inputs: Inputs = { const inputs: Inputs = {
files, files,
filesSeparator, filesSeparator,
@@ -252,7 +264,7 @@ export const getInputs = (): Inputs => {
since, since,
until, until,
path, path,
quotePath, quotepath,
diffRelative, diffRelative,
sinceLastRemoteCommit, sinceLastRemoteCommit,
recoverDeletedFiles, recoverDeletedFiles,
@@ -265,7 +277,7 @@ export const getInputs = (): Inputs => {
oldNewSeparator, oldNewSeparator,
oldNewFilesSeparator, oldNewFilesSeparator,
skipInitialFetch, skipInitialFetch,
fetchSubmoduleHistory, fetchAdditionalSubmoduleHistory,
dirNamesDeletedFilesIncludeOnlyDeletedDirs, dirNamesDeletedFilesIncludeOnlyDeletedDirs,
// End Not Supported via REST API // End Not Supported via REST API
dirNames, dirNames,
@@ -280,7 +292,8 @@ export const getInputs = (): Inputs => {
outputRenamedFilesAsDeletedAndAdded, outputRenamedFilesAsDeletedAndAdded,
token, token,
apiUrl, apiUrl,
negationPatternsFirst negationPatternsFirst,
useRestApi
} }
if (fetchDepth) { if (fetchDepth) {

View File

@@ -26,7 +26,8 @@ import {
setOutput, setOutput,
submoduleExists, submoduleExists,
updateGitGlobalConfig, updateGitGlobalConfig,
verifyMinimumGitVersion verifyMinimumGitVersion,
warnUnsupportedRESTAPIInputs
} from './utils' } from './utils'
const getChangedFilesFromLocalGitHistory = async ({ const getChangedFilesFromLocalGitHistory = async ({
@@ -44,15 +45,15 @@ const getChangedFilesFromLocalGitHistory = async ({
}): Promise<void> => { }): Promise<void> => {
await verifyMinimumGitVersion() await verifyMinimumGitVersion()
let quotePathValue = 'on' let quotepathValue = 'on'
if (!inputs.quotePath) { if (!inputs.quotepath) {
quotePathValue = 'off' quotepathValue = 'off'
} }
await updateGitGlobalConfig({ await updateGitGlobalConfig({
name: 'core.quotepath', name: 'core.quotepath',
value: quotePathValue value: quotepathValue
}) })
if (inputs.diffRelative) { if (inputs.diffRelative) {
@@ -123,7 +124,7 @@ const getChangedFilesFromLocalGitHistory = async ({
diffResult, diffResult,
submodulePaths, submodulePaths,
outputRenamedFilesAsDeletedAndAdded, outputRenamedFilesAsDeletedAndAdded,
fetchSubmoduleHistory: inputs.fetchSubmoduleHistory, fetchAdditionalSubmoduleHistory: inputs.fetchAdditionalSubmoduleHistory,
failOnInitialDiffError: inputs.failOnInitialDiffError, failOnInitialDiffError: inputs.failOnInitialDiffError,
failOnSubmoduleDiffError: inputs.failOnSubmoduleDiffError failOnSubmoduleDiffError: inputs.failOnSubmoduleDiffError
}) })
@@ -224,7 +225,7 @@ export async function run(): Promise<void> {
const workingDirectory = path.resolve( const workingDirectory = path.resolve(
env.GITHUB_WORKSPACE || process.cwd(), env.GITHUB_WORKSPACE || process.cwd(),
inputs.path inputs.useRestApi ? '.' : inputs.path
) )
core.debug(`Working directory: ${workingDirectory}`) core.debug(`Working directory: ${workingDirectory}`)
@@ -243,35 +244,19 @@ export async function run(): Promise<void> {
}) })
core.debug(`Yaml file patterns: ${JSON.stringify(yamlFilePatterns)}`) core.debug(`Yaml file patterns: ${JSON.stringify(yamlFilePatterns)}`)
if (inputs.useRestApi && !github.context.payload.pull_request?.number) {
throw new Error(
"Only pull_request* events are supported when using GitHub's REST API."
)
}
if ( if (
inputs.token && inputs.token &&
github.context.payload.pull_request?.number && github.context.payload.pull_request?.number &&
!hasGitDirectory (!hasGitDirectory || inputs.useRestApi)
) { ) {
core.info("Using GitHub's REST API to get changed files") core.info("Using GitHub's REST API to get changed files")
const unsupportedInputs: (keyof Inputs)[] = [ await warnUnsupportedRESTAPIInputs({inputs})
'sha',
'baseSha',
'since',
'until',
'sinceLastRemoteCommit',
'recoverDeletedFiles',
'recoverDeletedFilesToDestination',
'recoverFiles',
'recoverFilesIgnore',
'includeAllOldNewRenamedFiles',
'skipInitialFetch',
'fetchSubmoduleHistory',
'dirNamesDeletedFilesIncludeOnlyDeletedDirs'
]
for (const input of unsupportedInputs) {
if (inputs[input]) {
core.warning(
`Input "${input}" is not supported when using GitHub's REST API to get changed files`
)
}
}
await getChangedFilesFromRESTAPI({ await getChangedFilesFromRESTAPI({
inputs, inputs,
filePatterns, filePatterns,
@@ -279,10 +264,9 @@ export async function run(): Promise<void> {
}) })
} else { } else {
if (!hasGitDirectory) { if (!hasGitDirectory) {
core.setFailed( throw new Error(
"Can't find local .git directory. Please run actions/checkout before this action" `Unable to locate the git repository in the given path: ${workingDirectory}.\n Please run actions/checkout before this action (Make sure the 'path' input is correct).\n If you intend to use Github's REST API note that only pull_request* events are supported. Current event is "${github.context.eventName}".`
) )
return
} }
core.info('Using local .git directory') core.info('Using local .git directory')
@@ -301,5 +285,6 @@ if (!process.env.TESTING) {
// eslint-disable-next-line github/no-then // eslint-disable-next-line github/no-then
run().catch(e => { run().catch(e => {
core.setFailed(e.message || e) core.setFailed(e.message || e)
process.exit(1)
}) })
} }

View File

@@ -3,14 +3,14 @@ import * as core from '@actions/core'
import * as exec from '@actions/exec' import * as exec from '@actions/exec'
import * as github from '@actions/github' import * as github from '@actions/github'
import {createReadStream, promises as fs} from 'fs' import {createReadStream, promises as fs} from 'fs'
import {readFile} from 'fs/promises' import {flattenDeep, snakeCase} from 'lodash'
import {flattenDeep} from 'lodash'
import mm from 'micromatch' import mm from 'micromatch'
import * as path from 'path' import * as path from 'path'
import {createInterface} from 'readline' import {createInterface} from 'readline'
import {parseDocument} from 'yaml' import {parseDocument} from 'yaml'
import {ChangedFiles, ChangeTypeEnum} from './changedFiles' import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
import {DiffResult} from './commitSha' import {DiffResult} from './commitSha'
import {DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS} from './constant'
import {Inputs} from './inputs' import {Inputs} from './inputs'
const MINIMUM_GIT_VERSION = '2.18.0' const MINIMUM_GIT_VERSION = '2.18.0'
@@ -171,15 +171,16 @@ async function* lineOfFileGenerator({
input: fileStream, input: fileStream,
crlfDelay: Infinity crlfDelay: Infinity
}) })
for await (const line of rl) { for await (let line of rl) {
if (!line.startsWith('#') && line !== '') { if (!line.startsWith('#') && line !== '') {
if (excludedFiles) { if (excludedFiles) {
if (line.startsWith('!')) { line = line.startsWith('!') ? line : `!${line}`
yield line if (line.endsWith(path.sep)) {
} else { line = `${line}**`
yield `!${line}`
} }
yield line
} else { } else {
line = line.endsWith(path.sep) ? `${line}**` : line
yield line yield line
} }
} }
@@ -285,6 +286,7 @@ export const submoduleExists = async ({
* Fetches the git repository * Fetches the git repository
* @param args - arguments for fetch command * @param args - arguments for fetch command
* @param cwd - working directory * @param cwd - working directory
* @returns exit code
*/ */
export const gitFetch = async ({ export const gitFetch = async ({
args, args,
@@ -333,6 +335,7 @@ export const gitFetchSubmodules = async ({
/** /**
* Retrieves all the submodule paths * Retrieves all the submodule paths
* @param cwd - working directory * @param cwd - working directory
* @returns submodule paths
*/ */
export const getSubmodulePath = async ({ export const getSubmodulePath = async ({
cwd cwd
@@ -367,6 +370,7 @@ export const getSubmodulePath = async ({
* @param parentSha2 - parent commit sha * @param parentSha2 - parent commit sha
* @param submodulePath - path of submodule * @param submodulePath - path of submodule
* @param diff - diff type between parent commits (`..` or `...`) * @param diff - diff type between parent commits (`..` or `...`)
* @returns commit sha of submodule
*/ */
export const gitSubmoduleDiffSHA = async ({ export const gitSubmoduleDiffSHA = async ({
cwd, cwd,
@@ -676,6 +680,12 @@ export const isInsideWorkTree = async ({
} }
) )
if (stdout.trim() !== 'true') {
core.warning(
`The current working directory is not inside a git repository: ${cwd}`
)
}
return stdout.trim() === 'true' return stdout.trim() === 'true'
} }
@@ -898,7 +908,7 @@ export const canDiffCommits = async ({
} else { } else {
const {exitCode, stderr} = await exec.getExecOutput( const {exitCode, stderr} = await exec.getExecOutput(
'git', 'git',
['diff', '--quiet', sha1, sha2], ['diff', '--no-patch', sha1, sha2],
{ {
cwd, cwd,
ignoreReturnCode: true, ignoreReturnCode: true,
@@ -995,6 +1005,7 @@ export const getFilePatterns = async ({
if (inputs.files) { if (inputs.files) {
const filesPatterns = inputs.files const filesPatterns = inputs.files
.split(inputs.filesSeparator) .split(inputs.filesSeparator)
.map(p => (p.endsWith(path.sep) ? `${p}**` : p))
.filter(Boolean) .filter(Boolean)
cleanedFilePatterns.push(...filesPatterns) cleanedFilePatterns.push(...filesPatterns)
@@ -1026,8 +1037,9 @@ export const getFilePatterns = async ({
.split(inputs.filesIgnoreSeparator) .split(inputs.filesIgnoreSeparator)
.filter(Boolean) .filter(Boolean)
.map(p => { .map(p => {
if (!p.startsWith('!')) { p = p.startsWith('!') ? p : `!${p}`
p = `!${p}` if (p.endsWith(path.sep)) {
p = `${p}**`
} }
return p return p
}) })
@@ -1128,7 +1140,7 @@ const getYamlFilePatternsFromContents = async ({
throw new Error(`File does not exist: ${filePath}`) throw new Error(`File does not exist: ${filePath}`)
} }
source = await readFile(filePath, 'utf8') source = await fs.readFile(filePath, 'utf8')
} else { } else {
source = content source = content
} }
@@ -1491,6 +1503,12 @@ export const recoverDeletedFiles = async ({
} }
} }
/**
* Determines whether the specified working directory has a local Git directory.
*
* @param workingDirectory - The path of the working directory.
* @returns A boolean value indicating whether the working directory has a local Git directory.
*/
export const hasLocalGitDirectory = async ({ export const hasLocalGitDirectory = async ({
workingDirectory workingDirectory
}: { }: {
@@ -1500,3 +1518,33 @@ export const hasLocalGitDirectory = async ({
cwd: workingDirectory cwd: workingDirectory
}) })
} }
/**
* Warns about unsupported inputs when using the REST API.
*
* @param inputs - The inputs object.
*/
export const warnUnsupportedRESTAPIInputs = async ({
inputs
}: {
inputs: Inputs
}): Promise<void> => {
for (const key of Object.keys(DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS)) {
const defaultValue = Object.hasOwnProperty.call(
DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS,
key
)
? DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[
key as keyof Inputs
]?.toString()
: ''
if (defaultValue !== inputs[key as keyof Inputs]?.toString()) {
core.warning(
`Input "${snakeCase(
key
)}" is not supported when using GitHub's REST API to get changed files`
)
}
}
}

1271
yarn.lock

File diff suppressed because it is too large Load Diff