Compare commits

...

175 Commits

Author SHA1 Message Date
renovate[bot]
635f118699 chore(deps): update dependency @types/node to v20.12.7 2024-04-09 22:45:21 +00:00
renovate[bot]
634b61511e chore(deps): update dependency @types/node to v20.12.6 2024-04-09 07:28:13 +00:00
renovate[bot]
77fcf43160 chore(deps): update typescript-eslint monorepo to v7.6.0 2024-04-08 19:14:43 +00:00
GitHub Action
5f084a52a4 Added missing changes and modified dist assets. 2024-04-08 14:42:53 +00:00
renovate[bot]
ff2cb1b4f2 chore(deps): lock file maintenance 2024-04-08 14:42:53 +00:00
renovate[bot]
5d5da31340 chore(deps): update dependency eslint-plugin-jest to v28.2.0 2024-04-07 02:26:15 +00:00
renovate[bot]
29bc0d3fd9 chore(deps): update dependency eslint-plugin-jest to v28.1.1 2024-04-06 23:12:23 +00:00
renovate[bot]
c9f9d5784e chore(deps): update dependency eslint-plugin-jest to v28 (#2030)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-06 10:04:57 +00:00
renovate[bot]
a4fba0109c chore(deps): update dependency @types/node to v20.12.5 2024-04-05 23:24:24 +00:00
dependabot[bot]
8a6546164a chore(deps): bump undici from 5.28.3 to 5.28.4 (#2026)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2024-04-04 18:55:07 +00:00
renovate[bot]
bad2eb6859 chore(deps): update dependency typescript to v5.4.4 2024-04-04 18:45:28 +00:00
renovate[bot]
b2dbd4264a chore(deps): update dependency @types/node to v20.12.4 2024-04-04 00:49:09 +00:00
renovate[bot]
57d40e662d fix(deps): update dependency @octokit/rest to v20.1.0 2024-04-03 20:00:38 +00:00
renovate[bot]
185549c022 chore(deps): update dependency @types/node to v20.12.3 2024-04-02 22:09:40 +00:00
renovate[bot]
f853fd0592 chore(deps): update typescript-eslint monorepo to v7.5.0 2024-04-02 00:11:13 +00:00
renovate[bot]
cd3c6e6bbd chore(deps): lock file maintenance 2024-04-01 00:51:33 +00:00
renovate[bot]
e5ce44a301 chore(deps): update dependency @types/node to v20.12.2 2024-03-30 07:12:07 +00:00
renovate[bot]
ccdcd17ffd chore(deps): update tj-actions/eslint-changed-files action to v24 (#2019)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-29 14:37:20 +00:00
tj-actions[bot]
e4b8dafc5d Upgraded to v44 (#2017)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-26 20:33:57 -06:00
tj-actions[bot]
2d756ea4c5 Updated README.md (#2016)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-26 19:52:24 -06:00
tonyejack1
ce497c39e9 chore: update description of outputs removing asterisks (#2015) 2024-03-26 19:50:35 -06:00
Tonye Jack
2d21bbb405 Update README.md 2024-03-26 19:32:02 -06:00
Tonye Jack
90941b398f remove: unused code (#2014) 2024-03-26 22:49:39 +00:00
tj-actions[bot]
2ca8dc42f6 Updated README.md (#2013)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-26 16:16:41 -06:00
tonyejack1
ee096d679e chore: update description of other_deleted_files output (#2008)
Co-authored-by: Tonye Jack <jtonye@ymail.com>
2024-03-26 16:15:39 -06:00
tonyejack1
4621617d4b Update README.md 2024-03-26 13:31:35 -06:00
Tonye Jack
4bbd49b998 fix: ensure the fork remote doesn't exists before creating it (#2012)
Co-authored-by: GitHub Action <action@github.com>
2024-03-26 19:12:21 +00:00
Tonye Jack
c6557ed000 Update README.md 2024-03-26 12:50:59 -06:00
Tonye Jack
f0e7702ccc fix: update previos sha for forks (#2011)
Co-authored-by: GitHub Action <action@github.com>
2024-03-26 18:46:29 +00:00
Tonye Jack
6354e6c542 fix: update to add the fork remote (#2010) 2024-03-26 18:28:16 +00:00
Tonye Jack
117616472f fix: check for setting remote urls for forks (#2009) 2024-03-26 12:10:44 -06:00
Tonye Jack
4ff79362e5 fix: bug with prs from forks returning incorrect set of changed files (#2007)
Co-authored-by: GitHub Action <action@github.com>
2024-03-26 11:47:25 -06:00
Tonye Jack
0713a11242 Update README.md 2024-03-26 11:42:41 -06:00
renovate[bot]
064742427d chore(deps): update typescript-eslint monorepo to v7.4.0 2024-03-25 19:10:31 +00:00
renovate[bot]
efe5e6c7a4 chore(deps): lock file maintenance 2024-03-25 01:33:42 +00:00
tj-actions[bot]
01e9662a12 Upgraded to v43.0.1 (#2004)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-21 00:42:37 +00:00
renovate[bot]
20576b4b9e chore(deps): update dependency typescript to v5.4.3 2024-03-20 21:58:07 +00:00
Tonye Jack
077b23f6a6 fix: remove warning with detecting the local git repository when using Github's REST API (#2002)
Co-authored-by: GitHub Action <action@github.com>
2024-03-20 19:20:51 +00:00
Tonye Jack
02768050b1 chore: update inputs.ts adding comment about fetch_depth (#2000) 2024-03-20 14:29:59 +00:00
renovate[bot]
427adf47f0 chore(deps): update dependency @types/node to v20.11.30 2024-03-19 13:28:54 +00:00
dependabot[bot]
5c6aa49478 Bump @typescript-eslint/eslint-plugin from 7.3.0 to 7.3.1 (#1995)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-03-18 22:27:06 -06:00
renovate[bot]
aa0b62a2d0 chore(deps): update dependency @typescript-eslint/eslint-plugin to v7.3.1 2024-03-19 02:09:15 +00:00
dependabot[bot]
0320702dd5 Bump @typescript-eslint/parser from 7.3.0 to 7.3.1 (#1996)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 01:47:18 +00:00
renovate[bot]
38903688b4 chore(deps): update dependency @types/node to v20.11.29 2024-03-18 21:43:53 +00:00
renovate[bot]
98a74d2cd6 chore(deps): update typescript-eslint monorepo to v7.3.0 2024-03-18 17:46:43 +00:00
renovate[bot]
068000d9c6 chore(deps): lock file maintenance 2024-03-18 02:16:34 +00:00
renovate[bot]
490ac3999e chore(deps): update dependency @types/node to v20.11.28 2024-03-15 10:23:14 +00:00
Tonye Jack
2859a60726 Update README.md 2024-03-13 21:43:22 -06:00
tj-actions[bot]
d03038e4e4 Upgraded to v43 (#1990)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-13 17:06:28 -06:00
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
27 changed files with 2843 additions and 1324 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

@@ -24,11 +24,6 @@ permissions:
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:
@@ -39,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

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,4 @@
name: Issue Comment Test name: Issue Comment Job Example
permissions: permissions:
contents: read contents: read

View File

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

View File

@@ -1,4 +1,4 @@
name: Matrix Test name: Matrix Example
permissions: permissions:
contents: read contents: read
@@ -24,8 +24,7 @@ jobs:
id: changed-files id: changed-files
uses: ./ uses: ./
with: with:
json: true matrix: true
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 }}'

View File

@@ -1,4 +1,4 @@
name: Multi Job Test name: Multi Job Example
permissions: permissions:
contents: read contents: read

View File

@@ -37,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

@@ -2,7 +2,6 @@ name: CI
permissions: permissions:
contents: read contents: read
pull-requests: write
on: on:
push: push:
@@ -35,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:
@@ -43,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'
@@ -58,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@v22 uses: tj-actions/eslint-changed-files@v24
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
with: with:
token: ${{ secrets.PAT_TOKEN }} token: ${{ secrets.PAT_TOKEN }}
@@ -70,7 +72,7 @@ jobs:
yarn all yarn all
- name: Verify Changed files - name: Verify Changed files
uses: tj-actions/verify-changed-files@v17 uses: tj-actions/verify-changed-files@v19
id: changed_files id: changed_files
with: with:
files: | files: |
@@ -94,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
@@ -111,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
@@ -121,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
@@ -147,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
@@ -185,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
@@ -194,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
@@ -243,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
@@ -252,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
@@ -285,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
@@ -294,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
@@ -315,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
@@ -331,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
@@ -354,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
@@ -362,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
@@ -381,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
@@ -396,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
@@ -415,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
@@ -469,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
@@ -535,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
@@ -550,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
@@ -570,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
@@ -598,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
@@ -613,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
@@ -673,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
@@ -688,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
@@ -863,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
@@ -896,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
@@ -937,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
@@ -953,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
@@ -987,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
@@ -1002,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
@@ -1017,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

@@ -27,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@v17 uses: tj-actions/verify-changed-files@v19
id: verify_changed_files id: verify_changed_files
with: with:
files: | files: |
@@ -41,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 }}"

View File

@@ -1,20 +0,0 @@
name: Workflow Run Example
on:
workflow_run:
workflows: [Matrix Test]
types: [completed]
permissions:
contents: read
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo 'The triggering workflow passed'
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'

File diff suppressed because it is too large Load Diff

181
README.md
View File

@@ -1,7 +1,7 @@
[![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/4fe2f49c3ab144b0bbe4effc85a061a0)](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)
@@ -9,17 +9,17 @@
<!-- 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
@@ -116,13 +116,13 @@ jobs:
name: Test changed-files name: Test changed-files
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
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@v44
# 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 +131,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@v44
with: with:
# Avoid using single or double quotes for multiline patterns # Avoid using single or double quotes for multiline patterns
files: | files: |
@@ -149,14 +151,16 @@ 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@v44
with: with:
files_yaml: | files_yaml: |
doc: doc:
@@ -186,10 +190,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@v44
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
@@ -221,7 +227,7 @@ jobs:
# NOTE: # NOTE:
# - This is limited to pull_request* events and would raise an error for other events. # - This is limited to pull_request* events and would raise an error for other events.
# - A maximum of 3000 files can be returned. # - A maximum of 3000 files can be returned.
# - For more flexibility and no limitations see "Using local .git history" above. # - For more flexibility and no limitations see "Using local .git directory" above.
runs-on: ubuntu-latest # windows-latest || macos-latest runs-on: ubuntu-latest # windows-latest || macos-latest
name: Test changed-files name: Test changed-files
@@ -231,13 +237,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@v44
- 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
``` ```
@@ -274,14 +280,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@v44
# 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
... ...
@@ -292,6 +298,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
@@ -312,14 +319,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 choices.
## 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@v44
id: changed-files id: changed-files
with: with:
# Github API URL. # Github API URL.
@@ -478,11 +486,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
@@ -583,10 +598,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: ''
@@ -647,33 +662,33 @@ Support this project with a :star:
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <a name="output_added_files"></a>[added\_files](#output_added_files) | string | Returns only files that are <br>Added (A). | | <a name="output_added_files"></a>[added\_files](#output_added_files) | string | Returns only files that are <br>Added (A). |
| <a name="output_added_files_count"></a>[added\_files\_count](#output_added_files_count) | string | Returns the number of `added_files` | | <a name="output_added_files_count"></a>[added\_files\_count](#output_added_files_count) | string | Returns the number of `added_files` |
| <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* | | <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. a combination of <br>(ACMRDTUX) |
| <a name="output_all_changed_and_modified_files_count"></a>[all\_changed\_and\_modified\_files\_count](#output_all_changed_and_modified_files_count) | string | Returns the number of `all_changed_and_modified_files` | | <a name="output_all_changed_and_modified_files_count"></a>[all\_changed\_and\_modified\_files\_count](#output_all_changed_and_modified_files_count) | string | Returns the number of `all_changed_and_modified_files` |
| <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* | | <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>a combination of all added, <br>copied, modified and renamed files <br>(ACMR) |
| <a name="output_all_changed_files_count"></a>[all\_changed\_files\_count](#output_all_changed_files_count) | string | Returns the number of `all_changed_files` | | <a name="output_all_changed_files_count"></a>[all\_changed\_files\_count](#output_all_changed_files_count) | string | Returns the number of `all_changed_files` |
| <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. | | <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>a combination of all added, <br>copied, modified, renamed and deleted <br>files (ACMRD). |
| <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` | | <a name="output_all_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 <br>any path that has either <br>been added, copied, modified, and <br>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` |
| <a name="output_deleted_files"></a>[deleted\_files](#output_deleted_files) | string | Returns only files that are <br>Deleted (D). | | <a name="output_deleted_files"></a>[deleted\_files](#output_deleted_files) | string | Returns only files that are <br>Deleted (D). |
| <a name="output_deleted_files_count"></a>[deleted\_files\_count](#output_deleted_files_count) | string | Returns the number of `deleted_files` | | <a name="output_deleted_files_count"></a>[deleted\_files\_count](#output_deleted_files_count) | string | Returns the number of `deleted_files` |
| <a name="output_modified_files"></a>[modified\_files](#output_modified_files) | string | Returns only files that are <br>Modified (M). | | <a name="output_modified_files"></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 <br>any path that has either <br>been added, copied, modified, and <br>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 <br>of all added, copied, modified <br>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 <br>all deleted files (D) |
| <a name="output_other_deleted_files_count"></a>[other\_deleted\_files\_count](#output_other_deleted_files_count) | string | Returns the number of `other_deleted_files` | | <a name="output_other_deleted_files_count"></a>[other\_deleted\_files\_count](#output_other_deleted_files_count) | string | Returns the number of `other_deleted_files` |
| <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* | | <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. a combination of <br>all added, copied, modified, and <br>deleted files (ACMRD) |
| <a name="output_other_modified_files_count"></a>[other\_modified\_files\_count](#output_other_modified_files_count) | string | Returns the number of `other_modified_files` | | <a name="output_other_modified_files_count"></a>[other\_modified\_files\_count](#output_other_modified_files_count) | string | Returns the number of `other_modified_files` |
| <a name="output_renamed_files"></a>[renamed\_files](#output_renamed_files) | string | Returns only files that are <br>Renamed (R). | | <a name="output_renamed_files"></a>[renamed\_files](#output_renamed_files) | string | Returns only files that are <br>Renamed (R). |
| <a name="output_renamed_files_count"></a>[renamed\_files\_count](#output_renamed_files_count) | string | Returns the number of `renamed_files` | | <a name="output_renamed_files_count"></a>[renamed\_files\_count](#output_renamed_files_count) | string | Returns the number of `renamed_files` |
@@ -707,7 +722,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@v44
... ...
``` ```
@@ -720,7 +735,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@v44
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.
@@ -728,7 +743,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
... ...
@@ -743,7 +758,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@v44
with: with:
separator: "," separator: ","
... ...
@@ -760,13 +775,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@v44
- 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
... ...
@@ -783,7 +798,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@v44
- 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')
@@ -804,7 +819,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@v44
with: with:
write_output_files: true write_output_files: true
@@ -823,7 +838,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@v44
with: with:
json: true json: true
write_output_files: true write_output_files: true
@@ -843,7 +858,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@v44
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -866,7 +881,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@v44
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -891,7 +906,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
@@ -900,7 +915,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
... ...
@@ -917,7 +932,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@v44
with: with:
files_from_source_file: test/changed-files-list.txt files_from_source_file: test/changed-files-list.txt
... ...
@@ -934,7 +949,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@v44
with: with:
files_from_source_file: | files_from_source_file: |
test/changed-files-list.txt test/changed-files-list.txt
@@ -955,7 +970,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@v44
with: with:
sha: ${{ github.event.pull_request.head.sha }} sha: ${{ github.event.pull_request.head.sha }}
... ...
@@ -972,7 +987,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@v44
with: with:
base_sha: ${{ github.event.pull_request.base.sha }} base_sha: ${{ github.event.pull_request.base.sha }}
... ...
@@ -1004,13 +1019,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@v44
- 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@v44
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
@@ -1040,16 +1060,15 @@ 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@v44
with: with:
path: dir1 path: dir1
- name: List all added files in dir1 - name: List all added files in dir1
env: env:
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
... ...
@@ -1066,13 +1085,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@v44
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@v44
with: with:
files: test/test-è.txt files: test/test-è.txt
quotepath: "false" quotepath: "false"
@@ -1105,7 +1124,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@v44
with: with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }} base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
... ...
@@ -1132,7 +1151,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@v44
with: with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }} base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
... ...
@@ -1158,7 +1177,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@v44
with: with:
dir_names: "true" dir_names: "true"
... ...
@@ -1175,7 +1194,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@v44
with: with:
json: "true" json: "true"
... ...
@@ -1192,13 +1211,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@v44
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@v44
with: with:
until: "2022-08-20" until: "2022-08-20"
... ...
@@ -1218,7 +1237,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)
@@ -1226,10 +1245,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/changed-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 📈
@@ -1283,7 +1306,7 @@ Report bugs at https://github.com/tj-actions/changed-files/issues.
If you are reporting a bug, please include: If you are reporting a bug, please include:
* Your operating system name and version. * Your operating system name and version.
* Any details about your workflow that might be helpful in troubleshooting. (**NOTE**: Ensure that you include full log outputs with debugging enabled) * All essential details about your workflow that might be helpful in troubleshooting. (**NOTE**: Ensure that you include full log outputs with debugging enabled)
* Detailed steps to reproduce the bug. * Detailed steps to reproduce the bug.
## Contributors ✨ ## Contributors ✨
@@ -1327,6 +1350,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:
@@ -219,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:
@@ -258,45 +262,45 @@ outputs:
unknown_files_count: unknown_files_count:
description: "Returns the number of `unknown_files`" description: "Returns the number of `unknown_files`"
all_changed_and_modified_files: all_changed_and_modified_files:
description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*" description: "Returns all changed and modified files i.e. a combination of (ACMRDTUX)"
all_changed_and_modified_files_count: all_changed_and_modified_files_count:
description: "Returns the number of `all_changed_and_modified_files`" description: "Returns the number of `all_changed_and_modified_files`"
all_changed_files: all_changed_files:
description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*" description: "Returns all changed files i.e. a combination of all added, copied, modified and renamed files (ACMR)"
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:
description: "Returns the number of `other_changed_files`" description: "Returns the number of `other_changed_files`"
all_modified_files: all_modified_files:
description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*." description: "Returns all changed files i.e. a combination of all added, copied, modified, renamed and deleted files (ACMRD)."
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:
description: "Returns the number of `other_deleted_files`" description: "Returns the number of `other_deleted_files`"
modified_keys: modified_keys:
description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)*" description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and deleted (ACMRD)"
changed_keys: changed_keys:
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)*" description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and renamed (ACMR)"
runs: runs:
using: 'node20' using: 'node20'

763
dist/index.js generated vendored

File diff suppressed because it is too large Load Diff

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "@tj-actions/changed-files", "name": "@tj-actions/changed-files",
"version": "41.1.2", "version": "44.0.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,12 +46,12 @@
"@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",
"eslint-plugin-jest": "^27.2.2", "eslint-plugin-jest": "^28.0.0",
"eslint-plugin-prettier": "^5.0.0-alpha.2", "eslint-plugin-prettier": "^5.0.0-alpha.2",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"jest": "^29.5.0", "jest": "^29.5.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

@@ -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

@@ -86,15 +86,27 @@ export interface DiffResult {
initialCommit?: boolean initialCommit?: boolean
} }
export const getSHAForNonPullRequestEvent = async ( interface SHAForNonPullRequestEvent {
inputs: Inputs, inputs: Inputs
env: Env, env: Env
workingDirectory: string, workingDirectory: string
isShallow: boolean, isShallow: boolean
hasSubmodule: boolean, hasSubmodule: boolean
gitFetchExtraArgs: string[], gitFetchExtraArgs: string[]
isTag: boolean isTag: boolean
): Promise<DiffResult> => { remoteName: string
}
export const getSHAForNonPullRequestEvent = async ({
inputs,
env,
workingDirectory,
isShallow,
hasSubmodule,
gitFetchExtraArgs,
isTag,
remoteName
}: SHAForNonPullRequestEvent): Promise<DiffResult> => {
let targetBranch = env.GITHUB_REF_NAME let targetBranch = env.GITHUB_REF_NAME
let currentBranch = targetBranch let currentBranch = targetBranch
let initialCommit = false let initialCommit = false
@@ -122,8 +134,8 @@ export const getSHAForNonPullRequestEvent = async (
'-u', '-u',
'--progress', '--progress',
`--deepen=${inputs.fetchDepth}`, `--deepen=${inputs.fetchDepth}`,
'origin', remoteName,
`+refs/heads/${sourceBranch}:refs/remotes/origin/${sourceBranch}` `+refs/heads/${sourceBranch}:refs/remotes/${remoteName}/${sourceBranch}`
] ]
}) })
} else { } else {
@@ -134,8 +146,8 @@ export const getSHAForNonPullRequestEvent = async (
'-u', '-u',
'--progress', '--progress',
`--deepen=${inputs.fetchDepth}`, `--deepen=${inputs.fetchDepth}`,
'origin', remoteName,
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}` `+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
] ]
}) })
} }
@@ -307,14 +319,23 @@ export const getSHAForNonPullRequestEvent = async (
} }
} }
export const getSHAForPullRequestEvent = async ( interface SHAForPullRequestEvent {
inputs: Inputs, inputs: Inputs
env: Env, workingDirectory: string
workingDirectory: string, isShallow: boolean
isShallow: boolean, hasSubmodule: boolean
hasSubmodule: boolean,
gitFetchExtraArgs: string[] gitFetchExtraArgs: string[]
): Promise<DiffResult> => { remoteName: string
}
export const getSHAForPullRequestEvent = async ({
inputs,
workingDirectory,
isShallow,
hasSubmodule,
gitFetchExtraArgs,
remoteName
}: SHAForPullRequestEvent): Promise<DiffResult> => {
let targetBranch = github.context.payload.pull_request?.base?.ref let targetBranch = github.context.payload.pull_request?.base?.ref
const currentBranch = github.context.payload.pull_request?.head?.ref const currentBranch = github.context.payload.pull_request?.head?.ref
if (inputs.sinceLastRemoteCommit) { if (inputs.sinceLastRemoteCommit) {
@@ -330,7 +351,7 @@ export const getSHAForPullRequestEvent = async (
...gitFetchExtraArgs, ...gitFetchExtraArgs,
'-u', '-u',
'--progress', '--progress',
'origin', remoteName,
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}` `pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
] ]
}) })
@@ -343,8 +364,8 @@ export const getSHAForPullRequestEvent = async (
'-u', '-u',
'--progress', '--progress',
`--deepen=${inputs.fetchDepth}`, `--deepen=${inputs.fetchDepth}`,
'origin', remoteName,
`+refs/heads/${currentBranch}*:refs/remotes/origin/${currentBranch}*` `+refs/heads/${currentBranch}*:refs/remotes/${remoteName}/${currentBranch}*`
] ]
}) })
} }
@@ -364,8 +385,8 @@ export const getSHAForPullRequestEvent = async (
'-u', '-u',
'--progress', '--progress',
`--deepen=${inputs.fetchDepth}`, `--deepen=${inputs.fetchDepth}`,
'origin', remoteName,
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}` `+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
] ]
}) })
@@ -427,10 +448,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'
) {
diff = '..' diff = '..'
} }
@@ -487,17 +505,14 @@ export const getSHAForPullRequestEvent = async (
} }
} }
} else { } else {
if (github.context.payload.action === 'closed') { previousSha = github.context.payload.pull_request?.base?.sha
previousSha = github.context.payload.pull_request?.base?.sha
} else { if (!previousSha) {
previousSha = await getRemoteBranchHeadSha({ previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory, cwd: workingDirectory,
remoteName,
branch: targetBranch branch: targetBranch
}) })
if (!previousSha) {
previousSha = github.context.payload.pull_request?.base?.sha
}
} }
if (isShallow) { if (isShallow) {
@@ -521,8 +536,8 @@ export const getSHAForPullRequestEvent = async (
'-u', '-u',
'--progress', '--progress',
`--deepen=${inputs.fetchDepth}`, `--deepen=${inputs.fetchDepth}`,
'origin', remoteName,
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}` `+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
] ]
}) })

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

@@ -154,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(
@@ -290,6 +297,7 @@ export const getInputs = (): Inputs => {
} }
if (fetchDepth) { if (fetchDepth) {
// Fallback to at least 2 if the fetch_depth is less than 2
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2) inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2)
} }

View File

@@ -65,8 +65,14 @@ const getChangedFilesFromLocalGitHistory = async ({
const isShallow = await isRepoShallow({cwd: workingDirectory}) const isShallow = await isRepoShallow({cwd: workingDirectory})
const hasSubmodule = await submoduleExists({cwd: workingDirectory}) const hasSubmodule = await submoduleExists({cwd: workingDirectory})
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules'] let gitFetchExtraArgs = ['--no-tags', '--prune']
if (hasSubmodule) {
gitFetchExtraArgs.push('--recurse-submodules')
}
const isTag = env.GITHUB_REF?.startsWith('refs/tags/') const isTag = env.GITHUB_REF?.startsWith('refs/tags/')
const remoteName = 'origin'
const outputRenamedFilesAsDeletedAndAdded = const outputRenamedFilesAsDeletedAndAdded =
inputs.outputRenamedFilesAsDeletedAndAdded inputs.outputRenamedFilesAsDeletedAndAdded
let submodulePaths: string[] = [] let submodulePaths: string[] = []
@@ -83,29 +89,30 @@ const getChangedFilesFromLocalGitHistory = async ({
if (!github.context.payload.pull_request?.base?.ref) { if (!github.context.payload.pull_request?.base?.ref) {
core.info(`Running on a ${github.context.eventName || 'push'} event...`) core.info(`Running on a ${github.context.eventName || 'push'} event...`)
diffResult = await getSHAForNonPullRequestEvent( diffResult = await getSHAForNonPullRequestEvent({
inputs, inputs,
env, env,
workingDirectory, workingDirectory,
isShallow, isShallow,
hasSubmodule, hasSubmodule,
gitFetchExtraArgs, gitFetchExtraArgs,
isTag isTag,
) remoteName
})
} else { } else {
core.info( core.info(
`Running on a ${github.context.eventName || 'pull_request'} (${ `Running on a ${github.context.eventName || 'pull_request'} (${
github.context.payload.action github.context.payload.action
}) event...` }) event...`
) )
diffResult = await getSHAForPullRequestEvent( diffResult = await getSHAForPullRequestEvent({
inputs, inputs,
env,
workingDirectory, workingDirectory,
isShallow, isShallow,
hasSubmodule, hasSubmodule,
gitFetchExtraArgs gitFetchExtraArgs,
) remoteName
})
} }
if (diffResult.initialCommit) { if (diffResult.initialCommit) {
@@ -264,9 +271,8 @@ export async function run(): Promise<void> {
}) })
} else { } else {
if (!hasGitDirectory) { if (!hasGitDirectory) {
core.info(`Running on a ${github.context.eventName} event...`)
throw new Error( throw new Error(
`Can't find local .git in ${workingDirectory} directory. Please run actions/checkout before this action (Make sure the 'path' input is correct). If you intend to use Github's REST API note that only pull_request* events are supported.` `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}".`
) )
} }

View File

@@ -685,14 +685,16 @@ export const isInsideWorkTree = async ({
export const getRemoteBranchHeadSha = async ({ export const getRemoteBranchHeadSha = async ({
cwd, cwd,
branch branch,
remoteName
}: { }: {
cwd: string cwd: string
branch: string branch: string
remoteName: string
}): Promise<string> => { }): Promise<string> => {
const {stdout} = await exec.getExecOutput( const {stdout} = await exec.getExecOutput(
'git', 'git',
['rev-parse', `origin/${branch}`], ['rev-parse', `${remoteName}/${branch}`],
{ {
cwd, cwd,
silent: !core.isDebug() silent: !core.isDebug()
@@ -902,7 +904,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,

1512
yarn.lock

File diff suppressed because it is too large Load Diff