Compare commits
450 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05f0aba931 | ||
|
|
462396174f | ||
|
|
c19a7eb771 | ||
|
|
c288441a7d | ||
|
|
1d6ea46cac | ||
|
|
02b41f5ff9 | ||
|
|
b4a4dcabce | ||
|
|
602aacf949 | ||
|
|
51290e039a | ||
|
|
b4badd8cce | ||
|
|
652b4c06e8 | ||
|
|
0b7a421316 | ||
|
|
b26581aca1 | ||
|
|
43e6b45c5d | ||
|
|
fe1bc0e3d3 | ||
|
|
d7917c6584 | ||
|
|
3f646a3549 | ||
|
|
6809677b7a | ||
|
|
4edd678ac3 | ||
|
|
f08255874b | ||
|
|
92c02a00a1 | ||
|
|
b70221184d | ||
|
|
435fd74b2e | ||
|
|
0626fa3ff3 | ||
|
|
8817a797cb | ||
|
|
54174910be | ||
|
|
84ef162530 | ||
|
|
b672a5115a | ||
|
|
678cdc2808 | ||
|
|
27b7bbb0ae | ||
|
|
83610723bb | ||
|
|
21acf46f4a | ||
|
|
f356b3c86b | ||
|
|
66275de060 | ||
|
|
a16702bf7a | ||
|
|
aa11897ec4 | ||
|
|
6513fe1691 | ||
|
|
45e0c78ac7 | ||
|
|
a949a8338c | ||
|
|
1f772e919b | ||
|
|
684c5e6d94 | ||
|
|
9d7201ded6 | ||
|
|
f93ff33629 | ||
|
|
729c70475c | ||
|
|
2009d446ac | ||
|
|
b693fc207f | ||
|
|
0104c75ccc | ||
|
|
4d0aab94b6 | ||
|
|
df3e9932c4 | ||
|
|
c3a1bb2c99 | ||
|
|
27843f1667 | ||
|
|
36d5b9dda5 | ||
|
|
9d4f8fea58 | ||
|
|
d0cf1645b7 | ||
|
|
641e22af4a | ||
|
|
8a4a9757b7 | ||
|
|
6bfa9e7a9a | ||
|
|
625dbd682e | ||
|
|
1a71128b6a | ||
|
|
c29c1d3dd0 | ||
|
|
e753fb0a63 | ||
|
|
e21f1a3077 | ||
|
|
792230fced | ||
|
|
4dbe54f96e | ||
|
|
537f1c6318 | ||
|
|
82587d8858 | ||
|
|
eda64a62bd | ||
|
|
4d5444c2c3 | ||
|
|
c2e104be2f | ||
|
|
eed685a419 | ||
|
|
6f538bb83f | ||
|
|
48d8f15b2a | ||
|
|
f4e06529f1 | ||
|
|
9b5f7d7ff5 | ||
|
|
80dc58425e | ||
|
|
f9216b6d97 | ||
|
|
fef272dc40 | ||
|
|
a236bf57ea | ||
|
|
0cb58dec12 | ||
|
|
44f3356296 | ||
|
|
1d9fdda44c | ||
|
|
ca746c1dbe | ||
|
|
2414c5b001 | ||
|
|
e73bb10d96 | ||
|
|
c7114f61a1 | ||
|
|
38cc85fd79 | ||
|
|
834406f361 | ||
|
|
5d8e41f17c | ||
|
|
a78c1f5db4 | ||
|
|
5977012387 | ||
|
|
e9772d1404 | ||
|
|
880354d0c6 | ||
|
|
8d5497eb10 | ||
|
|
696bea0add | ||
|
|
bd7d572708 | ||
|
|
305db886e7 | ||
|
|
17107f43d7 | ||
|
|
2d4c94f488 | ||
|
|
bf02379775 | ||
|
|
0d320382bc | ||
|
|
40853de9f8 | ||
|
|
94b94fea13 | ||
|
|
f8034fbb84 | ||
|
|
b4c0974161 | ||
|
|
246859db91 | ||
|
|
46a4c027a6 | ||
|
|
525aabbe28 | ||
|
|
25b256207d | ||
|
|
257f12c17b | ||
|
|
598b7212f2 | ||
|
|
88201be733 | ||
|
|
9b7ba7b107 | ||
|
|
3ea85a1c0d | ||
|
|
50693d8df5 | ||
|
|
87d8f9488b | ||
|
|
950331d47c | ||
|
|
ed00b69562 | ||
|
|
9d768c3d4e | ||
|
|
6b79c79980 | ||
|
|
99b60a2a91 | ||
|
|
8ae850f052 | ||
|
|
71038002e0 | ||
|
|
03d95b07db | ||
|
|
c65cd88342 | ||
|
|
9f928e3005 | ||
|
|
fb1b47b727 | ||
|
|
a77ecbc238 | ||
|
|
e4fe134b73 | ||
|
|
f5a7145f2b | ||
|
|
10471793b2 | ||
|
|
28fd03b28d | ||
|
|
4db04c76fa | ||
|
|
f79274f27b | ||
|
|
f1d2215d5d | ||
|
|
6b2903bdce | ||
|
|
dc82617b24 | ||
|
|
1797e9a1ea | ||
|
|
56b5e13a32 | ||
|
|
9e63ef55ed | ||
|
|
f1afcaced6 | ||
|
|
e42a3d1b0a | ||
|
|
f0eedff362 | ||
|
|
f6d7b721fd | ||
|
|
6f59461624 | ||
|
|
443dcaf814 | ||
|
|
6f8dfa84e8 | ||
|
|
df7dd40375 | ||
|
|
07a5a99344 | ||
|
|
02a0746337 | ||
|
|
75ed46d235 | ||
|
|
c8c9e91b48 | ||
|
|
8ead8a4214 | ||
|
|
0f83d09356 | ||
|
|
c3dcd3e758 | ||
|
|
0e9a58eebf | ||
|
|
2295558b65 | ||
|
|
68447960ff | ||
|
|
00518ab39d | ||
|
|
2c2260e690 | ||
|
|
9adb9156b8 | ||
|
|
d1d479f03c | ||
|
|
cc733854b1 | ||
|
|
0b99ecfd4e | ||
|
|
cc3bbb0c52 | ||
|
|
373db58d9d | ||
|
|
9161a8dcde | ||
|
|
e13fb92d45 | ||
|
|
7891350b8e | ||
|
|
457e041909 | ||
|
|
eaf854ef0c | ||
|
|
681bf92506 | ||
|
|
3ec883ad31 | ||
|
|
e5740c1ffc | ||
|
|
bbe7f7b544 | ||
|
|
205913dc0c | ||
|
|
dd73690e2e | ||
|
|
c226cd45e5 | ||
|
|
facb2785cd | ||
|
|
4b558a92db | ||
|
|
5f68aa8f2d | ||
|
|
0da22a2fef | ||
|
|
2972fe4d6b | ||
|
|
57a81a39f3 | ||
|
|
1d8732f877 | ||
|
|
3de07763cf | ||
|
|
b53f3b80e1 | ||
|
|
4f8f7b39ce | ||
|
|
ff86e79932 | ||
|
|
14c7f454e7 | ||
|
|
cda0f1d381 | ||
|
|
d44c8e3205 | ||
|
|
6b3dabec4c | ||
|
|
bce8e36722 | ||
|
|
b376795801 | ||
|
|
d41df78c17 | ||
|
|
4ae1154663 | ||
|
|
60268df189 | ||
|
|
f52993ba02 | ||
|
|
3b13fed1b0 | ||
|
|
338ea071b0 | ||
|
|
25cb66210f | ||
|
|
d6babd6899 | ||
|
|
0a79e54e1f | ||
|
|
9d06a2a6a9 | ||
|
|
7e8e88bd35 | ||
|
|
b510737b96 | ||
|
|
2e70979353 | ||
|
|
625929d27d | ||
|
|
03334d095e | ||
|
|
8a0655f075 | ||
|
|
98e187efcd | ||
|
|
96f65726ea | ||
|
|
bf548e4af2 | ||
|
|
8b07fd3b11 | ||
|
|
d195e6e7c2 | ||
|
|
1754cd4b9e | ||
|
|
03c184259a | ||
|
|
5f0139347a | ||
|
|
58a98867a7 | ||
|
|
9216b0cec2 | ||
|
|
0e3a6c3e99 | ||
|
|
e86678fe3a | ||
|
|
35d5a4d79f | ||
|
|
887f93673c | ||
|
|
a29e8b5656 | ||
|
|
5a127050b2 | ||
|
|
581934340b | ||
|
|
5587afbef7 | ||
|
|
0f039f361b | ||
|
|
6d4230d4f0 | ||
|
|
1711887607 | ||
|
|
c393672835 | ||
|
|
396e5a51d5 | ||
|
|
47a2d62412 | ||
|
|
c73b12cc6d | ||
|
|
41ce994be9 | ||
|
|
192e174507 | ||
|
|
5e85e31a01 | ||
|
|
7871e848ad | ||
|
|
15fa7fb955 | ||
|
|
1c5b7dc5f4 | ||
|
|
4765b9f775 | ||
|
|
0c82494d63 | ||
|
|
7d02310f6e | ||
|
|
0df48f8409 | ||
|
|
b76e23c88a | ||
|
|
549c203ec2 | ||
|
|
cee950d742 | ||
|
|
44ce9f4341 | ||
|
|
7b65c377b1 | ||
|
|
532b66aa5c | ||
|
|
d9384bba72 | ||
|
|
461ea4f9bf | ||
|
|
0874344d6e | ||
|
|
9f8300f8b4 | ||
|
|
a06b9e80ae | ||
|
|
4c5f5d698f | ||
|
|
07c64e5618 | ||
|
|
5bd333239b | ||
|
|
831e892562 | ||
|
|
e052d30e1c | ||
|
|
23a449039c | ||
|
|
60e2739e15 | ||
|
|
0f319d7425 | ||
|
|
d477ae513d | ||
|
|
5891cbdfd5 | ||
|
|
c9eaa5c000 | ||
|
|
fd91508dbb | ||
|
|
e8a7e82269 | ||
|
|
159b05372c | ||
|
|
635f118699 | ||
|
|
634b61511e | ||
|
|
77fcf43160 | ||
|
|
5f084a52a4 | ||
|
|
ff2cb1b4f2 | ||
|
|
5d5da31340 | ||
|
|
29bc0d3fd9 | ||
|
|
c9f9d5784e | ||
|
|
a4fba0109c | ||
|
|
8a6546164a | ||
|
|
bad2eb6859 | ||
|
|
b2dbd4264a | ||
|
|
57d40e662d | ||
|
|
185549c022 | ||
|
|
f853fd0592 | ||
|
|
cd3c6e6bbd | ||
|
|
e5ce44a301 | ||
|
|
ccdcd17ffd | ||
|
|
e4b8dafc5d | ||
|
|
2d756ea4c5 | ||
|
|
ce497c39e9 | ||
|
|
2d21bbb405 | ||
|
|
90941b398f | ||
|
|
2ca8dc42f6 | ||
|
|
ee096d679e | ||
|
|
4621617d4b | ||
|
|
4bbd49b998 | ||
|
|
c6557ed000 | ||
|
|
f0e7702ccc | ||
|
|
6354e6c542 | ||
|
|
117616472f | ||
|
|
4ff79362e5 | ||
|
|
0713a11242 | ||
|
|
064742427d | ||
|
|
efe5e6c7a4 | ||
|
|
01e9662a12 | ||
|
|
20576b4b9e | ||
|
|
077b23f6a6 | ||
|
|
02768050b1 | ||
|
|
427adf47f0 | ||
|
|
5c6aa49478 | ||
|
|
aa0b62a2d0 | ||
|
|
0320702dd5 | ||
|
|
38903688b4 | ||
|
|
98a74d2cd6 | ||
|
|
068000d9c6 | ||
|
|
490ac3999e | ||
|
|
2859a60726 | ||
|
|
d03038e4e4 | ||
|
|
77af4bed28 | ||
|
|
a5cf6aa30c | ||
|
|
15807c9c84 | ||
|
|
dc458cf753 | ||
|
|
92ca3eebd0 | ||
|
|
f591d0c7f0 | ||
|
|
35023362e2 | ||
|
|
e436cb6d85 | ||
|
|
257d47dfba | ||
|
|
4918e11830 | ||
|
|
aa08304bd4 | ||
|
|
008ba8ceec | ||
|
|
fe6c3ea0ca | ||
|
|
7fc073d922 | ||
|
|
7e4bfc2f1f | ||
|
|
ef3a7f51d6 | ||
|
|
a65c2f2100 | ||
|
|
ea042d8095 | ||
|
|
8293f8c984 | ||
|
|
0ff732eeb3 | ||
|
|
8df6fc260f | ||
|
|
d516645658 | ||
|
|
2c97e7ea24 | ||
|
|
1c8e606958 | ||
|
|
74605cb326 | ||
|
|
aa15b58e8a | ||
|
|
0a392e7438 | ||
|
|
85efc7df8e | ||
|
|
2a095d24c2 | ||
|
|
ac3dc5e392 | ||
|
|
dd7e9d3b17 | ||
|
|
0647a31f54 | ||
|
|
9d67dd3dbe | ||
|
|
5acd7e3646 | ||
|
|
9f4af73d05 | ||
|
|
800a282599 | ||
|
|
31c4d150e6 | ||
|
|
2a2a5b6b9c | ||
|
|
d8dcc13244 | ||
|
|
639ce0e105 | ||
|
|
9d447b9959 | ||
|
|
83bfc72efa | ||
|
|
879c8388c8 | ||
|
|
bb7502bd15 | ||
|
|
5c5539ced9 | ||
|
|
c2039de114 | ||
|
|
0cbc9bc448 | ||
|
|
9ef20a69dd | ||
|
|
a617853c0f | ||
|
|
5c1bceb76c | ||
|
|
3f54ebb830 | ||
|
|
6f070cff38 | ||
|
|
ec75ae5ab7 | ||
|
|
4333ab5b20 | ||
|
|
e3cac49049 | ||
|
|
68bd4537bd | ||
|
|
f0ce41b71c | ||
|
|
ce451bf430 | ||
|
|
7592e9e855 | ||
|
|
999653c672 | ||
|
|
6cf4c21fdf | ||
|
|
09ee51bee3 | ||
|
|
8eced8a5df | ||
|
|
13fa1402a7 | ||
|
|
07ac0ac168 | ||
|
|
049d7fd639 | ||
|
|
2e90fbb74b | ||
|
|
2a9db54a6d | ||
|
|
d0d5671ef7 | ||
|
|
97120ff1f5 | ||
|
|
b2d4e1b488 | ||
|
|
9299962a59 | ||
|
|
ea35f7ea00 | ||
|
|
3399f8837f | ||
|
|
ac897da4f1 | ||
|
|
8e56bc097a | ||
|
|
f6d3fe5179 | ||
|
|
efa99ea361 | ||
|
|
6d8f9bd379 | ||
|
|
589fb70c81 | ||
|
|
7daee9e7cf | ||
|
|
99c80bdd47 | ||
|
|
5e7cbf5fdb | ||
|
|
b4d6d28988 | ||
|
|
8370e6e6ef | ||
|
|
aa31060851 | ||
|
|
54c56103aa | ||
|
|
e57fb1b8eb | ||
|
|
926735a61e | ||
|
|
d3ac2a064b | ||
|
|
91df40b882 | ||
|
|
28396e9658 | ||
|
|
3a66e2a7e4 | ||
|
|
35f3202fd5 | ||
|
|
2b30af482a | ||
|
|
a93bcf46e0 | ||
|
|
6d4c555c7d | ||
|
|
507a8c703d | ||
|
|
3a7052c24a | ||
|
|
782eb123a9 | ||
|
|
9134dac8f6 | ||
|
|
df12603b45 | ||
|
|
bb9b5e8363 | ||
|
|
31b9c0a541 | ||
|
|
ba0a561b13 | ||
|
|
8d35cbb00f | ||
|
|
82dd6547dc | ||
|
|
6d42539842 | ||
|
|
08dedfb681 | ||
|
|
f6d9fa10e0 | ||
|
|
9eb0d763ae | ||
|
|
51d2f88f07 | ||
|
|
90a06d6ba9 | ||
|
|
2cb2c9234e | ||
|
|
ac21d93904 | ||
|
|
a4637ea6e7 | ||
|
|
fd9998cf5f | ||
|
|
ea024b2d7f | ||
|
|
db4e584844 | ||
|
|
c6543c497a | ||
|
|
88f9f3efbb | ||
|
|
3af07c2040 | ||
|
|
3680129aa2 | ||
|
|
5d866cbe77 | ||
|
|
346f237a17 | ||
|
|
c037f1e7c5 | ||
|
|
ae82ed4ae0 | ||
|
|
cbd59070e8 | ||
|
|
6c9dcea443 | ||
|
|
79b060d445 | ||
|
|
434b67ebc3 |
@ -208,6 +208,52 @@
|
|||||||
"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"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Whadup",
|
||||||
|
"name": "Lukas Pfahler",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/2308119?v=4",
|
||||||
|
"profile": "https://lukaspfahler.de",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
|||||||
7
.github/workflows/codacy-analysis.yml
vendored
7
.github/workflows/codacy-analysis.yml
vendored
@ -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.5
|
||||||
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
18
.github/workflows/greetings.yml
vendored
Normal 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."
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Issue Comment Test
|
name: Issue Comment Job Example
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -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
|
||||||
@ -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 }}'
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: Multi Job Test
|
name: Multi Job Example
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
2
.github/workflows/sync-release-version.yml
vendored
2
.github/workflows/sync-release-version.yml
vendored
@ -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@v7.0.5
|
||||||
with:
|
with:
|
||||||
base: "main"
|
base: "main"
|
||||||
labels: "merge when passing"
|
labels: "merge when passing"
|
||||||
|
|||||||
236
.github/workflows/test.yml
vendored
236
.github/workflows/test.yml
vendored
@ -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.1.0
|
||||||
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@v25
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT_TOKEN }}
|
token: ${{ secrets.PAT_TOKEN }}
|
||||||
@ -68,9 +70,12 @@ jobs:
|
|||||||
- name: Run build and test
|
- name: Run build and test
|
||||||
run: |
|
run: |
|
||||||
yarn all
|
yarn all
|
||||||
|
env:
|
||||||
|
GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FORK: ${{ github.event.pull_request.head.repo.fork }}
|
||||||
|
|
||||||
- name: Verify Changed files
|
- name: Verify Changed files
|
||||||
uses: tj-actions/verify-changed-files@v17
|
uses: tj-actions/verify-changed-files@v20
|
||||||
|
if: github.actor != 'dependabot[bot]'
|
||||||
id: changed_files
|
id: changed_files
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
@ -94,7 +99,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 +116,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 +128,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 +154,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 +192,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 +202,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 +251,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 +262,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 +295,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 +306,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 +327,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 +345,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 +368,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 +378,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 +397,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 +414,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 +433,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 +488,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 +555,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 +570,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 +662,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
|
||||||
|
|
||||||
@ -593,11 +685,34 @@ jobs:
|
|||||||
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
|
||||||
|
- name: Run changed-files excluding submodule
|
||||||
|
id: changed-files-exclude-submodule
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
base_sha: "85bd869"
|
||||||
|
sha: "adde7bb"
|
||||||
|
fetch_depth: 60000
|
||||||
|
exclude_submodules: true
|
||||||
|
|
||||||
|
- name: Verify no added files
|
||||||
|
if: steps.changed-files-exclude-submodule.outputs.added_files != ''
|
||||||
|
run: |
|
||||||
|
echo "Expected: ('') got ${{ steps.changed-files-exclude-submodule.outputs.added_files }}"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(steps.changed-files-exclude-submodule.outputs) }}"
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
test-yaml:
|
test-yaml:
|
||||||
name: Test changed-files with yaml
|
name: Test changed-files with yaml
|
||||||
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 +728,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
|
||||||
|
|
||||||
@ -645,6 +760,24 @@ jobs:
|
|||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
|
||||||
|
- name: Run changed-files with files_yaml, files_ignore_yaml
|
||||||
|
id: changed-files-ignore
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
files_yaml: |
|
||||||
|
test:
|
||||||
|
- test/**.txt
|
||||||
|
- test/**.md
|
||||||
|
files_ignore_yaml: |
|
||||||
|
test:
|
||||||
|
- test/test.txt
|
||||||
|
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(steps.changed-files-ignore.outputs) }}"
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
|
||||||
- name: Run changed-files with files_yaml, json and write_output_files
|
- name: Run changed-files with files_yaml, json and write_output_files
|
||||||
id: changed-files-json-write-output-files
|
id: changed-files-json-write-output-files
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -673,6 +806,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 +823,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 +998,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
|
||||||
@ -893,14 +1030,19 @@ jobs:
|
|||||||
bash
|
bash
|
||||||
test-dir-names-deleted-files-include-only-deleted-dirs-directory:
|
test-dir-names-deleted-files-include-only-deleted-dirs-directory:
|
||||||
name: Test dir names deleted files include only deleted dirs
|
name: Test dir names deleted files include only deleted dirs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.platform }}
|
||||||
needs: build
|
needs: build
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
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
|
||||||
with:
|
with:
|
||||||
ref: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
@ -912,6 +1054,7 @@ jobs:
|
|||||||
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
||||||
dir_names: true
|
dir_names: true
|
||||||
dir_names_deleted_files_include_only_deleted_dirs: true
|
dir_names_deleted_files_include_only_deleted_dirs: true
|
||||||
|
fetch_depth: 60000
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}'
|
||||||
@ -931,12 +1074,43 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Run changed-files with dir_names and dir_names_deleted_files_include_only_deleted_dirs with the test directory deleted returns posix path separator
|
||||||
|
id: changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
base_sha: a52f8621d26d5d9f54b80f74bda2d9eedff94693
|
||||||
|
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
||||||
|
dir_names: true
|
||||||
|
dir_names_deleted_files_include_only_deleted_dirs: true
|
||||||
|
use_posix_path_separator: true
|
||||||
|
fetch_depth: 60000
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs) }}'
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check deleted_files output on non windows platform
|
||||||
|
if: steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files != 'test/test3' && runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check deleted_files output on windows platform
|
||||||
|
if: "!contains(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files, 'test/test3') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
|
||||||
test-since-last-remote-commit:
|
test-since-last-remote-commit:
|
||||||
name: Test changed-files since last remote commit
|
name: Test changed-files since last remote commit
|
||||||
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 +1127,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
|
||||||
|
|
||||||
@ -964,10 +1138,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
since_last_remote_commit: true
|
since_last_remote_commit: true
|
||||||
|
|
||||||
- name: Verify failed
|
- name: Verify succeeded pull_request(closed)
|
||||||
if: steps.changed-files-since-last-remote-commit.outcome != 'failure' && matrix.fetch-depth == 1 && github.event.action == 'closed' && github.event_name == 'pull_request'
|
if: steps.changed-files-since-last-remote-commit.outcome != 'success' && matrix.fetch-depth == 1 && github.event.action == 'closed' && github.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
echo "Expected: (failure) got ${{ steps.changed-files-since-last-remote-commit.outcome }}"
|
echo "Expected: (success) got ${{ steps.changed-files-since-last-remote-commit.outcome }}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Verify succeeded
|
- name: Verify succeeded
|
||||||
@ -987,6 +1161,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 +1178,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 +1193,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:
|
||||||
|
|||||||
4
.github/workflows/update-readme.yml
vendored
4
.github/workflows/update-readme.yml
vendored
@ -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@v20
|
||||||
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@v7
|
||||||
with:
|
with:
|
||||||
base: "main"
|
base: "main"
|
||||||
labels: "merge when passing"
|
labels: "merge when passing"
|
||||||
|
|||||||
41
.github/workflows/workflow-run-example.yml
vendored
Normal file
41
.github/workflows/workflow-run-example.yml
vendored
Normal 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 }}"
|
||||||
20
.github/workflows/workflow-run-test.yml
vendored
20
.github/workflows/workflow-run-test.yml
vendored
@ -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'
|
|
||||||
1356
HISTORY.md
1356
HISTORY.md
File diff suppressed because it is too large
Load Diff
455
README.md
455
README.md
@ -1,7 +1,7 @@
|
|||||||
[](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
|
[](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
|
||||||
[](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
|
[](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
|
||||||
[](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
|
[](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)
|
||||||
[](https://github.com/search?o=desc\&q=tj-actions+changed-files+language%3AYAML\&s=\&type=Code)
|
[](https://github.com/search?o=desc\&q=tj-actions+changed-files+language%3AYAML\&s=\&type=Code)
|
||||||
|
|
||||||
[](https://app.codacy.com/gh/tj-actions/changed-files/dashboard?utm_source=gh\&utm_medium=referral\&utm_content=\&utm_campaign=Badge_grade)
|
[](https://app.codacy.com/gh/tj-actions/changed-files/dashboard?utm_source=gh\&utm_medium=referral\&utm_content=\&utm_campaign=Badge_grade)
|
||||||
[](https://github.com/tj-actions/changed-files/actions/workflows/test.yml)
|
[](https://github.com/tj-actions/changed-files/actions/workflows/test.yml)
|
||||||
@ -9,26 +9,26 @@
|
|||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||||
|
|
||||||
[](#contributors-)
|
[](#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.
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
* [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)
|
||||||
@ -49,18 +49,18 @@ Effortlessly track all changed files and directories relative to a target branch
|
|||||||
## Features 🚀
|
## Features 🚀
|
||||||
|
|
||||||
* Fast execution, averaging 0-10 seconds.
|
* Fast execution, averaging 0-10 seconds.
|
||||||
* Leverages either [Github's REST API](https://docs.github.com/en/rest/reference/repos#list-commits) or [Git's native diff](https://git-scm.com/docs/git-diff) to determine changed files.
|
* Leverages either [Github's REST API](https://docs.github.com/en/rest/reference/repos#list-commits) or [Git's native diff command](https://git-scm.com/docs/git-diff) to determine changed files.
|
||||||
* Facilitates easy debugging.
|
* Facilitates easy debugging.
|
||||||
* 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.
|
||||||
* Writes outputs to a designated `.txt` or `.json` file for further processing.
|
* Writes outputs to a designated `.txt` or `.json` file for further processing.
|
||||||
* Restores deleted files to their previous location or a newly specified location.
|
* Restores deleted files to their previous location or a newly specified location.
|
||||||
* Supports fetching a fixed number of commits which improves performance.
|
* Supports fetching a fixed number of commits, which improves performance.
|
||||||
* Compatible with all platforms (Linux, MacOS, Windows).
|
* Compatible with all platforms (Linux, MacOS, Windows).
|
||||||
* Supports [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners).
|
* Supports [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners).
|
||||||
* Supports [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server).
|
* Supports [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server).
|
||||||
@ -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@v45
|
||||||
# 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,32 +131,37 @@ 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@v45
|
||||||
with:
|
with:
|
||||||
# Avoid using single or double quotes for multiline patterns
|
# Avoid using single or double quotes for multiline patterns
|
||||||
files: |
|
files: |
|
||||||
**.md
|
**.md
|
||||||
|
docs/**.md
|
||||||
|
|
||||||
- name: List all changed files markdown files
|
- name: List all changed files markdown files
|
||||||
if: steps.changed-markdown-files.outputs.any_changed == 'true'
|
if: steps.changed-markdown-files.outputs.any_changed == 'true'
|
||||||
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@v45
|
||||||
with:
|
with:
|
||||||
files_yaml: |
|
files_yaml: |
|
||||||
doc:
|
doc:
|
||||||
@ -186,10 +191,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@v45
|
||||||
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 +228,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 +238,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@v45
|
||||||
|
|
||||||
- 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 +281,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@v45
|
||||||
# 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 +299,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 +320,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@v45
|
||||||
id: changed-files
|
id: changed-files
|
||||||
with:
|
with:
|
||||||
# Github API URL.
|
# Github API URL.
|
||||||
@ -327,52 +336,68 @@ Support this project with a :star:
|
|||||||
# Default: "${{ github.api_url }}"
|
# Default: "${{ github.api_url }}"
|
||||||
api_url: ''
|
api_url: ''
|
||||||
|
|
||||||
# Specify a different base commit SHA or branch used
|
# Specify a different base commit
|
||||||
# for comparing changes
|
# SHA or branch used for
|
||||||
|
# comparing changes
|
||||||
# Type: string
|
# Type: string
|
||||||
base_sha: ''
|
base_sha: ''
|
||||||
|
|
||||||
# Exclude changes outside the current directory and show path
|
# Exclude changes outside the current
|
||||||
# names relative to it. NOTE: This requires you to
|
# directory and show path names
|
||||||
# specify the top-level directory via the `path` input.
|
# relative to it. NOTE: This
|
||||||
|
# requires you to specify the
|
||||||
|
# top-level directory via the `path`
|
||||||
|
# input.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "true"
|
# Default: "true"
|
||||||
diff_relative: ''
|
diff_relative: ''
|
||||||
|
|
||||||
# Output unique changed directories instead of filenames. NOTE: This
|
# Output unique changed directories instead
|
||||||
# returns `.` for changed files located in the current
|
# of filenames. NOTE: This returns
|
||||||
# working directory which defaults to `$GITHUB_WORKSPACE`.
|
# `.` for changed files located
|
||||||
|
# in the current working directory
|
||||||
|
# which defaults to `$GITHUB_WORKSPACE`.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
dir_names: ''
|
dir_names: ''
|
||||||
|
|
||||||
# Include only directories that have been deleted as opposed
|
# Include only directories that have
|
||||||
# to directory names of files that have been deleted
|
# been deleted as opposed to
|
||||||
# in the `deleted_files` output when `dir_names` is set to
|
# directory names of files that
|
||||||
# `true`.
|
# have been deleted in the
|
||||||
|
# `deleted_files` output when `dir_names` is
|
||||||
|
# set to `true`.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
dir_names_deleted_files_include_only_deleted_dirs: ''
|
dir_names_deleted_files_include_only_deleted_dirs: ''
|
||||||
|
|
||||||
# Exclude the current directory represented by `.` from the
|
# Exclude the current directory represented
|
||||||
# output when `dir_names` is set to `true`.
|
# by `.` from the output
|
||||||
|
# when `dir_names` is set to
|
||||||
|
# `true`.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
dir_names_exclude_current_dir: ''
|
dir_names_exclude_current_dir: ''
|
||||||
|
|
||||||
# File and directory patterns to include in the output
|
# File and directory patterns to
|
||||||
# when `dir_names` is set to `true`. NOTE: This returns
|
# include in the output when
|
||||||
# only the matching files and also the directory names.
|
# `dir_names` is set to `true`.
|
||||||
|
# NOTE: This returns only the
|
||||||
|
# matching files and also the
|
||||||
|
# directory names.
|
||||||
# Type: string
|
# Type: string
|
||||||
dir_names_include_files: ''
|
dir_names_include_files: ''
|
||||||
|
|
||||||
# Separator used to split the `dir_names_include_files` input
|
# Separator used to split the
|
||||||
|
# `dir_names_include_files` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
dir_names_include_files_separator: ''
|
dir_names_include_files_separator: ''
|
||||||
|
|
||||||
# Limit the directory output to a maximum depth e.g
|
# Limit the directory output to
|
||||||
# `test/test1/test2` with max depth of `2` returns `test/test1`.
|
# a maximum depth e.g `test/test1/test2`
|
||||||
|
# with max depth of `2`
|
||||||
|
# returns `test/test1`.
|
||||||
# Type: string
|
# Type: string
|
||||||
dir_names_max_depth: ''
|
dir_names_max_depth: ''
|
||||||
|
|
||||||
@ -381,12 +406,19 @@ Support this project with a :star:
|
|||||||
# Default: "true"
|
# Default: "true"
|
||||||
escape_json: ''
|
escape_json: ''
|
||||||
|
|
||||||
# Fail when the initial diff fails.
|
# Exclude changes to submodules.
|
||||||
|
# Type: boolean
|
||||||
|
# Default: "false"
|
||||||
|
exclude_submodules: ''
|
||||||
|
|
||||||
|
# Fail when the initial diff
|
||||||
|
# fails.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
fail_on_initial_diff_error: ''
|
fail_on_initial_diff_error: ''
|
||||||
|
|
||||||
# Fail when the submodule diff fails.
|
# Fail when the submodule diff
|
||||||
|
# fails.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
fail_on_submodule_diff_error: ''
|
fail_on_submodule_diff_error: ''
|
||||||
@ -396,105 +428,140 @@ Support this project with a :star:
|
|||||||
# Default: "false"
|
# Default: "false"
|
||||||
fetch_additional_submodule_history: ''
|
fetch_additional_submodule_history: ''
|
||||||
|
|
||||||
# Depth of additional branch history fetched. NOTE: This can
|
# Depth of additional branch history
|
||||||
# be adjusted to resolve errors with insufficient history.
|
# fetched. NOTE: This can be
|
||||||
|
# adjusted to resolve errors with
|
||||||
|
# insufficient history.
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "50"
|
# Default: "25"
|
||||||
fetch_depth: ''
|
fetch_depth: ''
|
||||||
|
|
||||||
# File and directory patterns used to detect changes (Defaults to the entire repo if unset).
|
# Maximum number of retries to
|
||||||
# NOTE: Multiline file/directory patterns should not include quotes.
|
# fetch missing history.
|
||||||
|
# Type: string
|
||||||
|
# Default: "20"
|
||||||
|
fetch_missing_history_max_retries: ''
|
||||||
|
|
||||||
|
# File and directory patterns used
|
||||||
|
# to detect changes (Defaults to the entire repo if unset). NOTE:
|
||||||
|
# Multiline file/directory patterns should not
|
||||||
|
# include quotes.
|
||||||
# Type: string
|
# Type: string
|
||||||
files: ''
|
files: ''
|
||||||
|
|
||||||
# Source file(s) used to populate the `files` input.
|
# Source file(s) used to populate
|
||||||
|
# the `files` input.
|
||||||
# Type: string
|
# Type: string
|
||||||
files_from_source_file: ''
|
files_from_source_file: ''
|
||||||
|
|
||||||
# Separator used to split the `files_from_source_file` input.
|
# Separator used to split the
|
||||||
|
# `files_from_source_file` input.
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
files_from_source_file_separator: ''
|
files_from_source_file_separator: ''
|
||||||
|
|
||||||
# Ignore changes to these file(s). NOTE: Multiline file/directory patterns
|
# Ignore changes to these file(s).
|
||||||
# should not include quotes.
|
# NOTE: Multiline file/directory patterns should
|
||||||
|
# not include quotes.
|
||||||
# Type: string
|
# Type: string
|
||||||
files_ignore: ''
|
files_ignore: ''
|
||||||
|
|
||||||
# Source file(s) used to populate the `files_ignore` input
|
# Source file(s) used to populate
|
||||||
|
# the `files_ignore` input
|
||||||
# Type: string
|
# Type: string
|
||||||
files_ignore_from_source_file: ''
|
files_ignore_from_source_file: ''
|
||||||
|
|
||||||
# Separator used to split the `files_ignore_from_source_file` input
|
# Separator used to split the
|
||||||
|
# `files_ignore_from_source_file` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
files_ignore_from_source_file_separator: ''
|
files_ignore_from_source_file_separator: ''
|
||||||
|
|
||||||
# Separator used to split the `files_ignore` input
|
# Separator used to split the
|
||||||
|
# `files_ignore` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
files_ignore_separator: ''
|
files_ignore_separator: ''
|
||||||
|
|
||||||
# YAML used to define a set of file patterns
|
# YAML used to define a
|
||||||
# to ignore changes
|
# set of file patterns to
|
||||||
|
# ignore changes
|
||||||
# Type: string
|
# Type: string
|
||||||
files_ignore_yaml: ''
|
files_ignore_yaml: ''
|
||||||
|
|
||||||
# Source file(s) used to populate the `files_ignore_yaml` input. Example:
|
# Source file(s) used to populate
|
||||||
# https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
|
# the `files_ignore_yaml` input. Example: https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
|
||||||
# Type: string
|
# Type: string
|
||||||
files_ignore_yaml_from_source_file: ''
|
files_ignore_yaml_from_source_file: ''
|
||||||
|
|
||||||
# Separator used to split the `files_ignore_yaml_from_source_file` input
|
# Separator used to split the
|
||||||
|
# `files_ignore_yaml_from_source_file` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
files_ignore_yaml_from_source_file_separator: ''
|
files_ignore_yaml_from_source_file_separator: ''
|
||||||
|
|
||||||
# Separator used to split the `files` input
|
# Separator used to split the
|
||||||
|
# `files` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
files_separator: ''
|
files_separator: ''
|
||||||
|
|
||||||
# YAML used to define a set of file patterns
|
# YAML used to define a
|
||||||
# to detect changes
|
# set of file patterns to
|
||||||
|
# detect changes
|
||||||
# Type: string
|
# Type: string
|
||||||
files_yaml: ''
|
files_yaml: ''
|
||||||
|
|
||||||
# Source file(s) used to populate the `files_yaml` input. Example:
|
# Source file(s) used to populate
|
||||||
# https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
|
# the `files_yaml` input. Example: https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
|
||||||
# Type: string
|
# Type: string
|
||||||
files_yaml_from_source_file: ''
|
files_yaml_from_source_file: ''
|
||||||
|
|
||||||
# Separator used to split the `files_yaml_from_source_file` input
|
# Separator used to split the
|
||||||
|
# `files_yaml_from_source_file` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
files_yaml_from_source_file_separator: ''
|
files_yaml_from_source_file_separator: ''
|
||||||
|
|
||||||
# Include `all_old_new_renamed_files` output. Note this can generate a large
|
# Include `all_old_new_renamed_files` output. Note this
|
||||||
# output See: #501.
|
# can generate a large output
|
||||||
|
# See: #501.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
include_all_old_new_renamed_files: ''
|
include_all_old_new_renamed_files: ''
|
||||||
|
|
||||||
# Output list of changed files in a JSON formatted
|
# Output list of changed files
|
||||||
# string which can be used for matrix jobs. Example:
|
# in a JSON formatted string
|
||||||
# https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml
|
# which can be used for
|
||||||
|
# matrix jobs. Example: https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-example.yml
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
json: ''
|
json: ''
|
||||||
|
|
||||||
# Apply the negation patterns first. NOTE: This affects how
|
# Output changed files in a
|
||||||
# changed files are matched.
|
# 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 changed
|
||||||
|
# files are matched.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
negation_patterns_first: ''
|
negation_patterns_first: ''
|
||||||
|
|
||||||
# Split character for old and new renamed filename pairs.
|
# Split character for old and
|
||||||
|
# new renamed filename pairs.
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: " "
|
# Default: " "
|
||||||
old_new_files_separator: ''
|
old_new_files_separator: ''
|
||||||
|
|
||||||
# Split character for old and new filename pairs.
|
# Split character for old and
|
||||||
|
# new filename pairs.
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: ","
|
# Default: ","
|
||||||
old_new_separator: ''
|
old_new_separator: ''
|
||||||
@ -504,19 +571,22 @@ Support this project with a :star:
|
|||||||
# Default: ".github/outputs"
|
# Default: ".github/outputs"
|
||||||
output_dir: ''
|
output_dir: ''
|
||||||
|
|
||||||
# Output renamed files as deleted and added files.
|
# Output renamed files as deleted
|
||||||
|
# and added files.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
output_renamed_files_as_deleted_and_added: ''
|
output_renamed_files_as_deleted_and_added: ''
|
||||||
|
|
||||||
# Specify a relative path under `$GITHUB_WORKSPACE` to locate the
|
# Specify a relative path under
|
||||||
# repository.
|
# `$GITHUB_WORKSPACE` to locate the repository.
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "."
|
# Default: "."
|
||||||
path: ''
|
path: ''
|
||||||
|
|
||||||
# Use non-ASCII characters to match files and output the
|
# Use non-ASCII characters to match
|
||||||
# filenames completely verbatim by setting this to `false`
|
# files and output the filenames
|
||||||
|
# completely verbatim by setting this
|
||||||
|
# to `false`
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "true"
|
# Default: "true"
|
||||||
quotepath: ''
|
quotepath: ''
|
||||||
@ -526,35 +596,41 @@ Support this project with a :star:
|
|||||||
# Default: "false"
|
# Default: "false"
|
||||||
recover_deleted_files: ''
|
recover_deleted_files: ''
|
||||||
|
|
||||||
# Recover deleted files to a new destination directory, defaults
|
# Recover deleted files to a
|
||||||
# to the original location.
|
# new destination directory, defaults to
|
||||||
|
# the original location.
|
||||||
# Type: string
|
# Type: string
|
||||||
recover_deleted_files_to_destination: ''
|
recover_deleted_files_to_destination: ''
|
||||||
|
|
||||||
# File and directory patterns used to recover deleted files,
|
# File and directory patterns used
|
||||||
# defaults to the patterns provided via the `files`, `files_from_source_file`,
|
# to recover deleted files, defaults
|
||||||
# `files_ignore` and `files_ignore_from_source_file` inputs or all deleted files if
|
# to the patterns provided via
|
||||||
# no patterns are provided.
|
# the `files`, `files_from_source_file`, `files_ignore` and
|
||||||
|
# `files_ignore_from_source_file` inputs or all deleted
|
||||||
|
# files if no patterns are
|
||||||
|
# provided.
|
||||||
# Type: string
|
# Type: string
|
||||||
recover_files: ''
|
recover_files: ''
|
||||||
|
|
||||||
# File and directory patterns to ignore when recovering deleted
|
# File and directory patterns to
|
||||||
# files.
|
# ignore when recovering deleted files.
|
||||||
# Type: string
|
# Type: string
|
||||||
recover_files_ignore: ''
|
recover_files_ignore: ''
|
||||||
|
|
||||||
# Separator used to split the `recover_files_ignore` input
|
# Separator used to split the
|
||||||
|
# `recover_files_ignore` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
recover_files_ignore_separator: ''
|
recover_files_ignore_separator: ''
|
||||||
|
|
||||||
# Separator used to split the `recover_files` input
|
# Separator used to split the
|
||||||
|
# `recover_files` input
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "\n"
|
# Default: "\n"
|
||||||
recover_files_separator: ''
|
recover_files_separator: ''
|
||||||
|
|
||||||
# Apply sanitization to output filenames before being set as
|
# Apply sanitization to output filenames
|
||||||
# output.
|
# before being set as output.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "true"
|
# Default: "true"
|
||||||
safe_output: ''
|
safe_output: ''
|
||||||
@ -564,53 +640,83 @@ Support this project with a :star:
|
|||||||
# Default: " "
|
# Default: " "
|
||||||
separator: ''
|
separator: ''
|
||||||
|
|
||||||
# Specify a different commit SHA or branch used for
|
# Specify a different commit SHA
|
||||||
# comparing changes
|
# or branch used for comparing
|
||||||
|
# changes
|
||||||
# Type: string
|
# Type: string
|
||||||
sha: ''
|
sha: ''
|
||||||
|
|
||||||
# Get changed files for commits whose timestamp is older
|
# Get changed files for commits
|
||||||
# than the given time.
|
# whose timestamp is older than
|
||||||
|
# the given time.
|
||||||
# Type: string
|
# Type: string
|
||||||
since: ''
|
since: ''
|
||||||
|
|
||||||
# Use the last commit on the remote branch as
|
# Use the last commit on
|
||||||
# the `base_sha`. Defaults to the last non-merge commit on
|
# the remote branch as the
|
||||||
# the target branch for pull request events and the
|
# `base_sha`. Defaults to the last
|
||||||
# previous remote commit of the current branch for push
|
# non-merge commit on the target
|
||||||
# events.
|
# branch for pull request events
|
||||||
|
# and the previous remote commit
|
||||||
|
# of the current branch for
|
||||||
|
# push events.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# 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
|
||||||
# repositories. NOTE: This could lead to errors with missing
|
# to improve performance for shallow
|
||||||
# history and the intended use is limited to when
|
# repositories. NOTE: This could lead
|
||||||
# you've fetched the history necessary to perform the diff.
|
# to errors with missing history.
|
||||||
|
# It's intended to be used
|
||||||
|
# when you've fetched all necessary
|
||||||
|
# history to perform the diff.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
skip_initial_fetch: ''
|
skip_initial_fetch: ''
|
||||||
|
|
||||||
# GitHub token used to fetch changed files from Github's
|
# Tags pattern to ignore.
|
||||||
# API.
|
# Type: string
|
||||||
|
tags_ignore_pattern: ''
|
||||||
|
|
||||||
|
# Tags pattern to include.
|
||||||
|
# Type: string
|
||||||
|
# Default: "*"
|
||||||
|
tags_pattern: ''
|
||||||
|
|
||||||
|
# GitHub token used to fetch
|
||||||
|
# changed files from Github's API.
|
||||||
# Type: string
|
# Type: string
|
||||||
# Default: "${{ github.token }}"
|
# Default: "${{ github.token }}"
|
||||||
token: ''
|
token: ''
|
||||||
|
|
||||||
# Get changed files for commits whose timestamp is earlier
|
# Get changed files for commits
|
||||||
# than the given time.
|
# whose timestamp is earlier than
|
||||||
|
# the given time.
|
||||||
# Type: string
|
# Type: string
|
||||||
until: ''
|
until: ''
|
||||||
|
|
||||||
# Force the use of Github's REST API even when
|
# Use POSIX path separator `/`
|
||||||
# a local copy of the repository exists
|
# for output file paths on
|
||||||
|
# Windows.
|
||||||
|
# Type: boolean
|
||||||
|
# Default: "false"
|
||||||
|
use_posix_path_separator: ''
|
||||||
|
|
||||||
|
# Force the use of Github's
|
||||||
|
# REST API even when a
|
||||||
|
# local copy of the repository
|
||||||
|
# exists
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
use_rest_api: ''
|
use_rest_api: ''
|
||||||
|
|
||||||
# Write outputs to the `output_dir` defaults to `.github/outputs` folder.
|
# Write outputs to the `output_dir`
|
||||||
# NOTE: This creates a `.txt` file by default and
|
# defaults to `.github/outputs` folder. NOTE:
|
||||||
# a `.json` file if `json` is set to `true`.
|
# This creates a `.txt` file
|
||||||
|
# by default and a `.json`
|
||||||
|
# file if `json` is set
|
||||||
|
# to `true`.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
write_output_files: ''
|
write_output_files: ''
|
||||||
@ -647,33 +753,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 +813,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@v45
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -720,7 +826,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@v45
|
||||||
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 +834,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 +849,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@v45
|
||||||
with:
|
with:
|
||||||
separator: ","
|
separator: ","
|
||||||
...
|
...
|
||||||
@ -760,13 +866,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@v45
|
||||||
|
|
||||||
- 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 +889,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@v45
|
||||||
|
|
||||||
- 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 +910,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@v45
|
||||||
with:
|
with:
|
||||||
write_output_files: true
|
write_output_files: true
|
||||||
|
|
||||||
@ -823,7 +929,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@v45
|
||||||
with:
|
with:
|
||||||
json: true
|
json: true
|
||||||
write_output_files: true
|
write_output_files: true
|
||||||
@ -843,7 +949,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@v45
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
@ -866,7 +972,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@v45
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
@ -891,7 +997,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 +1006,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 +1023,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@v45
|
||||||
with:
|
with:
|
||||||
files_from_source_file: test/changed-files-list.txt
|
files_from_source_file: test/changed-files-list.txt
|
||||||
...
|
...
|
||||||
@ -934,7 +1040,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@v45
|
||||||
with:
|
with:
|
||||||
files_from_source_file: |
|
files_from_source_file: |
|
||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
@ -955,7 +1061,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@v45
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.event.pull_request.head.sha }}
|
sha: ${{ github.event.pull_request.head.sha }}
|
||||||
...
|
...
|
||||||
@ -972,7 +1078,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@v45
|
||||||
with:
|
with:
|
||||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
base_sha: ${{ github.event.pull_request.base.sha }}
|
||||||
...
|
...
|
||||||
@ -1004,13 +1110,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@v45
|
||||||
|
|
||||||
|
- 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@v45
|
||||||
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 +1151,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@v45
|
||||||
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 +1176,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@v45
|
||||||
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@v45
|
||||||
with:
|
with:
|
||||||
files: test/test-è.txt
|
files: test/test-è.txt
|
||||||
quotepath: "false"
|
quotepath: "false"
|
||||||
@ -1105,7 +1215,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@v45
|
||||||
with:
|
with:
|
||||||
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||||
...
|
...
|
||||||
@ -1132,7 +1242,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@v45
|
||||||
with:
|
with:
|
||||||
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
||||||
...
|
...
|
||||||
@ -1158,7 +1268,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@v45
|
||||||
with:
|
with:
|
||||||
dir_names: "true"
|
dir_names: "true"
|
||||||
...
|
...
|
||||||
@ -1175,7 +1285,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@v45
|
||||||
with:
|
with:
|
||||||
json: "true"
|
json: "true"
|
||||||
...
|
...
|
||||||
@ -1192,13 +1302,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@v45
|
||||||
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@v45
|
||||||
with:
|
with:
|
||||||
until: "2022-08-20"
|
until: "2022-08-20"
|
||||||
...
|
...
|
||||||
@ -1218,7 +1328,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 +1336,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 +1397,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 +1441,11 @@ 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>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://lukaspfahler.de"><img src="https://avatars.githubusercontent.com/u/2308119?v=4?s=100" width="100px;" alt="Lukas Pfahler"/><br /><sub><b>Lukas Pfahler</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=Whadup" title="Code">💻</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
61
action.yml
61
action.yml
@ -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:
|
||||||
@ -141,11 +141,11 @@ inputs:
|
|||||||
fetch_depth:
|
fetch_depth:
|
||||||
description: "Depth of additional branch history fetched. NOTE: This can be adjusted to resolve errors with insufficient history."
|
description: "Depth of additional branch history fetched. NOTE: This can be adjusted to resolve errors with insufficient history."
|
||||||
required: false
|
required: false
|
||||||
default: "50"
|
default: "25"
|
||||||
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,31 @@ 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"
|
||||||
|
exclude_submodules:
|
||||||
|
description: "Exclude changes to submodules."
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
fetch_missing_history_max_retries:
|
||||||
|
description: "Maximum number of retries to fetch missing history."
|
||||||
|
required: false
|
||||||
|
default: "20"
|
||||||
|
use_posix_path_separator:
|
||||||
|
description: "Use POSIX path separator `/` for output file paths on Windows."
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
tags_pattern:
|
||||||
|
description: "Tags pattern to include."
|
||||||
|
required: false
|
||||||
|
default: "*"
|
||||||
|
tags_ignore_pattern:
|
||||||
|
description: "Tags pattern to ignore."
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
added_files:
|
added_files:
|
||||||
@ -258,45 +283,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'
|
||||||
|
|||||||
17111
dist/index.js
generated
vendored
17111
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
5264
dist/licenses.txt
generated
vendored
5264
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,5 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
process.env.TESTING = "1"
|
|
||||||
process.env.GITHUB_WORKSPACE = path.join(
|
process.env.GITHUB_WORKSPACE = path.join(
|
||||||
path.resolve(__dirname, '..'), '.'
|
path.resolve(__dirname, '..'), '.'
|
||||||
)
|
)
|
||||||
|
|||||||
20
package.json
20
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tj-actions/changed-files",
|
"name": "@tj-actions/changed-files",
|
||||||
"version": "41.1.1",
|
"version": "45.0.4",
|
||||||
"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": {
|
||||||
@ -14,6 +14,7 @@
|
|||||||
"lint:fix": "eslint --fix src/*.ts src/**/*.ts",
|
"lint:fix": "eslint --fix src/*.ts src/**/*.ts",
|
||||||
"package": "ncc build lib/main.js --source-map --license licenses.txt",
|
"package": "ncc build lib/main.js --source-map --license licenses.txt",
|
||||||
"test": "jest --coverage",
|
"test": "jest --coverage",
|
||||||
|
"update-snapshot": "jest -u",
|
||||||
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
|
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -35,7 +36,8 @@
|
|||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"@octokit/rest": "^20.0.1",
|
"@octokit/rest": "^21.0.0",
|
||||||
|
"@stdlib/utils-convert-path": "^0.2.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"micromatch": "^4.0.5",
|
"micromatch": "^4.0.5",
|
||||||
"yaml": "^2.3.1"
|
"yaml": "^2.3.1"
|
||||||
@ -44,16 +46,16 @@
|
|||||||
"@types/jest": "^29.5.2",
|
"@types/jest": "^29.5.2",
|
||||||
"@types/lodash": "^4.14.195",
|
"@types/lodash": "^4.14.195",
|
||||||
"@types/micromatch": "^4.0.2",
|
"@types/micromatch": "^4.0.2",
|
||||||
"@types/node": "^20.3.2",
|
"@types/node": "^22.0.0",
|
||||||
"@types/uuid": "^9.0.2",
|
"@types/uuid": "^10.0.0",
|
||||||
"@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-jest": "^27.2.2",
|
|
||||||
"eslint-plugin-prettier": "^5.0.0-alpha.2",
|
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
|
"eslint-plugin-github": "^5.0.0",
|
||||||
|
"eslint-plugin-jest": "^28.0.0",
|
||||||
|
"eslint-plugin-prettier": "^5.0.0-alpha.2",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
|
|||||||
373
src/__tests__/__snapshots__/inputs.test.ts.snap
Normal file
373
src/__tests__/__snapshots__/inputs.test.ts.snap
Normal file
@ -0,0 +1,373 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`getInputs should correctly parse boolean inputs 1`] = `
|
||||||
|
{
|
||||||
|
"apiUrl": "",
|
||||||
|
"baseSha": "",
|
||||||
|
"diffRelative": "false",
|
||||||
|
"dirNames": "false",
|
||||||
|
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": "false",
|
||||||
|
"dirNamesExcludeCurrentDir": "false",
|
||||||
|
"dirNamesIncludeFiles": "",
|
||||||
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": "false",
|
||||||
|
"failOnInitialDiffError": "false",
|
||||||
|
"failOnSubmoduleDiffError": "false",
|
||||||
|
"fetchAdditionalSubmoduleHistory": "false",
|
||||||
|
"fetchMissingHistoryMaxRetries": 20,
|
||||||
|
"files": "",
|
||||||
|
"filesFromSourceFile": "",
|
||||||
|
"filesFromSourceFileSeparator": "",
|
||||||
|
"filesIgnore": "",
|
||||||
|
"filesIgnoreFromSourceFile": "",
|
||||||
|
"filesIgnoreFromSourceFileSeparator": "",
|
||||||
|
"filesIgnoreSeparator": "",
|
||||||
|
"filesIgnoreYaml": "",
|
||||||
|
"filesIgnoreYamlFromSourceFile": "",
|
||||||
|
"filesIgnoreYamlFromSourceFileSeparator": "",
|
||||||
|
"filesSeparator": "",
|
||||||
|
"filesYaml": "",
|
||||||
|
"filesYamlFromSourceFile": "",
|
||||||
|
"filesYamlFromSourceFileSeparator": "",
|
||||||
|
"includeAllOldNewRenamedFiles": "false",
|
||||||
|
"json": true,
|
||||||
|
"negationPatternsFirst": "false",
|
||||||
|
"oldNewFilesSeparator": " ",
|
||||||
|
"oldNewSeparator": ",",
|
||||||
|
"outputDir": "",
|
||||||
|
"outputRenamedFilesAsDeletedAndAdded": "false",
|
||||||
|
"path": ".",
|
||||||
|
"quotepath": "false",
|
||||||
|
"recoverDeletedFiles": "false",
|
||||||
|
"recoverDeletedFilesToDestination": "",
|
||||||
|
"recoverFiles": "",
|
||||||
|
"recoverFilesIgnore": "",
|
||||||
|
"recoverFilesIgnoreSeparator": "
|
||||||
|
",
|
||||||
|
"recoverFilesSeparator": "
|
||||||
|
",
|
||||||
|
"safeOutput": "false",
|
||||||
|
"separator": "",
|
||||||
|
"sha": "",
|
||||||
|
"since": "",
|
||||||
|
"sinceLastRemoteCommit": "false",
|
||||||
|
"skipInitialFetch": "true",
|
||||||
|
"tagsIgnorePattern": "",
|
||||||
|
"tagsPattern": "*",
|
||||||
|
"token": "",
|
||||||
|
"until": "",
|
||||||
|
"usePosixPathSeparator": "false",
|
||||||
|
"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,
|
||||||
|
"excludeSubmodules": 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,
|
||||||
|
"tagsIgnorePattern": "",
|
||||||
|
"tagsPattern": "",
|
||||||
|
"token": "",
|
||||||
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
|
"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,
|
||||||
|
"excludeSubmodules": 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,
|
||||||
|
"tagsIgnorePattern": "",
|
||||||
|
"tagsPattern": "",
|
||||||
|
"token": "token",
|
||||||
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
|
"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,
|
||||||
|
"excludeSubmodules": 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,
|
||||||
|
"tagsIgnorePattern": "",
|
||||||
|
"tagsPattern": "",
|
||||||
|
"token": "",
|
||||||
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
|
"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,
|
||||||
|
"excludeSubmodules": 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,
|
||||||
|
"tagsIgnorePattern": "",
|
||||||
|
"tagsPattern": "",
|
||||||
|
"token": "",
|
||||||
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
|
"useRestApi": false,
|
||||||
|
"writeOutputFiles": false,
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`getInputs should return default values when no inputs are provided 1`] = `
|
||||||
|
{
|
||||||
|
"apiUrl": "",
|
||||||
|
"baseSha": "",
|
||||||
|
"diffRelative": true,
|
||||||
|
"dirNames": false,
|
||||||
|
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
|
||||||
|
"dirNamesExcludeCurrentDir": false,
|
||||||
|
"dirNamesIncludeFiles": "",
|
||||||
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": false,
|
||||||
|
"failOnInitialDiffError": false,
|
||||||
|
"failOnSubmoduleDiffError": false,
|
||||||
|
"fetchAdditionalSubmoduleHistory": false,
|
||||||
|
"fetchMissingHistoryMaxRetries": 20,
|
||||||
|
"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,
|
||||||
|
"tagsIgnorePattern": "",
|
||||||
|
"tagsPattern": "*",
|
||||||
|
"token": "",
|
||||||
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
|
"useRestApi": false,
|
||||||
|
"writeOutputFiles": false,
|
||||||
|
}
|
||||||
|
`;
|
||||||
153
src/__tests__/inputs.test.ts
Normal file
153
src/__tests__/inputs.test.ts
Normal 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.getInput 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.getInput 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()
|
||||||
|
})
|
||||||
|
})
|
||||||
@ -1,18 +1,17 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {promises as fs} from 'fs'
|
import * as exec from '@actions/exec'
|
||||||
import path from 'path'
|
|
||||||
import {ChangeTypeEnum} from '../changedFiles'
|
import {ChangeTypeEnum} from '../changedFiles'
|
||||||
import {Inputs} from '../inputs'
|
import {Inputs} from '../inputs'
|
||||||
import {
|
import {
|
||||||
getDirname,
|
getDirname,
|
||||||
getDirnameMaxDepth,
|
getDirnameMaxDepth,
|
||||||
getFilteredChangedFiles,
|
getFilteredChangedFiles,
|
||||||
|
getPreviousGitTag,
|
||||||
normalizeSeparators,
|
normalizeSeparators,
|
||||||
warnUnsupportedRESTAPIInputs
|
warnUnsupportedRESTAPIInputs
|
||||||
} from '../utils'
|
} from '../utils'
|
||||||
|
|
||||||
const originalPlatform = process.platform
|
const originalPlatform = process.platform
|
||||||
const ACTION_PATH = path.resolve(__dirname, '..', '..', 'action.yml')
|
|
||||||
|
|
||||||
function mockedPlatform(platform: string): void {
|
function mockedPlatform(platform: string): void {
|
||||||
Object.defineProperty(process, 'platform', {
|
Object.defineProperty(process, 'platform', {
|
||||||
@ -638,103 +637,125 @@ describe('utils test', () => {
|
|||||||
failOnInitialDiffError: false,
|
failOnInitialDiffError: false,
|
||||||
failOnSubmoduleDiffError: false,
|
failOnSubmoduleDiffError: false,
|
||||||
negationPatternsFirst: false,
|
negationPatternsFirst: false,
|
||||||
useRestApi: false
|
useRestApi: false,
|
||||||
|
excludeSubmodules: false,
|
||||||
|
fetchMissingHistoryMaxRetries: 20,
|
||||||
|
usePosixPathSeparator: false,
|
||||||
|
tagsPattern: '*',
|
||||||
|
tagsIgnorePattern: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const coreWarningSpy = jest.spyOn(core, 'warning')
|
const coreWarningSpy = jest.spyOn(core, 'warning')
|
||||||
|
|
||||||
await warnUnsupportedRESTAPIInputs({
|
await warnUnsupportedRESTAPIInputs({
|
||||||
actionPath: ACTION_PATH,
|
|
||||||
inputs
|
inputs
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(coreWarningSpy).toHaveBeenCalledWith(
|
expect(coreWarningSpy).toHaveBeenCalledWith(
|
||||||
'Input "sha" is not supported when using GitHub\'s REST API to get changed files'
|
'Input "sha" is not supported when using GitHub\'s REST API to get changed files'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
expect(coreWarningSpy).toHaveBeenCalledTimes(1)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
describe('getPreviousGitTag', () => {
|
||||||
|
// Check if the environment variable GITHUB_REPOSITORY_OWNER is 'tj-actions'
|
||||||
|
const shouldSkip = !!process.env.GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FORK
|
||||||
|
// Function returns the second-latest tag and its SHA
|
||||||
|
it('should return the second latest tag and its SHA when multiple tags are present', async () => {
|
||||||
|
if (shouldSkip) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const result = await getPreviousGitTag({
|
||||||
|
cwd: '.',
|
||||||
|
tagsPattern: '*',
|
||||||
|
tagsIgnorePattern: '',
|
||||||
|
currentBranch: 'v1.0.1'
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
tag: 'v1.0.0',
|
||||||
|
sha: 'f0751de6af436d4e79016e2041cf6400e0833653'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// Tags are filtered by a specified pattern when 'tagsPattern' is provided
|
||||||
|
it('should filter tags by the specified pattern', async () => {
|
||||||
|
if (shouldSkip) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const result = await getPreviousGitTag({
|
||||||
|
cwd: '.',
|
||||||
|
tagsPattern: 'v1.*',
|
||||||
|
tagsIgnorePattern: '',
|
||||||
|
currentBranch: 'v1.0.1'
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
tag: 'v1.0.0',
|
||||||
|
sha: 'f0751de6af436d4e79016e2041cf6400e0833653'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// Tags are excluded by a specified ignore pattern when 'tagsIgnorePattern' is provided
|
||||||
|
it('should exclude tags by the specified ignore pattern', async () => {
|
||||||
|
if (shouldSkip) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const result = await getPreviousGitTag({
|
||||||
|
cwd: '.',
|
||||||
|
tagsPattern: '*',
|
||||||
|
tagsIgnorePattern: 'v0.*.*',
|
||||||
|
currentBranch: 'v1.0.1'
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
tag: 'v1.0.0',
|
||||||
|
sha: 'f0751de6af436d4e79016e2041cf6400e0833653'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Throws an error if there are YAML errors in the action file.
|
// No tags are available in the repository
|
||||||
it('should throw an error if there are YAML errors in the action file', async () => {
|
it('should return empty values when no tags are available in the repository', async () => {
|
||||||
const actionPath = './path/to/action.yml'
|
jest.spyOn(exec, 'getExecOutput').mockResolvedValueOnce({
|
||||||
const inputs: Inputs = {
|
stdout: '',
|
||||||
files: '',
|
stderr: '',
|
||||||
filesSeparator: '\n',
|
exitCode: 0
|
||||||
filesFromSourceFile: '',
|
})
|
||||||
filesFromSourceFileSeparator: '\n',
|
const result = await getPreviousGitTag({
|
||||||
filesYaml: '',
|
cwd: '.',
|
||||||
filesYamlFromSourceFile: '',
|
tagsPattern: '*',
|
||||||
filesYamlFromSourceFileSeparator: '\n',
|
tagsIgnorePattern: '',
|
||||||
filesIgnore: '',
|
currentBranch: ''
|
||||||
filesIgnoreSeparator: '\n',
|
})
|
||||||
filesIgnoreFromSourceFile: '',
|
expect(result).toEqual({tag: '', sha: ''})
|
||||||
filesIgnoreFromSourceFileSeparator: '\n',
|
})
|
||||||
filesIgnoreYaml: '',
|
|
||||||
filesIgnoreYamlFromSourceFile: '',
|
|
||||||
filesIgnoreYamlFromSourceFileSeparator: '\n',
|
|
||||||
separator: ' ',
|
|
||||||
includeAllOldNewRenamedFiles: false,
|
|
||||||
oldNewSeparator: ',',
|
|
||||||
oldNewFilesSeparator: ' ',
|
|
||||||
sha: '1313123',
|
|
||||||
baseSha: '',
|
|
||||||
since: '',
|
|
||||||
until: '',
|
|
||||||
path: '.',
|
|
||||||
quotepath: true,
|
|
||||||
diffRelative: true,
|
|
||||||
dirNames: false,
|
|
||||||
dirNamesMaxDepth: undefined,
|
|
||||||
dirNamesExcludeCurrentDir: false,
|
|
||||||
dirNamesIncludeFiles: '',
|
|
||||||
dirNamesIncludeFilesSeparator: '\n',
|
|
||||||
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false,
|
|
||||||
json: false,
|
|
||||||
escapeJson: true,
|
|
||||||
safeOutput: true,
|
|
||||||
fetchDepth: 50,
|
|
||||||
fetchAdditionalSubmoduleHistory: false,
|
|
||||||
sinceLastRemoteCommit: false,
|
|
||||||
writeOutputFiles: false,
|
|
||||||
outputDir: '.github/outputs',
|
|
||||||
outputRenamedFilesAsDeletedAndAdded: false,
|
|
||||||
recoverDeletedFiles: false,
|
|
||||||
recoverDeletedFilesToDestination: '',
|
|
||||||
recoverFiles: '',
|
|
||||||
recoverFilesSeparator: '\n',
|
|
||||||
recoverFilesIgnore: '',
|
|
||||||
recoverFilesIgnoreSeparator: '\n',
|
|
||||||
token: '${{ github.token }}',
|
|
||||||
apiUrl: '${{ github.api_url }}',
|
|
||||||
skipInitialFetch: false,
|
|
||||||
failOnInitialDiffError: false,
|
|
||||||
failOnSubmoduleDiffError: false,
|
|
||||||
negationPatternsFirst: false,
|
|
||||||
useRestApi: false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mocking readFile to return action file contents with errors
|
// Only one tag is available, making it impossible to find a previous tag
|
||||||
jest.spyOn(fs, 'readFile').mockResolvedValue(`
|
it('should return empty values when only one tag is available', async () => {
|
||||||
inputs:
|
jest.spyOn(exec, 'getExecOutput').mockResolvedValueOnce({
|
||||||
files:
|
stdout:
|
||||||
description: Files
|
'v1.0.1|f0751de6af436d4e79016e2041cf6400e0833653|2021-01-01T00:00:00Z',
|
||||||
required: true
|
stderr: '',
|
||||||
default: ""
|
exitCode: 0
|
||||||
sha:
|
})
|
||||||
description: SHA
|
const result = await getPreviousGitTag({
|
||||||
required: true
|
cwd: '.',
|
||||||
default: abc123
|
tagsPattern: '*',
|
||||||
token:
|
tagsIgnorePattern: '',
|
||||||
description: Token
|
currentBranch: 'v1.0.1'
|
||||||
required: true
|
})
|
||||||
default: my-token
|
expect(result).toEqual({tag: '', sha: ''})
|
||||||
warnings:
|
})
|
||||||
| Invalid input value`)
|
|
||||||
|
|
||||||
|
// Git commands fail and throw errors
|
||||||
|
it('should throw an error when git commands fail', async () => {
|
||||||
|
jest
|
||||||
|
.spyOn(exec, 'getExecOutput')
|
||||||
|
.mockRejectedValue(new Error('git command failed'))
|
||||||
await expect(
|
await expect(
|
||||||
warnUnsupportedRESTAPIInputs({actionPath, inputs})
|
getPreviousGitTag({
|
||||||
).rejects.toThrow(
|
cwd: '.',
|
||||||
/YAML errors in .\/path\/to\/action.yml: YAMLParseError: Not a YAML token: Invalid input value at line 16, column 13:/
|
tagsPattern: '*',
|
||||||
)
|
tagsIgnorePattern: '',
|
||||||
|
currentBranch: 'v1.0.1'
|
||||||
|
})
|
||||||
|
).rejects.toThrow('git command failed')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import * as core from '@actions/core'
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import type {RestEndpointMethodTypes} from '@octokit/rest'
|
import type {RestEndpointMethodTypes} from '@octokit/rest'
|
||||||
import flatten from 'lodash/flatten'
|
import flatten from 'lodash/flatten'
|
||||||
|
import convertPath from '@stdlib/utils-convert-path'
|
||||||
import mm from 'micromatch'
|
import mm from 'micromatch'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import {setOutputsAndGetModifiedAndChangedFilesStatus} from './changedFilesOutput'
|
import {setOutputsAndGetModifiedAndChangedFilesStatus} from './changedFilesOutput'
|
||||||
@ -121,13 +122,13 @@ export const processChangedFiles = async ({
|
|||||||
export const getRenamedFiles = async ({
|
export const getRenamedFiles = async ({
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
hasSubmodule: boolean
|
diffSubmodule: boolean
|
||||||
diffResult: DiffResult
|
diffResult: DiffResult
|
||||||
submodulePaths: string[]
|
submodulePaths: string[]
|
||||||
}): Promise<{paths: string; count: string}> => {
|
}): Promise<{paths: string; count: string}> => {
|
||||||
@ -139,7 +140,7 @@ export const getRenamedFiles = async ({
|
|||||||
oldNewSeparator: inputs.oldNewSeparator
|
oldNewSeparator: inputs.oldNewSeparator
|
||||||
})
|
})
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
for (const submodulePath of submodulePaths) {
|
for (const submodulePath of submodulePaths) {
|
||||||
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
@ -217,7 +218,7 @@ export type ChangedFiles = {
|
|||||||
|
|
||||||
export const getAllDiffFiles = async ({
|
export const getAllDiffFiles = async ({
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths,
|
submodulePaths,
|
||||||
outputRenamedFilesAsDeletedAndAdded,
|
outputRenamedFilesAsDeletedAndAdded,
|
||||||
@ -226,7 +227,7 @@ export const getAllDiffFiles = async ({
|
|||||||
failOnSubmoduleDiffError
|
failOnSubmoduleDiffError
|
||||||
}: {
|
}: {
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
hasSubmodule: boolean
|
diffSubmodule: boolean
|
||||||
diffResult: DiffResult
|
diffResult: DiffResult
|
||||||
submodulePaths: string[]
|
submodulePaths: string[]
|
||||||
outputRenamedFilesAsDeletedAndAdded: boolean
|
outputRenamedFilesAsDeletedAndAdded: boolean
|
||||||
@ -243,7 +244,7 @@ export const getAllDiffFiles = async ({
|
|||||||
failOnInitialDiffError
|
failOnInitialDiffError
|
||||||
})
|
})
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
for (const submodulePath of submodulePaths) {
|
for (const submodulePath of submodulePaths) {
|
||||||
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
@ -355,9 +356,13 @@ function* getChangeTypeFilesGenerator({
|
|||||||
filePaths,
|
filePaths,
|
||||||
dirNamesIncludeFilePatterns
|
dirNamesIncludeFilePatterns
|
||||||
})) {
|
})) {
|
||||||
|
if (isWindows() && inputs.usePosixPathSeparator) {
|
||||||
|
yield convertPath(filePath, 'mixed')
|
||||||
|
} else {
|
||||||
yield filePath
|
yield filePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getChangeTypeFiles = async ({
|
export const getChangeTypeFiles = async ({
|
||||||
@ -402,8 +407,12 @@ function* getAllChangeTypeFilesGenerator({
|
|||||||
filePaths,
|
filePaths,
|
||||||
dirNamesIncludeFilePatterns
|
dirNamesIncludeFilePatterns
|
||||||
})) {
|
})) {
|
||||||
|
if (isWindows() && inputs.usePosixPathSeparator) {
|
||||||
|
yield convertPath(filePath, 'mixed')
|
||||||
|
} else {
|
||||||
yield filePath
|
yield filePath
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getAllChangeTypeFiles = async ({
|
export const getAllChangeTypeFiles = async ({
|
||||||
@ -475,7 +484,7 @@ export const getChangedFilesFromGithubAPI = async ({
|
|||||||
|
|
||||||
if (changeType === ChangeTypeEnum.Renamed) {
|
if (changeType === ChangeTypeEnum.Renamed) {
|
||||||
if (inputs.outputRenamedFilesAsDeletedAndAdded) {
|
if (inputs.outputRenamedFilesAsDeletedAndAdded) {
|
||||||
changedFiles[ChangeTypeEnum.Deleted].push(item.filename)
|
changedFiles[ChangeTypeEnum.Deleted].push(item.previous_filename || '')
|
||||||
changedFiles[ChangeTypeEnum.Added].push(item.filename)
|
changedFiles[ChangeTypeEnum.Added].push(item.filename)
|
||||||
} else {
|
} else {
|
||||||
changedFiles[ChangeTypeEnum.Renamed].push(item.filename)
|
changedFiles[ChangeTypeEnum.Renamed].push(item.filename)
|
||||||
|
|||||||
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
115
src/commitSha.ts
115
src/commitSha.ts
@ -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,
|
diffSubmodule: boolean
|
||||||
gitFetchExtraArgs: string[],
|
gitFetchExtraArgs: string[]
|
||||||
isTag: boolean
|
isTag: boolean
|
||||||
): Promise<DiffResult> => {
|
remoteName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSHAForNonPullRequestEvent = async ({
|
||||||
|
inputs,
|
||||||
|
env,
|
||||||
|
workingDirectory,
|
||||||
|
isShallow,
|
||||||
|
diffSubmodule,
|
||||||
|
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,13 +146,13 @@ 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}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@ -152,7 +164,7 @@ export const getSHAForNonPullRequestEvent = async (
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
if (diffSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@ -228,7 +240,12 @@ export const getSHAForNonPullRequestEvent = async (
|
|||||||
}
|
}
|
||||||
} else if (isTag) {
|
} else if (isTag) {
|
||||||
core.debug('Getting previous SHA for tag...')
|
core.debug('Getting previous SHA for tag...')
|
||||||
const {sha, tag} = await getPreviousGitTag({cwd: workingDirectory})
|
const {sha, tag} = await getPreviousGitTag({
|
||||||
|
cwd: workingDirectory,
|
||||||
|
tagsPattern: inputs.tagsPattern,
|
||||||
|
tagsIgnorePattern: inputs.tagsIgnorePattern,
|
||||||
|
currentBranch
|
||||||
|
})
|
||||||
previousSha = sha
|
previousSha = sha
|
||||||
targetBranch = tag
|
targetBranch = tag
|
||||||
} else {
|
} else {
|
||||||
@ -307,14 +324,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,
|
diffSubmodule: boolean
|
||||||
hasSubmodule: boolean,
|
|
||||||
gitFetchExtraArgs: string[]
|
gitFetchExtraArgs: string[]
|
||||||
): Promise<DiffResult> => {
|
remoteName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSHAForPullRequestEvent = async ({
|
||||||
|
inputs,
|
||||||
|
workingDirectory,
|
||||||
|
isShallow,
|
||||||
|
diffSubmodule,
|
||||||
|
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 +356,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 +369,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}*`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -354,8 +380,6 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
'Failed to fetch pull request branch. Please ensure "persist-credentials" is set to "true" when checking out the repository. See: https://github.com/actions/checkout#usage'
|
'Failed to fetch pull request branch. Please ensure "persist-credentials" is set to "true" when checking out the repository. See: https://github.com/actions/checkout#usage'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inputs.sinceLastRemoteCommit) {
|
|
||||||
core.debug('Fetching target branch...')
|
core.debug('Fetching target branch...')
|
||||||
await gitFetch({
|
await gitFetch({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
@ -364,12 +388,12 @@ 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/${github.context.payload.pull_request?.base?.ref}:refs/remotes/${remoteName}/${github.context.payload.pull_request?.base?.ref}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@ -380,9 +404,8 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
if (diffSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@ -427,10 +450,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 +507,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 {
|
|
||||||
previousSha = await getRemoteBranchHeadSha({
|
|
||||||
cwd: workingDirectory,
|
|
||||||
branch: targetBranch
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!previousSha) {
|
if (!previousSha) {
|
||||||
previousSha = github.context.payload.pull_request?.base?.sha
|
previousSha = await getRemoteBranchHeadSha({
|
||||||
}
|
cwd: workingDirectory,
|
||||||
|
remoteName,
|
||||||
|
branch: targetBranch
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isShallow) {
|
if (isShallow) {
|
||||||
@ -513,7 +530,11 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
'Merge base is not in the local history, fetching remote target branch...'
|
'Merge base is not in the local history, fetching remote target branch...'
|
||||||
)
|
)
|
||||||
|
|
||||||
for (let i = 1; i <= 10; i++) {
|
for (
|
||||||
|
let i = 1;
|
||||||
|
i <= (inputs.fetchMissingHistoryMaxRetries || 10);
|
||||||
|
i++
|
||||||
|
) {
|
||||||
await gitFetch({
|
await gitFetch({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@ -521,8 +542,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}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -1,24 +1,29 @@
|
|||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
|
|
||||||
export const UNSUPPORTED_REST_API_INPUTS: (keyof Inputs)[] = [
|
export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
|
||||||
'sha',
|
sha: '',
|
||||||
'baseSha',
|
baseSha: '',
|
||||||
'since',
|
since: '',
|
||||||
'until',
|
until: '',
|
||||||
'path',
|
path: '.',
|
||||||
'quotepath',
|
quotepath: true,
|
||||||
'diffRelative',
|
diffRelative: true,
|
||||||
'sinceLastRemoteCommit',
|
sinceLastRemoteCommit: false,
|
||||||
'recoverDeletedFiles',
|
recoverDeletedFiles: false,
|
||||||
'recoverDeletedFilesToDestination',
|
recoverDeletedFilesToDestination: '',
|
||||||
'recoverFiles',
|
recoverFiles: '',
|
||||||
'recoverFilesSeparator',
|
recoverFilesSeparator: '\n',
|
||||||
'recoverFilesIgnore',
|
recoverFilesIgnore: '',
|
||||||
'recoverFilesIgnoreSeparator',
|
recoverFilesIgnoreSeparator: '\n',
|
||||||
'includeAllOldNewRenamedFiles',
|
includeAllOldNewRenamedFiles: false,
|
||||||
'oldNewSeparator',
|
oldNewSeparator: ',',
|
||||||
'oldNewFilesSeparator',
|
oldNewFilesSeparator: ' ',
|
||||||
'skipInitialFetch',
|
skipInitialFetch: false,
|
||||||
'fetchAdditionalSubmoduleHistory',
|
fetchAdditionalSubmoduleHistory: false,
|
||||||
'dirNamesDeletedFilesIncludeOnlyDeletedDirs'
|
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false,
|
||||||
]
|
excludeSubmodules: false,
|
||||||
|
fetchMissingHistoryMaxRetries: 20,
|
||||||
|
usePosixPathSeparator: false,
|
||||||
|
tagsPattern: '*',
|
||||||
|
tagsIgnorePattern: ''
|
||||||
|
}
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
import * as core from '@actions/core'
|
|
||||||
|
|
||||||
export type Env = {
|
export type Env = {
|
||||||
GITHUB_REF_NAME: string
|
GITHUB_REF_NAME: string
|
||||||
GITHUB_REF: string
|
GITHUB_REF: string
|
||||||
GITHUB_WORKSPACE: string
|
GITHUB_WORKSPACE: string
|
||||||
}
|
}
|
||||||
export const getEnv = async (): Promise<Env> => {
|
|
||||||
core.debug(`Process Env: ${JSON.stringify(process.env, null, 2)}`)
|
|
||||||
|
|
||||||
|
export const getEnv = async (): Promise<Env> => {
|
||||||
return {
|
return {
|
||||||
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
|
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
|
||||||
GITHUB_REF: process.env.GITHUB_REF || '',
|
GITHUB_REF: process.env.GITHUB_REF || '',
|
||||||
|
|||||||
@ -54,6 +54,11 @@ export type Inputs = {
|
|||||||
failOnSubmoduleDiffError: boolean
|
failOnSubmoduleDiffError: boolean
|
||||||
negationPatternsFirst: boolean
|
negationPatternsFirst: boolean
|
||||||
useRestApi: boolean
|
useRestApi: boolean
|
||||||
|
excludeSubmodules: boolean
|
||||||
|
fetchMissingHistoryMaxRetries?: number
|
||||||
|
usePosixPathSeparator: boolean
|
||||||
|
tagsPattern: string
|
||||||
|
tagsIgnorePattern?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getInputs = (): Inputs => {
|
export const getInputs = (): Inputs => {
|
||||||
@ -154,8 +159,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(
|
||||||
@ -233,6 +245,31 @@ export const getInputs = (): Inputs => {
|
|||||||
required: false
|
required: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const excludeSubmodules = core.getBooleanInput('exclude_submodules', {
|
||||||
|
required: false
|
||||||
|
})
|
||||||
|
|
||||||
|
const fetchMissingHistoryMaxRetries = core.getInput(
|
||||||
|
'fetch_missing_history_max_retries',
|
||||||
|
{required: false}
|
||||||
|
)
|
||||||
|
|
||||||
|
const usePosixPathSeparator = core.getBooleanInput(
|
||||||
|
'use_posix_path_separator',
|
||||||
|
{
|
||||||
|
required: false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const tagsPattern = core.getInput('tags_pattern', {
|
||||||
|
required: false,
|
||||||
|
trimWhitespace: false
|
||||||
|
})
|
||||||
|
const tagsIgnorePattern = core.getInput('tags_ignore_pattern', {
|
||||||
|
required: false,
|
||||||
|
trimWhitespace: false
|
||||||
|
})
|
||||||
|
|
||||||
const inputs: Inputs = {
|
const inputs: Inputs = {
|
||||||
files,
|
files,
|
||||||
filesSeparator,
|
filesSeparator,
|
||||||
@ -272,6 +309,10 @@ export const getInputs = (): Inputs => {
|
|||||||
skipInitialFetch,
|
skipInitialFetch,
|
||||||
fetchAdditionalSubmoduleHistory,
|
fetchAdditionalSubmoduleHistory,
|
||||||
dirNamesDeletedFilesIncludeOnlyDeletedDirs,
|
dirNamesDeletedFilesIncludeOnlyDeletedDirs,
|
||||||
|
excludeSubmodules,
|
||||||
|
usePosixPathSeparator,
|
||||||
|
tagsPattern,
|
||||||
|
tagsIgnorePattern,
|
||||||
// End Not Supported via REST API
|
// End Not Supported via REST API
|
||||||
dirNames,
|
dirNames,
|
||||||
dirNamesExcludeCurrentDir,
|
dirNamesExcludeCurrentDir,
|
||||||
@ -290,6 +331,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)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,5 +339,13 @@ export const getInputs = (): Inputs => {
|
|||||||
inputs.dirNamesMaxDepth = parseInt(dirNamesMaxDepth, 10)
|
inputs.dirNamesMaxDepth = parseInt(dirNamesMaxDepth, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fetchMissingHistoryMaxRetries) {
|
||||||
|
// Fallback to at least 1 if the fetch_missing_history_max_retries is less than 1
|
||||||
|
inputs.fetchMissingHistoryMaxRetries = Math.max(
|
||||||
|
parseInt(fetchMissingHistoryMaxRetries, 10),
|
||||||
|
1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return inputs
|
return inputs
|
||||||
}
|
}
|
||||||
|
|||||||
64
src/main.ts
64
src/main.ts
@ -64,14 +64,26 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isShallow = await isRepoShallow({cwd: workingDirectory})
|
const isShallow = await isRepoShallow({cwd: workingDirectory})
|
||||||
const hasSubmodule = await submoduleExists({cwd: workingDirectory})
|
let diffSubmodule = false
|
||||||
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
|
let gitFetchExtraArgs = ['--no-tags', '--prune']
|
||||||
|
|
||||||
|
if (inputs.excludeSubmodules) {
|
||||||
|
core.info('Excluding submodules from the diff')
|
||||||
|
} else {
|
||||||
|
diffSubmodule = await submoduleExists({cwd: workingDirectory})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diffSubmodule) {
|
||||||
|
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[] = []
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
submodulePaths = await getSubmodulePath({cwd: workingDirectory})
|
submodulePaths = await getSubmodulePath({cwd: workingDirectory})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,29 +95,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,
|
diffSubmodule,
|
||||||
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,
|
diffSubmodule,
|
||||||
gitFetchExtraArgs
|
gitFetchExtraArgs,
|
||||||
)
|
remoteName
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (diffResult.initialCommit) {
|
if (diffResult.initialCommit) {
|
||||||
@ -120,7 +133,7 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
|
|
||||||
const allDiffFiles = await getAllDiffFiles({
|
const allDiffFiles = await getAllDiffFiles({
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths,
|
submodulePaths,
|
||||||
outputRenamedFilesAsDeletedAndAdded,
|
outputRenamedFilesAsDeletedAndAdded,
|
||||||
@ -146,7 +159,7 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
deletedFiles: allDiffFiles[ChangeTypeEnum.Deleted],
|
deletedFiles: allDiffFiles[ChangeTypeEnum.Deleted],
|
||||||
recoverPatterns,
|
recoverPatterns,
|
||||||
diffResult,
|
diffResult,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -164,7 +177,7 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
const allOldNewRenamedFiles = await getRenamedFiles({
|
const allOldNewRenamedFiles = await getRenamedFiles({
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
})
|
})
|
||||||
@ -221,8 +234,6 @@ export async function run(): Promise<void> {
|
|||||||
const inputs = getInputs()
|
const inputs = getInputs()
|
||||||
core.debug(`Inputs: ${JSON.stringify(inputs, null, 2)}`)
|
core.debug(`Inputs: ${JSON.stringify(inputs, null, 2)}`)
|
||||||
|
|
||||||
core.debug(`Github Context: ${JSON.stringify(github.context, null, 2)}`)
|
|
||||||
|
|
||||||
const workingDirectory = path.resolve(
|
const workingDirectory = path.resolve(
|
||||||
env.GITHUB_WORKSPACE || process.cwd(),
|
env.GITHUB_WORKSPACE || process.cwd(),
|
||||||
inputs.useRestApi ? '.' : inputs.path
|
inputs.useRestApi ? '.' : inputs.path
|
||||||
@ -256,12 +267,7 @@ export async function run(): Promise<void> {
|
|||||||
(!hasGitDirectory || inputs.useRestApi)
|
(!hasGitDirectory || inputs.useRestApi)
|
||||||
) {
|
) {
|
||||||
core.info("Using GitHub's REST API to get changed files")
|
core.info("Using GitHub's REST API to get changed files")
|
||||||
if (process.env.GITHUB_ACTION_PATH) {
|
await warnUnsupportedRESTAPIInputs({inputs})
|
||||||
await warnUnsupportedRESTAPIInputs({
|
|
||||||
actionPath: path.join(process.env.GITHUB_ACTION_PATH, 'action.yml'),
|
|
||||||
inputs
|
|
||||||
})
|
|
||||||
}
|
|
||||||
await getChangedFilesFromRESTAPI({
|
await getChangedFilesFromRESTAPI({
|
||||||
inputs,
|
inputs,
|
||||||
filePatterns,
|
filePatterns,
|
||||||
@ -269,9 +275,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}".`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,11 +291,8 @@ export async function run(): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* istanbul ignore if */
|
// eslint-disable-next-line github/no-then
|
||||||
if (!process.env.TESTING) {
|
run().catch(e => {
|
||||||
// eslint-disable-next-line github/no-then
|
|
||||||
run().catch(e => {
|
|
||||||
core.setFailed(e.message || e)
|
core.setFailed(e.message || e)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|||||||
194
src/utils.ts
194
src/utils.ts
@ -10,7 +10,7 @@ import {createInterface} from 'readline'
|
|||||||
import {parseDocument} from 'yaml'
|
import {parseDocument} from 'yaml'
|
||||||
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
|
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
|
||||||
import {DiffResult} from './commitSha'
|
import {DiffResult} from './commitSha'
|
||||||
import {UNSUPPORTED_REST_API_INPUTS} from './constant'
|
import {DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS} from './constant'
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
|
|
||||||
const MINIMUM_GIT_VERSION = '2.18.0'
|
const MINIMUM_GIT_VERSION = '2.18.0'
|
||||||
@ -32,11 +32,13 @@ export const normalizeSeparators = (p: string): string => {
|
|||||||
|
|
||||||
// Remove redundant slashes
|
// Remove redundant slashes
|
||||||
const isUnc = /^\\\\+[^\\]/.test(p) // e.g. \\hello
|
const isUnc = /^\\\\+[^\\]/.test(p) // e.g. \\hello
|
||||||
return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\') // preserve leading \\ for UNC
|
p = (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\') // preserve leading \\ for UNC
|
||||||
|
} else {
|
||||||
|
// Remove redundant slashes on Linux/macOS
|
||||||
|
p = p.replace(/\/\/+/g, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove redundant slashes
|
return p
|
||||||
return p.replace(/\/\/+/g, '/')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,15 +173,16 @@ async function* lineOfFileGenerator({
|
|||||||
input: fileStream,
|
input: fileStream,
|
||||||
crlfDelay: Infinity
|
crlfDelay: Infinity
|
||||||
})
|
})
|
||||||
for await (const line of rl) {
|
for await (let line of rl) {
|
||||||
if (!line.startsWith('#') && line !== '') {
|
if (!line.startsWith('#') && line !== '') {
|
||||||
if (excludedFiles) {
|
if (excludedFiles) {
|
||||||
if (line.startsWith('!')) {
|
line = line.startsWith('!') ? line : `!${line}`
|
||||||
|
if (line.endsWith(path.sep)) {
|
||||||
|
line = `${line}**`
|
||||||
|
}
|
||||||
yield line
|
yield line
|
||||||
} else {
|
} else {
|
||||||
yield `!${line}`
|
line = line.endsWith(path.sep) ? `${line}**` : line
|
||||||
}
|
|
||||||
} else {
|
|
||||||
yield line
|
yield line
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -684,14 +687,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()
|
||||||
@ -826,41 +831,80 @@ export const cleanShaInput = async ({
|
|||||||
|
|
||||||
return stdout.trim()
|
return stdout.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getPreviousGitTag = async ({
|
export const getPreviousGitTag = async ({
|
||||||
cwd
|
cwd,
|
||||||
|
tagsPattern,
|
||||||
|
currentBranch,
|
||||||
|
tagsIgnorePattern
|
||||||
}: {
|
}: {
|
||||||
cwd: string
|
cwd: string
|
||||||
|
tagsPattern: string
|
||||||
|
currentBranch: string
|
||||||
|
tagsIgnorePattern?: string
|
||||||
}): Promise<{tag: string; sha: string}> => {
|
}): Promise<{tag: string; sha: string}> => {
|
||||||
|
const ignorePatterns: string[] = []
|
||||||
|
let currentShaDate: Date | null = null
|
||||||
|
|
||||||
const {stdout} = await exec.getExecOutput(
|
const {stdout} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['tag', '--sort=-creatordate'],
|
[
|
||||||
|
'tag',
|
||||||
|
'--sort=-creatordate',
|
||||||
|
'--format=%(refname:short)|%(objectname)|%(creatordate:iso)'
|
||||||
|
],
|
||||||
{
|
{
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (tagsIgnorePattern) {
|
||||||
|
ignorePatterns.push(tagsIgnorePattern)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentBranch) {
|
||||||
|
ignorePatterns.push(currentBranch)
|
||||||
|
try {
|
||||||
|
const {stdout: currentShaDateOutput} = await exec.getExecOutput(
|
||||||
|
'git',
|
||||||
|
['show', '-s', '--format=%ai', currentBranch],
|
||||||
|
{
|
||||||
|
cwd,
|
||||||
|
silent: !core.isDebug()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
currentShaDate = new Date(currentShaDateOutput.trim())
|
||||||
|
} catch (error) {
|
||||||
|
// Handle the case where the current branch doesn't exist
|
||||||
|
// This might happen in detached head state
|
||||||
|
core.warning(`Failed to get date for current branch ${currentBranch}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const previousTag: {tag: string; sha: string} = {tag: '', sha: ''}
|
||||||
|
|
||||||
const tags = stdout.trim().split('\n')
|
const tags = stdout.trim().split('\n')
|
||||||
|
for (const tagData of tags) {
|
||||||
|
const [tag, sha, dateString] = tagData.split('|')
|
||||||
|
if (!mm.isMatch(tag, tagsPattern) || mm.isMatch(tag, ignorePatterns)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const date = new Date(dateString)
|
||||||
|
if (currentShaDate && date >= currentShaDate) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// Found a suitable tag, no need to continue
|
||||||
|
previousTag.tag = tag
|
||||||
|
previousTag.sha = sha
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
if (tags.length < 2) {
|
if (!previousTag.tag) {
|
||||||
core.warning('No previous tag found')
|
core.warning('No previous tag found')
|
||||||
return {tag: '', sha: ''}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousTag = tags[1]
|
return previousTag
|
||||||
|
|
||||||
const {stdout: stdout2} = await exec.getExecOutput(
|
|
||||||
'git',
|
|
||||||
['rev-parse', previousTag],
|
|
||||||
{
|
|
||||||
cwd,
|
|
||||||
silent: !core.isDebug()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
const sha = stdout2.trim()
|
|
||||||
|
|
||||||
return {tag: previousTag, sha}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const canDiffCommits = async ({
|
export const canDiffCommits = async ({
|
||||||
@ -901,7 +945,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,
|
||||||
@ -998,6 +1042,7 @@ export const getFilePatterns = async ({
|
|||||||
if (inputs.files) {
|
if (inputs.files) {
|
||||||
const filesPatterns = inputs.files
|
const filesPatterns = inputs.files
|
||||||
.split(inputs.filesSeparator)
|
.split(inputs.filesSeparator)
|
||||||
|
.map(p => (p.endsWith(path.sep) ? `${p}**` : p))
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
|
|
||||||
cleanedFilePatterns.push(...filesPatterns)
|
cleanedFilePatterns.push(...filesPatterns)
|
||||||
@ -1029,8 +1074,9 @@ export const getFilePatterns = async ({
|
|||||||
.split(inputs.filesIgnoreSeparator)
|
.split(inputs.filesIgnoreSeparator)
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.map(p => {
|
.map(p => {
|
||||||
if (!p.startsWith('!')) {
|
p = p.startsWith('!') ? p : `!${p}`
|
||||||
p = `!${p}`
|
if (p.endsWith(path.sep)) {
|
||||||
|
p = `${p}**`
|
||||||
}
|
}
|
||||||
return p
|
return p
|
||||||
})
|
})
|
||||||
@ -1212,16 +1258,11 @@ export const getYamlFilePatterns = async ({
|
|||||||
const newFilePatterns = await getYamlFilePatternsFromContents({filePath})
|
const newFilePatterns = await getYamlFilePatternsFromContents({filePath})
|
||||||
for (const key in newFilePatterns) {
|
for (const key in newFilePatterns) {
|
||||||
if (key in filePatterns) {
|
if (key in filePatterns) {
|
||||||
core.warning(
|
filePatterns[key] = [...filePatterns[key], ...newFilePatterns[key]]
|
||||||
`files_yaml_from_source_file: Duplicated key ${key} detected in ${filePath}, the ${filePatterns[key]} will be overwritten by ${newFilePatterns[key]}.`
|
} else {
|
||||||
)
|
filePatterns[key] = newFilePatterns[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filePatterns = {
|
|
||||||
...filePatterns,
|
|
||||||
...newFilePatterns
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1233,9 +1274,12 @@ export const getYamlFilePatterns = async ({
|
|||||||
|
|
||||||
for (const key in newIgnoreFilePatterns) {
|
for (const key in newIgnoreFilePatterns) {
|
||||||
if (key in filePatterns) {
|
if (key in filePatterns) {
|
||||||
core.warning(
|
filePatterns[key] = [
|
||||||
`files_ignore_yaml: Duplicated key ${key} detected, the ${filePatterns[key]} will be overwritten by ${newIgnoreFilePatterns[key]}.`
|
...filePatterns[key],
|
||||||
)
|
...newIgnoreFilePatterns[key]
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
filePatterns[key] = newIgnoreFilePatterns[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1259,16 +1303,14 @@ export const getYamlFilePatterns = async ({
|
|||||||
|
|
||||||
for (const key in newIgnoreFilePatterns) {
|
for (const key in newIgnoreFilePatterns) {
|
||||||
if (key in filePatterns) {
|
if (key in filePatterns) {
|
||||||
core.warning(
|
filePatterns[key] = [
|
||||||
`files_ignore_yaml_from_source_file: Duplicated key ${key} detected in ${filePath}, the ${filePatterns[key]} will be overwritten by ${newIgnoreFilePatterns[key]}.`
|
...filePatterns[key],
|
||||||
)
|
...newIgnoreFilePatterns[key]
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
filePatterns[key] = newIgnoreFilePatterns[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filePatterns = {
|
|
||||||
...filePatterns,
|
|
||||||
...newIgnoreFilePatterns
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1408,7 +1450,7 @@ export const recoverDeletedFiles = async ({
|
|||||||
deletedFiles,
|
deletedFiles,
|
||||||
recoverPatterns,
|
recoverPatterns,
|
||||||
diffResult,
|
diffResult,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
@ -1416,7 +1458,7 @@ export const recoverDeletedFiles = async ({
|
|||||||
deletedFiles: string[]
|
deletedFiles: string[]
|
||||||
recoverPatterns: string[]
|
recoverPatterns: string[]
|
||||||
diffResult: DiffResult
|
diffResult: DiffResult
|
||||||
hasSubmodule: boolean
|
diffSubmodule: boolean
|
||||||
submodulePaths: string[]
|
submodulePaths: string[]
|
||||||
}): Promise<void> => {
|
}): Promise<void> => {
|
||||||
let recoverableDeletedFiles = deletedFiles
|
let recoverableDeletedFiles = deletedFiles
|
||||||
@ -1446,7 +1488,7 @@ export const recoverDeletedFiles = async ({
|
|||||||
|
|
||||||
const submodulePath = submodulePaths.find(p => deletedFile.startsWith(p))
|
const submodulePath = submodulePaths.find(p => deletedFile.startsWith(p))
|
||||||
|
|
||||||
if (hasSubmodule && submodulePath) {
|
if (diffSubmodule && submodulePath) {
|
||||||
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
parentSha1: diffResult.previousSha,
|
parentSha1: diffResult.previousSha,
|
||||||
@ -1513,52 +1555,28 @@ export const hasLocalGitDirectory = async ({
|
|||||||
/**
|
/**
|
||||||
* Warns about unsupported inputs when using the REST API.
|
* Warns about unsupported inputs when using the REST API.
|
||||||
*
|
*
|
||||||
* @param actionPath - The path to the action file.
|
|
||||||
* @param inputs - The inputs object.
|
* @param inputs - The inputs object.
|
||||||
*/
|
*/
|
||||||
export const warnUnsupportedRESTAPIInputs = async ({
|
export const warnUnsupportedRESTAPIInputs = async ({
|
||||||
actionPath,
|
|
||||||
inputs
|
inputs
|
||||||
}: {
|
}: {
|
||||||
actionPath: string
|
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
}): Promise<void> => {
|
}): Promise<void> => {
|
||||||
const actionContents = await fs.readFile(actionPath, 'utf8')
|
for (const key of Object.keys(DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS)) {
|
||||||
const actionYaml = parseDocument(actionContents, {schema: 'failsafe'})
|
|
||||||
|
|
||||||
if (actionYaml.errors.length > 0) {
|
|
||||||
throw new Error(
|
|
||||||
`YAML errors in ${actionPath}: ${actionYaml.errors.join(', ')}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (actionYaml.warnings.length > 0) {
|
|
||||||
throw new Error(
|
|
||||||
`YAML warnings in ${actionPath}: ${actionYaml.warnings.join(', ')}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const action = actionYaml.toJS() as {
|
|
||||||
inputs: {
|
|
||||||
[key: string]: {description: string; required: boolean; default: string}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const actionInputs = action.inputs
|
|
||||||
|
|
||||||
for (const key of UNSUPPORTED_REST_API_INPUTS) {
|
|
||||||
const inputKey = snakeCase(key) as keyof Inputs
|
|
||||||
|
|
||||||
const defaultValue = Object.hasOwnProperty.call(
|
const defaultValue = Object.hasOwnProperty.call(
|
||||||
actionInputs[inputKey],
|
DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS,
|
||||||
'default'
|
key
|
||||||
)
|
)
|
||||||
? actionInputs[inputKey].default.toString()
|
? DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[
|
||||||
|
key as keyof Inputs
|
||||||
|
]?.toString()
|
||||||
: ''
|
: ''
|
||||||
|
|
||||||
if (defaultValue !== inputs[key]?.toString()) {
|
if (defaultValue !== inputs[key as keyof Inputs]?.toString()) {
|
||||||
core.warning(
|
core.warning(
|
||||||
`Input "${inputKey}" is not supported when using GitHub's REST API to get changed files`
|
`Input "${snakeCase(
|
||||||
|
key
|
||||||
|
)}" is not supported when using GitHub's REST API to get changed files`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
test/new.md
Normal file
1
test/new.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
This is a test markdown file
|
||||||
@ -1 +1 @@
|
|||||||
This is a test file.
|
This is a test file...
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
"target": "ES2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user