Compare commits
187 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17f3fec1ed | ||
|
|
52dbf3e3cf | ||
|
|
0a814e4372 | ||
|
|
fc63326544 | ||
|
|
18bacaab15 | ||
|
|
e8f12786b4 | ||
|
|
8789204f97 | ||
|
|
819fb64520 | ||
|
|
31003b45e6 | ||
|
|
1f04b16682 | ||
|
|
0a8b04e3e3 | ||
|
|
f8b4039d96 | ||
|
|
6da496e2f9 | ||
|
|
68d38a3f16 | ||
|
|
0e8eddfd8c | ||
|
|
3645cf9fc3 | ||
|
|
a0585ff990 | ||
|
|
ec3a2a3b3b | ||
|
|
24e2a6fb86 | ||
|
|
1144bc6587 | ||
|
|
fa84d9471e | ||
|
|
71dfd0dc2e | ||
|
|
b941520afb | ||
|
|
be110124f6 | ||
|
|
927363397d | ||
|
|
9dc097cfe5 | ||
|
|
e3b0c8a681 | ||
|
|
a62be95af3 | ||
|
|
a2e707696a | ||
|
|
f267068b02 | ||
|
|
7f0849be06 | ||
|
|
87697c0dca | ||
|
|
0acc1c308e | ||
|
|
312a3d8003 | ||
|
|
701bae514b | ||
|
|
8bffb974e4 | ||
|
|
d4e6e22e93 | ||
|
|
1e9cd5f299 | ||
|
|
29022e81a4 | ||
|
|
6b028b6303 | ||
|
|
f76208237d | ||
|
|
b61db7817f | ||
|
|
6a48a0a018 | ||
|
|
3415802ae9 | ||
|
|
20a19b977f | ||
|
|
10228bf07b | ||
|
|
24ac45c74e | ||
|
|
85c8b8252f | ||
|
|
948fd1aec0 | ||
|
|
213a6fbf71 | ||
|
|
c089e392a9 | ||
|
|
387fa91a19 | ||
|
|
bde04d3ec6 | ||
|
|
ce7dceac93 | ||
|
|
18832c2f0d | ||
|
|
3fdcd6b1fa | ||
|
|
2b564ea543 | ||
|
|
6b62acfc40 | ||
|
|
62411c0bbf | ||
|
|
c10ebdc85f | ||
|
|
1b00b76bc1 | ||
|
|
8ffb34e4db | ||
|
|
81ce706243 | ||
|
|
a96679dfee | ||
|
|
0c659577d4 | ||
|
|
ea41e77287 | ||
|
|
ca51c3f430 | ||
|
|
5716c6246f | ||
|
|
f6edf885b4 | ||
|
|
4acaa728bb | ||
|
|
331d2daf96 | ||
|
|
174b246d44 | ||
|
|
0bf83955a9 | ||
|
|
69c6091ee4 | ||
|
|
cf02ab960f | ||
|
|
b50d1ab2d1 | ||
|
|
ba9054e8d5 | ||
|
|
7e9cc01c54 | ||
|
|
0f52c861db | ||
|
|
920e7b9ae1 | ||
|
|
b8e577a274 | ||
|
|
fc3c551a67 | ||
|
|
797a722244 | ||
|
|
44790ad9d8 | ||
|
|
73d266fe29 | ||
|
|
e1ddf02aff | ||
|
|
66d62c97d5 | ||
|
|
d44a61ef33 | ||
|
|
ef59201f02 | ||
|
|
f5439803c2 | ||
|
|
a0a0be0376 | ||
|
|
48ce5846c9 | ||
|
|
de0eba3279 | ||
|
|
bc262c2f61 | ||
|
|
d4389f0f4f | ||
|
|
79984462e1 | ||
|
|
c6dcc2a013 | ||
|
|
e6dde3c065 | ||
|
|
39283171ce | ||
|
|
33288d37e7 | ||
|
|
b60277dde9 | ||
|
|
68b429ddc6 | ||
|
|
ec0b6d0e4c | ||
|
|
e3ea6b7948 | ||
|
|
8c8be234b2 | ||
|
|
029d6cd6b8 | ||
|
|
8fc95ea175 | ||
|
|
3e2a2ce2d0 | ||
|
|
4aebdafc0b | ||
|
|
2aadab2297 | ||
|
|
2a968ff601 | ||
|
|
ef327f98b5 | ||
|
|
5c1cab8429 | ||
|
|
60e7ac7c28 | ||
|
|
fe91ab72f6 | ||
|
|
cc23ede837 | ||
|
|
76dc7bcd3f | ||
|
|
c7072f0969 | ||
|
|
032079bf7f | ||
|
|
21ccb43669 | ||
|
|
038a51af80 | ||
|
|
a5f4b54b5f | ||
|
|
61e9ed7dab | ||
|
|
c6c396f2fe | ||
|
|
7f05b89187 | ||
|
|
139cb86a77 | ||
|
|
97365f6cd2 | ||
|
|
1f20fb83f0 | ||
|
|
51647add79 | ||
|
|
6c6532459a | ||
|
|
f53b75ef58 | ||
|
|
732c1a14e7 | ||
|
|
3ab0d43f2c | ||
|
|
de17e6cdf2 | ||
|
|
c7bb50a40c | ||
|
|
fe12e8f13f | ||
|
|
87e23c4c79 | ||
|
|
2f49eb9ee1 | ||
|
|
00b3d3d9e7 | ||
|
|
19193bdb26 | ||
|
|
d12b5fc2ab | ||
|
|
338f354106 | ||
|
|
626a6b7213 | ||
|
|
090f90127a | ||
|
|
598640f3be | ||
|
|
7ee3290f25 | ||
|
|
e9eccdd473 | ||
|
|
6dc8c796c9 | ||
|
|
d1028b2eb8 | ||
|
|
0e24cebad0 | ||
|
|
d8f8ad9a74 | ||
|
|
47a703e935 | ||
|
|
742b6417b4 | ||
|
|
af9376f801 | ||
|
|
adaff22ded | ||
|
|
2cd4de3431 | ||
|
|
b199521773 | ||
|
|
aecc5ebeee | ||
|
|
630aa37bbd | ||
|
|
c060576a37 | ||
|
|
54849deb96 | ||
|
|
034e423c9c | ||
|
|
89c31817b2 | ||
|
|
e42f43b67b | ||
|
|
6fdb8b53b3 | ||
|
|
3323f78bb4 | ||
|
|
fe20777b56 | ||
|
|
89890d6f77 | ||
|
|
927a8c5ba3 | ||
|
|
5e7542fc4b | ||
|
|
bb3376162b | ||
|
|
6d350523ea | ||
|
|
8838901b21 | ||
|
|
eb59803836 | ||
|
|
bdf73bf6ae | ||
|
|
4cddd28d4b | ||
|
|
89f014aed9 | ||
|
|
4904bb2843 | ||
|
|
13e016d7c4 | ||
|
|
709c71af5f | ||
|
|
8c58d60f5b | ||
|
|
e6e128a1c4 | ||
|
|
358ff4f347 | ||
|
|
ec1e14cf27 | ||
|
|
7d7c69556b | ||
|
|
cb82bb7325 | ||
|
|
07e161e47f |
@@ -1,4 +1,5 @@
|
|||||||
dist/
|
dist/
|
||||||
lib/
|
lib/
|
||||||
node_modules/
|
node_modules/
|
||||||
jest.config.js
|
jest.config.js
|
||||||
|
coverage/
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"jest",
|
"jest",
|
||||||
"@typescript-eslint"
|
"@typescript-eslint",
|
||||||
|
"github"
|
||||||
],
|
],
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:github/recommended"
|
"plugin:github/recommended",
|
||||||
|
"plugin:prettier/recommended"
|
||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
|
|||||||
10
.github/dependabot.yml
vendored
10
.github/dependabot.yml
vendored
@@ -1,7 +1,17 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
versioning-strategy: widen
|
||||||
|
labels:
|
||||||
|
- "merge when passing"
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: daily
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
labels:
|
||||||
|
- "merge when passing"
|
||||||
|
|||||||
26
.github/workflows/auto-merge.yml
vendored
26
.github/workflows/auto-merge.yml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: automerge
|
|
||||||
on:
|
|
||||||
check_suite:
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
automerge:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: |
|
|
||||||
github.actor == 'dependabot[bot]' ||
|
|
||||||
github.actor == 'dependabot' ||
|
|
||||||
github.actor == 'dependabot-preview[bot]' ||
|
|
||||||
github.actor == 'dependabot-preview' ||
|
|
||||||
github.actor == 'renovate[bot]' ||
|
|
||||||
github.actor == 'renovate'
|
|
||||||
steps:
|
|
||||||
- name: automerge
|
|
||||||
uses: pascalgn/automerge-action@v0.15.6
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
||||||
MERGE_METHOD: "rebase"
|
|
||||||
UPDATE_METHOD: "rebase"
|
|
||||||
MERGE_RETRIES: "6"
|
|
||||||
MERGE_RETRY_SLEEP: "100000"
|
|
||||||
MERGE_LABELS: ""
|
|
||||||
439
.github/workflows/test.yml
vendored
439
.github/workflows/test.yml
vendored
@@ -43,6 +43,8 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
files_changed: ${{ steps.changed_files.outputs.files_changed }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -51,7 +53,7 @@ jobs:
|
|||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
|
||||||
- name: Use Node.js 16.x
|
- name: Use Node.js 16.x
|
||||||
uses: actions/setup-node@v3.6.0
|
uses: actions/setup-node@v3.8.1
|
||||||
with:
|
with:
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
@@ -119,6 +121,7 @@ jobs:
|
|||||||
name: Test with multiple repositories
|
name: Test with multiple repositories
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout into dir1
|
- name: Checkout into dir1
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -192,7 +195,7 @@ jobs:
|
|||||||
name: Test changed-files using since and until
|
name: Test changed-files using since and until
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@@ -250,6 +253,7 @@ jobs:
|
|||||||
name: Test changed-files similar base and commit sha
|
name: Test changed-files similar base and commit sha
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@@ -287,6 +291,7 @@ jobs:
|
|||||||
name: Test unset GITHUB_OUTPUT env
|
name: Test unset GITHUB_OUTPUT env
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@@ -317,12 +322,14 @@ jobs:
|
|||||||
name: Test changed-files with limited commit history
|
name: Test changed-files with limited commit history
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
matrix:
|
matrix:
|
||||||
fetch-depth: [1, 2]
|
fetch-depth: [1, 2, 50]
|
||||||
input-fetch_depth: [1, 50]
|
input-fetch_depth: [1, 2, 50]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@@ -339,8 +346,10 @@ jobs:
|
|||||||
- name: Run changed-files
|
- name: Run changed-files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: ./
|
uses: ./
|
||||||
|
continue-on-error: ${{ matrix.input-skip_initial_fetch == true && matrix.fetch-depth < 10 }}
|
||||||
with:
|
with:
|
||||||
fetch_depth: ${{ matrix.input-fetch_depth }}
|
fetch_depth: ${{ matrix.input-fetch_depth }}
|
||||||
|
skip_initial_fetch: ${{ github.event_name == 'push' }}
|
||||||
|
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
@@ -352,7 +361,7 @@ jobs:
|
|||||||
name: Test changed-files with pull request head ref
|
name: Test changed-files with pull request head ref
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: github.event_name != 'push'
|
if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@@ -379,7 +388,7 @@ jobs:
|
|||||||
name: Test changed-files with pull request without persist credentials
|
name: Test changed-files with pull request without persist credentials
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: github.event_name != 'push'
|
if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
@@ -413,6 +422,7 @@ jobs:
|
|||||||
name: Test changed-files non existent base sha
|
name: Test changed-files non existent base sha
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@@ -466,6 +476,7 @@ jobs:
|
|||||||
name: Test changed-files non existent sha
|
name: Test changed-files non existent sha
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@@ -519,7 +530,7 @@ jobs:
|
|||||||
name: Test changed-files with REST API
|
name: Test changed-files with REST API
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: github.event_name != 'push'
|
if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true'
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: read
|
pull-requests: read
|
||||||
steps:
|
steps:
|
||||||
@@ -551,6 +562,7 @@ jobs:
|
|||||||
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'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
@@ -593,6 +605,7 @@ jobs:
|
|||||||
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'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
@@ -640,10 +653,11 @@ jobs:
|
|||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
|
||||||
test_recover_deleted_file:
|
test-recover-deleted-file:
|
||||||
name: Test changed-files recover deleted file
|
name: Test changed-files recover deleted file
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
@@ -670,6 +684,7 @@ jobs:
|
|||||||
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
|
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
|
||||||
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
||||||
recover_deleted_files: true
|
recover_deleted_files: true
|
||||||
|
fetch_depth: 60000
|
||||||
|
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
@@ -702,6 +717,7 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
test
|
test
|
||||||
recover_deleted_files: true
|
recover_deleted_files: true
|
||||||
|
fetch_depth: 60000
|
||||||
|
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
@@ -736,6 +752,7 @@ jobs:
|
|||||||
- test/**.txt
|
- test/**.txt
|
||||||
- test/**.md
|
- test/**.md
|
||||||
recover_deleted_files: true
|
recover_deleted_files: true
|
||||||
|
fetch_depth: 60000
|
||||||
|
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
@@ -767,6 +784,7 @@ jobs:
|
|||||||
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
||||||
recover_deleted_files: true
|
recover_deleted_files: true
|
||||||
recover_deleted_files_to_destination: "deleted_files"
|
recover_deleted_files_to_destination: "deleted_files"
|
||||||
|
fetch_depth: 60000
|
||||||
|
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
@@ -793,11 +811,12 @@ jobs:
|
|||||||
name: Test changed-files
|
name: Test changed-files
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
needs: build
|
needs: build
|
||||||
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 4
|
max-parallel: 4
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, windows-2022]
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
fetch-depth: [0, 1, 2]
|
fetch-depth: [0, 1, 2]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -908,18 +927,26 @@ jobs:
|
|||||||
fetch_depth: 60000
|
fetch_depth: 60000
|
||||||
dir_names: "true"
|
dir_names: "true"
|
||||||
dir_names_max_depth: 3
|
dir_names_max_depth: 3
|
||||||
|
dir_names_exclude_current_dir: "true"
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-dir-names-max-depth.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-dir-names-max-depth.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check dir_names output
|
- name: Check dir_names output on non windows platform
|
||||||
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test/test2/test3')"
|
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test/test2/test3') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test2/test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})"
|
echo "Invalid output: Expected to include (test/test2/test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Check dir_names output on windows platform
|
||||||
|
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test\\test2\\test3') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test2\\test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files with dir_names and dir_names_exclude_current_dir
|
- name: Run changed-files with dir_names and dir_names_exclude_current_dir
|
||||||
id: changed-files-dir-names-exclude-root
|
id: changed-files-dir-names-exclude-root
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -929,7 +956,7 @@ jobs:
|
|||||||
fetch_depth: 60000
|
fetch_depth: 60000
|
||||||
dir_names: "true"
|
dir_names: "true"
|
||||||
dir_names_exclude_current_dir: "true"
|
dir_names_exclude_current_dir: "true"
|
||||||
dir_names_max_depth: "1"
|
dir_names_max_depth: 1
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-dir-names-exclude-root.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-dir-names-exclude-root.outputs) }}'
|
||||||
@@ -969,7 +996,7 @@ jobs:
|
|||||||
base_sha: d1c0ee4
|
base_sha: d1c0ee4
|
||||||
sha: 4d04215
|
sha: 4d04215
|
||||||
fetch_depth: 60000
|
fetch_depth: 60000
|
||||||
dir_names: "true"
|
dir_names: true
|
||||||
files: test/**
|
files: test/**
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
@@ -977,12 +1004,50 @@ jobs:
|
|||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check dir_names output
|
- name: Check dir_names output
|
||||||
if: steps.changed-files-dir-names.outputs.all_changed_files != 'test'
|
if: steps.changed-files-dir-names-specific.outputs.all_changed_files != 'test'
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected (test) got (${{ steps.changed-files-dir-names-specific.outputs.all_changed_files }})"
|
echo "Invalid output: Expected (test) got (${{ steps.changed-files-dir-names-specific.outputs.all_changed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Run changed-files with dir_names and dir_names_include_files with specific files
|
||||||
|
id: changed-files-dir-names-specific-include-files
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
base_sha: d1c0ee4
|
||||||
|
sha: 4d04215
|
||||||
|
fetch_depth: 60000
|
||||||
|
dir_names: true
|
||||||
|
dir_names_include_files: test/*.txt
|
||||||
|
files: test/**
|
||||||
|
json: true
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-dir-names-specific-include-files.outputs) }}'
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check dir_names output on non windows platform
|
||||||
|
if: |
|
||||||
|
(
|
||||||
|
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test/test rename-1.txt') ||
|
||||||
|
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test')
|
||||||
|
) && runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to include (test/test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check dir_names output on windows platform
|
||||||
|
if: |
|
||||||
|
(
|
||||||
|
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test\\test rename-1.txt') ||
|
||||||
|
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test')
|
||||||
|
) && runner.os == 'Windows'
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to include (test\\test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files with forward slash separator
|
- name: Run changed-files with forward slash separator
|
||||||
id: changed-files-forward-slash
|
id: changed-files-forward-slash
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -1080,20 +1145,34 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check all_old_new_renamed_files output
|
- name: Check all_old_new_renamed_files output on non windows platform
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt')"
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
|
echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check the renamed_files output
|
- name: Check all_old_new_renamed_files output on windows platform
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt')"
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test\\test rename 1.txt,test\\test rename-1.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test rename 1.txt,test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check the renamed_files output on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
|
echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Check the renamed_files output on windows platform
|
||||||
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test\\test rename-1.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files for old new filenames test rename 2
|
- name: Run changed-files for old new filenames test rename 2
|
||||||
id: changed-files-all-old-new-renamed-files-2
|
id: changed-files-all-old-new-renamed-files-2
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -1107,20 +1186,34 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check all_old_new_renamed_files output
|
- name: Check all_old_new_renamed_files output on non windows platform
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt')"
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
|
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check the renamed_files output
|
- name: Check all_old_new_renamed_files output on windows platform
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt')"
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check the renamed_files output on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
|
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Check the renamed_files output on windows platform
|
||||||
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files for old new filenames test rename 2 output as deleted and added
|
- name: Run changed-files for old new filenames test rename 2 output as deleted and added
|
||||||
id: changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added
|
id: changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -1135,27 +1228,48 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check all_old_new_renamed_files output
|
- name: Check all_old_new_renamed_files output on non windows platform
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt')"
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})"
|
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check deleted_files output
|
- name: Check all_old_new_renamed_files output on windows platform
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt')"
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test rename 2.txt test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check deleted_files output on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})"
|
echo "Invalid output: Expected to include (test/test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check added_files output
|
- name: Check deleted_files output on windows platform
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt')"
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test\\test rename 2.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check added_files output on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})"
|
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Check added_files output on windows platform
|
||||||
|
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files with specific files
|
- name: Run changed-files with specific files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -1171,15 +1285,22 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-specific.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-specific.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check if a excluded file is not included in any_changed
|
- name: Check if a excluded file is not included in any_changed on non windows platform
|
||||||
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt')"
|
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
|
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_changed for specific files
|
- name: Check if a excluded file is not included in any_changed on windows platform
|
||||||
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test.txt')"
|
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_changed for specific files on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
|
||||||
@@ -1187,15 +1308,31 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check if a excluded file is not included in any_modified
|
- name: Verify any_changed for specific files on windows platform
|
||||||
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt')"
|
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test\\test.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check if a excluded file is not included in any_modified on non windows platform
|
||||||
|
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
|
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_modified for specific files
|
- name: Check if a excluded file is not included in any_modified on windows platform
|
||||||
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test.txt')"
|
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_modified for specific files on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
|
||||||
@@ -1203,15 +1340,40 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check if a excluded file is not included in any_deleted
|
- name: Verify any_modified for specific files on windows platform
|
||||||
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt')"
|
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test\\test.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check if a excluded file is not included in any_deleted on non windows platform
|
||||||
|
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
|
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_deleted for specific files
|
- name: Check if a excluded file is not included in any_deleted on windows platform
|
||||||
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test/test.txt')"
|
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted for specific files on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test/test.txt') && runner.os != 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted for specific files on windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test\\test.txt') && runner.os == 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
|
||||||
@@ -1275,8 +1437,8 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-specific-comma.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-specific-comma.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_changed files comma separator
|
- name: Verify any_changed files comma separator on non windows platform
|
||||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
|
||||||
@@ -1284,8 +1446,17 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_modified files comma separator
|
- name: Verify any_changed files comma separator on windows platform
|
||||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_modified files comma separator on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
|
||||||
@@ -1293,8 +1464,26 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_deleted files comma separator
|
- name: Verify any_modified files comma separator on windows platform
|
||||||
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted files comma separator on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted files comma separator on windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
|
||||||
@@ -1315,8 +1504,8 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-specific-pipe.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-specific-pipe.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_changed files comma separator
|
- name: Verify any_changed files comma separator on non windows platform
|
||||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
|
||||||
@@ -1324,8 +1513,17 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_modified files comma separator
|
- name: Verify any_changed files comma separator on windows platform
|
||||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_modified files comma separator on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
|
||||||
@@ -1333,8 +1531,26 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_deleted files comma separator
|
- name: Verify any_modified files comma separator on windows platform
|
||||||
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted files comma separator on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted files comma separator on windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
|
||||||
@@ -1355,8 +1571,8 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-specific-forward-slash.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-specific-forward-slash.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_changed files forward slash separator
|
- name: Verify any_changed files forward slash separator on non windows platform
|
||||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
|
||||||
@@ -1364,8 +1580,17 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_modified files forward slash separator
|
- name: Verify any_changed files forward slash separator on windows platform
|
||||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_modified files forward slash separator on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
|
||||||
@@ -1373,8 +1598,26 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_deleted files forward slash separator
|
- name: Verify any_modified files forward slash separator on windows platform
|
||||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml')"
|
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted files forward slash separator on non windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
|
||||||
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted files forward slash separator on windows platform
|
||||||
|
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
|
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
|
||||||
@@ -1391,14 +1634,26 @@ jobs:
|
|||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
files: |
|
files: |
|
||||||
**/workflows/greetings.yml
|
**/workflows/greetings.yml
|
||||||
- name: Check if a excluded file is not included in any_changed
|
- name: Show output
|
||||||
if: contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt')
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-specific-source-file.outputs) }}'
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check if a excluded file is not included in any_changed on non windows platform
|
||||||
|
if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
|
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_changed from source files
|
- name: Check if a excluded file is not included in any_changed on windows platform
|
||||||
|
if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_changed from source files on non windows platform
|
||||||
if: |
|
if: |
|
||||||
(
|
(
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') &&
|
||||||
@@ -1407,7 +1662,8 @@ jobs:
|
|||||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '[test new].txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '[test new].txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml')
|
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml') &&
|
||||||
|
runner.os != 'Windows'
|
||||||
)
|
)
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then
|
||||||
@@ -1416,14 +1672,21 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check if a excluded file is not included in any_modified
|
- name: Check if a excluded file is not included in any_modified on non windows platform
|
||||||
if: contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt')
|
if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
|
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_modified from source files
|
- name: Check if a excluded file is not included in any_modified on windows platform
|
||||||
|
if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_modified from source files on non windows platform
|
||||||
if: |
|
if: |
|
||||||
(
|
(
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') &&
|
||||||
@@ -1432,7 +1695,8 @@ jobs:
|
|||||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '[test new].txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '[test new].txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml')
|
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml') &&
|
||||||
|
runner.os != 'Windows'
|
||||||
)
|
)
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then
|
||||||
@@ -1441,14 +1705,21 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Check if a excluded file is not included in any_deleted
|
- name: Check if a excluded file is not included in any_deleted on non windows platform
|
||||||
if: contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt')
|
if: "contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||||
run: |
|
run: |
|
||||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
|
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
|
||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_deleted from source files
|
- name: Check if a excluded file is not included in any_deleted on windows platform
|
||||||
|
if: contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test\\test\\test.txt')
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Verify any_deleted from source files on non windows platform
|
||||||
if: |
|
if: |
|
||||||
(
|
(
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') &&
|
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') &&
|
||||||
@@ -1457,7 +1728,8 @@ jobs:
|
|||||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '[test new].txt') &&
|
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '[test new].txt') &&
|
||||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml')
|
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml') &&
|
||||||
|
runner.os != 'Windows'
|
||||||
)
|
)
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then
|
||||||
@@ -1483,7 +1755,7 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-specific-comma-source-file.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-specific-comma-source-file.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_changed files comma separator
|
- name: Verify any_changed files comma separator from source files on non windows platform
|
||||||
if: |
|
if: |
|
||||||
(
|
(
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') &&
|
||||||
@@ -1491,7 +1763,8 @@ jobs:
|
|||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test.txt') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt')
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt') &&
|
||||||
|
runner.os != 'Windows'
|
||||||
)
|
)
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then
|
||||||
@@ -1500,7 +1773,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_modified files comma separator
|
- name: Verify any_modified files comma separator from source files on non windows platform
|
||||||
if: |
|
if: |
|
||||||
(
|
(
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') &&
|
||||||
@@ -1508,7 +1781,8 @@ jobs:
|
|||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test.txt') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt')
|
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt') &&
|
||||||
|
runner.os != 'Windows'
|
||||||
)
|
)
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then
|
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then
|
||||||
@@ -1517,23 +1791,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Verify any_deleted files with comma separator
|
|
||||||
if: |
|
|
||||||
(
|
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'action.yml') &&
|
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '.github/workflows/test.yml') &&
|
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test.txt') &&
|
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
|
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
|
|
||||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '[test new].txt')
|
|
||||||
)
|
|
||||||
run: |
|
|
||||||
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }}" != "false" ]]; then
|
|
||||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }})"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shell:
|
|
||||||
bash
|
|
||||||
- name: Get branch name
|
- name: Get branch name
|
||||||
id: branch-name
|
id: branch-name
|
||||||
uses: tj-actions/branch-names@v7
|
uses: tj-actions/branch-names@v7
|
||||||
|
|||||||
422
HISTORY.md
422
HISTORY.md
@@ -1,5 +1,427 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
# [37.6.1](https://github.com/tj-actions/changed-files/compare/v37.6.0...v37.6.1) - (2023-08-15)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([9273633](https://github.com/tj-actions/changed-files/commit/927363397d870aec841c3616c5136442218239af)) - (Tonye Jack)
|
||||||
|
- Update README.md ([a2e7076](https://github.com/tj-actions/changed-files/commit/a2e707696afd3f2f1738328cbfed71c56cd9b744)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency prettier to v3.0.2 ([#1457](https://github.com/tj-actions/changed-files/issues/1457)) ([a0585ff](https://github.com/tj-actions/changed-files/commit/a0585ff9904b77d046192a7846e59783d6ea287b)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v6.4.0 ([#1456](https://github.com/tj-actions/changed-files/issues/1456)) ([ec3a2a3](https://github.com/tj-actions/changed-files/commit/ec3a2a3b3bf9648f952a5c642013948f99ab154f)) - (renovate[bot])
|
||||||
|
- **deps:** Update actions/setup-node action to v3.8.0 ([#1455](https://github.com/tj-actions/changed-files/issues/1455)) ([24e2a6f](https://github.com/tj-actions/changed-files/commit/24e2a6fb86042fb1e67a527045d6f8dea53b7d06)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1454](https://github.com/tj-actions/changed-files/issues/1454)) ([1144bc6](https://github.com/tj-actions/changed-files/commit/1144bc6587e8570446c99b3cd5961539c750de3e)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.5.0 ([#1453](https://github.com/tj-actions/changed-files/issues/1453)) ([fa84d94](https://github.com/tj-actions/changed-files/commit/fa84d9471e31552ac5031e74416776d80f7b3c23)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.10 ([#1452](https://github.com/tj-actions/changed-files/issues/1452)) ([71dfd0d](https://github.com/tj-actions/changed-files/commit/71dfd0dc2e7cde599586ee53148fcf31fda68499)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency eslint to v8.47.0 ([#1451](https://github.com/tj-actions/changed-files/issues/1451)) ([b941520](https://github.com/tj-actions/changed-files/commit/b941520afb05ff090564ee87734ece045963aaa7)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1450](https://github.com/tj-actions/changed-files/issues/1450)) ([be11012](https://github.com/tj-actions/changed-files/commit/be110124f6253e3471e3c0280329c359fef9b077)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/lodash to v4.14.197 ([#1446](https://github.com/tj-actions/changed-files/issues/1446)) ([9dc097c](https://github.com/tj-actions/changed-files/commit/9dc097cfe56dd6dca442b8b71b988aad4c385f94)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.9 ([#1444](https://github.com/tj-actions/changed-files/issues/1444)) ([e3b0c8a](https://github.com/tj-actions/changed-files/commit/e3b0c8a681e6f809136066ceeaae9a9203eddf29)) - (renovate[bot])
|
||||||
|
- Fix typo ([a62be95](https://github.com/tj-actions/changed-files/commit/a62be95af39e3e8d28a0ff4a80d07d30e7d16e17)) - (Tonye Jack)
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v6.3.0 ([#1442](https://github.com/tj-actions/changed-files/issues/1442)) ([f267068](https://github.com/tj-actions/changed-files/commit/f267068b025785a2b8e6c5fd692c18782759af31)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.6.0 ([#1441](https://github.com/tj-actions/changed-files/issues/1441))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([7f0849b](https://github.com/tj-actions/changed-files/commit/7f0849be06042444c62445709a000389e08d70e6)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.6.0](https://github.com/tj-actions/changed-files/compare/v37.5.2...v37.6.0) - (2023-08-07)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Improve checking local branch history ([#1436](https://github.com/tj-actions/changed-files/issues/1436)) ([d4e6e22](https://github.com/tj-actions/changed-files/commit/d4e6e22e932832260459e972c83fa76adca04a5c)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([1e9cd5f](https://github.com/tj-actions/changed-files/commit/1e9cd5f2990496e3dc049d7978a807ed153b11a7)) - (Tonye Jack)
|
||||||
|
- Update README.md ([6b028b6](https://github.com/tj-actions/changed-files/commit/6b028b63039ee69ccfad97e35166eb997f6807ff)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1432](https://github.com/tj-actions/changed-files/issues/1432))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([b61db78](https://github.com/tj-actions/changed-files/commit/b61db7817fbdc9f587fb205f4276886cda5913c5)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([6a48a0a](https://github.com/tj-actions/changed-files/commit/6a48a0a0182db1daa7e00603ede7e99364f65ff2)) - (Tonye Jack)
|
||||||
|
- Update README.md ([3415802](https://github.com/tj-actions/changed-files/commit/3415802ae92f45865a7bb5f80578ad22994f57ea)) - (Tonye Jack)
|
||||||
|
- Update README.md ([20a19b9](https://github.com/tj-actions/changed-files/commit/20a19b977fa3a78c7d87956e7b388681926d3b56)) - (Tonye Jack)
|
||||||
|
- Update README.md ([10228bf](https://github.com/tj-actions/changed-files/commit/10228bf07b9286b8db198de83022b52ab908bde7)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 6 -->🧪 Testing
|
||||||
|
|
||||||
|
- Improve test coverage ([#1435](https://github.com/tj-actions/changed-files/issues/1435)) ([29022e8](https://github.com/tj-actions/changed-files/commit/29022e81a423492ed68172112181d0109be5e64e)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Improve test coverage ([#1440](https://github.com/tj-actions/changed-files/issues/1440)) ([87697c0](https://github.com/tj-actions/changed-files/commit/87697c0dca7dd44e37a2b79a79489332556ff1f3)) - (Tonye Jack)
|
||||||
|
- Simplify code ([#1439](https://github.com/tj-actions/changed-files/issues/1439)) ([0acc1c3](https://github.com/tj-actions/changed-files/commit/0acc1c308efedeb1a3a82d4c3812e380cacc86ec)) - (Tonye Jack)
|
||||||
|
- **deps:** Lock file maintenance ([#1438](https://github.com/tj-actions/changed-files/issues/1438)) ([312a3d8](https://github.com/tj-actions/changed-files/commit/312a3d8003811361254cc82903f9a5e057bd1d66)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.8 ([#1425](https://github.com/tj-actions/changed-files/issues/1425)) ([701bae5](https://github.com/tj-actions/changed-files/commit/701bae514b676a5deb33f611a66c7639c3ee2690)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1437](https://github.com/tj-actions/changed-files/issues/1437)) ([8bffb97](https://github.com/tj-actions/changed-files/commit/8bffb974e49dd3c5f242d8af10b9326194c99740)) - (renovate[bot])
|
||||||
|
- **deps-dev:** Bump @types/node from 20.4.6 to 20.4.7 ([#1433](https://github.com/tj-actions/changed-files/issues/1433)) ([f762082](https://github.com/tj-actions/changed-files/commit/f76208237d15a696b0174f93dbb00254bc016c65)) - (dependabot[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.5.2 ([#1431](https://github.com/tj-actions/changed-files/issues/1431))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([24ac45c](https://github.com/tj-actions/changed-files/commit/24ac45c74eee7f284e92f053e045dd94823f7255)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.5.2](https://github.com/tj-actions/changed-files/compare/v37.5.1...v37.5.2) - (2023-08-03)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([948fd1a](https://github.com/tj-actions/changed-files/commit/948fd1aec0f923945aefa5b428966a3148c14b6f)) - (Tonye Jack)
|
||||||
|
- Update README.md ([bde04d3](https://github.com/tj-actions/changed-files/commit/bde04d3ec66f15d1bc7856d05ca626fb6573dc64)) - (Tonye Jack)
|
||||||
|
- Update README.md ([3fdcd6b](https://github.com/tj-actions/changed-files/commit/3fdcd6b1fa054b93db539c7b381c93fa2268d74e)) - (Tonye Jack)
|
||||||
|
- Update README.md ([6b62acf](https://github.com/tj-actions/changed-files/commit/6b62acfc401246667fa6575c368224614e69d150)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1420](https://github.com/tj-actions/changed-files/issues/1420))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([c10ebdc](https://github.com/tj-actions/changed-files/commit/c10ebdc85fde7af2ea8c66779702ccdc2c09c3ba)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([1b00b76](https://github.com/tj-actions/changed-files/commit/1b00b76bc1c9caf00f684c3bb3147d85da101580)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Improve test coverage ([#1430](https://github.com/tj-actions/changed-files/issues/1430)) ([85c8b82](https://github.com/tj-actions/changed-files/commit/85c8b8252fc9893e00b3633a16670e53040e6d71)) - (Tonye Jack)
|
||||||
|
- **deps:** Update dependency prettier to v3.0.1 ([#1428](https://github.com/tj-actions/changed-files/issues/1428)) ([213a6fb](https://github.com/tj-actions/changed-files/commit/213a6fbf71815875a70e39d3f252fe0b13646e14)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1427](https://github.com/tj-actions/changed-files/issues/1427)) ([c089e39](https://github.com/tj-actions/changed-files/commit/c089e392a94aa3fb0651d7893b8d45513851ca14)) - (renovate[bot])
|
||||||
|
- **deps-dev:** Bump @types/node from 20.4.5 to 20.4.6 ([#1426](https://github.com/tj-actions/changed-files/issues/1426)) ([387fa91](https://github.com/tj-actions/changed-files/commit/387fa91a199f7def6ffb96525119cce72a40c3d2)) - (dependabot[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1424](https://github.com/tj-actions/changed-files/issues/1424)) ([ce7dcea](https://github.com/tj-actions/changed-files/commit/ce7dceac93d38ea5365ee8ec231c4c25529ecbfd)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1423](https://github.com/tj-actions/changed-files/issues/1423)) ([18832c2](https://github.com/tj-actions/changed-files/commit/18832c2f0d0dcbf0a631fb9ae64a5b2c840b72d8)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v6.2.1 ([#1422](https://github.com/tj-actions/changed-files/issues/1422)) ([2b564ea](https://github.com/tj-actions/changed-files/commit/2b564ea5437173b3e7dcb0d7aec9ee0ad166d488)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1421](https://github.com/tj-actions/changed-files/issues/1421)) ([62411c0](https://github.com/tj-actions/changed-files/commit/62411c0bbfd74101a58615b1443f3b112aab34f7)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1419](https://github.com/tj-actions/changed-files/issues/1419)) ([8ffb34e](https://github.com/tj-actions/changed-files/commit/8ffb34e4dbad285f2f06e6fc82d72b24d5de2534)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.5.1 ([#1418](https://github.com/tj-actions/changed-files/issues/1418))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([81ce706](https://github.com/tj-actions/changed-files/commit/81ce7062432f3f2a5ba687cce3f289de9da66332)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.5.1](https://github.com/tj-actions/changed-files/compare/v37.5.0...v37.5.1) - (2023-07-28)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([ca51c3f](https://github.com/tj-actions/changed-files/commit/ca51c3f4304b9cd96adebaa47025a2014040eb61)) - (Tonye Jack)
|
||||||
|
- Update README.md ([5716c62](https://github.com/tj-actions/changed-files/commit/5716c6246fcfd7031340a7be53243a6a6b689c3e)) - (Tonye Jack)
|
||||||
|
- Update README.md ([f6edf88](https://github.com/tj-actions/changed-files/commit/f6edf885b4a59cd97f396367b3e6fe4f26454601)) - (Tonye Jack)
|
||||||
|
- Update README.md ([331d2da](https://github.com/tj-actions/changed-files/commit/331d2daf96995ca6711e07b13681faa6a55bda62)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1412](https://github.com/tj-actions/changed-files/issues/1412))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([174b246](https://github.com/tj-actions/changed-files/commit/174b246d44adb53ce1a125fc589734fce01e47eb)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([0bf8395](https://github.com/tj-actions/changed-files/commit/0bf83955a913aa99abe90724dc460e86708af650)) - (Tonye Jack)
|
||||||
|
- Update README.md ([69c6091](https://github.com/tj-actions/changed-files/commit/69c6091ee4f562b2c6509ded97c4e5330ac95b09)) - (Tonye Jack)
|
||||||
|
- Update README.md ([ba9054e](https://github.com/tj-actions/changed-files/commit/ba9054e8d5ffe1537ded23c6a65348cb9b78e8c4)) - (Tonye Jack)
|
||||||
|
- Update README.md ([7e9cc01](https://github.com/tj-actions/changed-files/commit/7e9cc01c5474ea22e06e55ea8a296c8653e64d0c)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency eslint to v8.46.0 ([#1417](https://github.com/tj-actions/changed-files/issues/1417)) ([a96679d](https://github.com/tj-actions/changed-files/commit/a96679dfee2a1e64b1db5a210c0ffaf1f2cb24ce)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1416](https://github.com/tj-actions/changed-files/issues/1416)) ([0c65957](https://github.com/tj-actions/changed-files/commit/0c659577d4b26faf3f99868ea9cabd2775f9b3cb)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency jest to v29.6.2 ([#1415](https://github.com/tj-actions/changed-files/issues/1415)) ([ea41e77](https://github.com/tj-actions/changed-files/commit/ea41e772876ff19a8d86e3315c52ceff3dae1941)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/lodash to v4.14.196 ([#1413](https://github.com/tj-actions/changed-files/issues/1413)) ([4acaa72](https://github.com/tj-actions/changed-files/commit/4acaa728bbc362e0ced57dad81204885d253a0e6)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.5 ([#1409](https://github.com/tj-actions/changed-files/issues/1409)) ([cf02ab9](https://github.com/tj-actions/changed-files/commit/cf02ab960fc3dee58fc4911fac2c6946f4f64552)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1408](https://github.com/tj-actions/changed-files/issues/1408)) ([b50d1ab](https://github.com/tj-actions/changed-files/commit/b50d1ab2d1388e35e9163a8eb2ae8b903e62ca8e)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.5.0 ([#1407](https://github.com/tj-actions/changed-files/issues/1407))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([0f52c86](https://github.com/tj-actions/changed-files/commit/0f52c861db7764988bb85cbb66a0b166787f586b)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.5.0](https://github.com/tj-actions/changed-files/compare/v37.4.0...v37.5.0) - (2023-07-24)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Add support to detect changes for merge group event ([#1404](https://github.com/tj-actions/changed-files/issues/1404)) ([b8e577a](https://github.com/tj-actions/changed-files/commit/b8e577a27496ebc04ffb8b3bbca1b30a145001b1)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Error fetch more history for release events ([#1403](https://github.com/tj-actions/changed-files/issues/1403)) ([fc3c551](https://github.com/tj-actions/changed-files/commit/fc3c551a67c6151b4b7746c157a9c0914f18e129)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update package.json ([73d266f](https://github.com/tj-actions/changed-files/commit/73d266fe29bbb01958506ffe53b575269d8f2b13)) - (Tonye Jack)
|
||||||
|
- Update package.json ([e1ddf02](https://github.com/tj-actions/changed-files/commit/e1ddf02aff6c4d9a624216633291c52df6630421)) - (Tonye Jack)
|
||||||
|
- Update README.md ([f543980](https://github.com/tj-actions/changed-files/commit/f5439803c2c02cdb10b325d247c8ccc66cbc2203)) - (Tonye Jack)
|
||||||
|
- Update README.md ([a0a0be0](https://github.com/tj-actions/changed-files/commit/a0a0be0376b580745f0bd13a6b7ee4e98d028bf3)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Lock file maintenance ([#1406](https://github.com/tj-actions/changed-files/issues/1406)) ([920e7b9](https://github.com/tj-actions/changed-files/commit/920e7b9ae1d45913fc81f86c956fee89c77d2e5e)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v6.2.0 ([#1402](https://github.com/tj-actions/changed-files/issues/1402)) ([797a722](https://github.com/tj-actions/changed-files/commit/797a7222448d90d32258966774780cfb39ee4f44)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1401](https://github.com/tj-actions/changed-files/issues/1401)) ([44790ad](https://github.com/tj-actions/changed-files/commit/44790ad9d8b0716d28defa47199281f484931e31)) - (renovate[bot])
|
||||||
|
- Update package.json ([66d62c9](https://github.com/tj-actions/changed-files/commit/66d62c97d57b2c770a365925793a1e8eb2b1dcd0)) - (Tonye Jack)
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.4 ([#1400](https://github.com/tj-actions/changed-files/issues/1400)) ([d44a61e](https://github.com/tj-actions/changed-files/commit/d44a61ef339541580efca1a47286b8b9e3b69311)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.3 ([#1399](https://github.com/tj-actions/changed-files/issues/1399)) ([ef59201](https://github.com/tj-actions/changed-files/commit/ef59201f02fa40b09640c053d97cdf5c5dc65391)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.4.0 ([#1397](https://github.com/tj-actions/changed-files/issues/1397))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([48ce584](https://github.com/tj-actions/changed-files/commit/48ce5846c9a7c7c959b6c60e3afc80aaba4e6b0c)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.4.0](https://github.com/tj-actions/changed-files/compare/v37.3.0...v37.4.0) - (2023-07-20)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Update error handling for yaml inputs ([#1395](https://github.com/tj-actions/changed-files/issues/1395)) ([de0eba3](https://github.com/tj-actions/changed-files/commit/de0eba32790fb9bf87471b32855a30fc8f9d5fc6)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([bc262c2](https://github.com/tj-actions/changed-files/commit/bc262c2f61e2fdc75b802ad2213f80fefc98af12)) - (Tonye Jack)
|
||||||
|
- Update README.md ([d4389f0](https://github.com/tj-actions/changed-files/commit/d4389f0f4fe92065f29aee6519d551c3c5d26583)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1394](https://github.com/tj-actions/changed-files/issues/1394))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([7998446](https://github.com/tj-actions/changed-files/commit/79984462e18db53eaaee1f8d582c2e752d13cf0c)) - (tj-actions[bot])
|
||||||
|
- Update action.yml ([c6dcc2a](https://github.com/tj-actions/changed-files/commit/c6dcc2a013c3d4f2a21908234845ba52952f2a57)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.3.0 ([#1392](https://github.com/tj-actions/changed-files/issues/1392))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([e6dde3c](https://github.com/tj-actions/changed-files/commit/e6dde3c0653441e7c18779d1207fe87efa071f02)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.3.0](https://github.com/tj-actions/changed-files/compare/v37.2.0...v37.3.0) - (2023-07-19)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Add support for restricting recoverable deleted files via patterns ([#1390](https://github.com/tj-actions/changed-files/issues/1390)) ([33288d3](https://github.com/tj-actions/changed-files/commit/33288d37e78121ba601151ba03d8dacaf856777c)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#1391](https://github.com/tj-actions/changed-files/issues/1391))
|
||||||
|
|
||||||
|
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([3928317](https://github.com/tj-actions/changed-files/commit/39283171cefdf491e0f0d6cf285b86b31eb6f3cd)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.2.0 ([#1389](https://github.com/tj-actions/changed-files/issues/1389))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([b60277d](https://github.com/tj-actions/changed-files/commit/b60277dde98548f8d384a0b92a469fc5d0f46b1f)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.2.0](https://github.com/tj-actions/changed-files/compare/v37.1.2...v37.2.0) - (2023-07-18)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([e3ea6b7](https://github.com/tj-actions/changed-files/commit/e3ea6b7948826820cfd616fda2d9c974a4ead314)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency eslint-plugin-github to v4.9.2 ([#1388](https://github.com/tj-actions/changed-files/issues/1388)) ([68b429d](https://github.com/tj-actions/changed-files/commit/68b429ddc666ea0dba46309e1ee45e06bb408df8)) - (renovate[bot])
|
||||||
|
- Switch to use the github context ([#1386](https://github.com/tj-actions/changed-files/issues/1386)) ([ec0b6d0](https://github.com/tj-actions/changed-files/commit/ec0b6d0e4c2965e4073849cbd0ab0e6fd3b42d50)) - (Tonye Jack)
|
||||||
|
- **deps:** Update dependency eslint-plugin-github to v4.9.1 ([#1387](https://github.com/tj-actions/changed-files/issues/1387)) ([8c8be23](https://github.com/tj-actions/changed-files/commit/8c8be234b2ced36de48c003dd2b2b0cd3448985f)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v6.1.0 ([#1385](https://github.com/tj-actions/changed-files/issues/1385)) ([029d6cd](https://github.com/tj-actions/changed-files/commit/029d6cd6b8191709b7e3d2bff0207a58a0c9c272)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1383](https://github.com/tj-actions/changed-files/issues/1383)) ([8fc95ea](https://github.com/tj-actions/changed-files/commit/8fc95ea17520d70ecf9d3141ec0a0d8443780a48)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1382](https://github.com/tj-actions/changed-files/issues/1382)) ([3e2a2ce](https://github.com/tj-actions/changed-files/commit/3e2a2ce2d08798ebef6a1b3b7fd8782820484ea4)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency eslint to v8.45.0 ([#1381](https://github.com/tj-actions/changed-files/issues/1381)) ([4aebdaf](https://github.com/tj-actions/changed-files/commit/4aebdafc0bbe1a3beffb6e7f6278d3323c6aabcb)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.1.2 ([#1378](https://github.com/tj-actions/changed-files/issues/1378))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2aadab2](https://github.com/tj-actions/changed-files/commit/2aadab2297933ef2a8eaa3a3316ae458aafe4964)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.1.2](https://github.com/tj-actions/changed-files/compare/v37.1.1...v37.1.2) - (2023-07-13)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Excluding current dir with max depth less than 2 ([#1375](https://github.com/tj-actions/changed-files/issues/1375)) ([2a968ff](https://github.com/tj-actions/changed-files/commit/2a968ff601949c81b47d9c1fdb789b0d25ddeea2)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#1373](https://github.com/tj-actions/changed-files/issues/1373))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([fe91ab7](https://github.com/tj-actions/changed-files/commit/fe91ab72f6a9ecb02a0242c01b58685d5680fd4e)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([cc23ede](https://github.com/tj-actions/changed-files/commit/cc23ede8379d7798f2cd63082882472ae1add438)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1368](https://github.com/tj-actions/changed-files/issues/1368))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([032079b](https://github.com/tj-actions/changed-files/commit/032079bf7feccea4cc0b271962986e7770e345b3)) - (tj-actions[bot])
|
||||||
|
- Update action.yml ([21ccb43](https://github.com/tj-actions/changed-files/commit/21ccb43669e77a07efac5f011bd4ee8b73128ef6)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1367](https://github.com/tj-actions/changed-files/issues/1367))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([038a51a](https://github.com/tj-actions/changed-files/commit/038a51af80a6a09ec582702adc3df051791f9db0)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([c6c396f](https://github.com/tj-actions/changed-files/commit/c6c396f2fe271cc83e7e0f9d536c3d86ec4c26ba)) - (Tonye Jack)
|
||||||
|
- Update README.md ([7f05b89](https://github.com/tj-actions/changed-files/commit/7f05b891876669d2c7c19a0d297f6a3b856e0a74)) - (Tonye Jack)
|
||||||
|
- Update README.md ([97365f6](https://github.com/tj-actions/changed-files/commit/97365f6cd24ea353a8eb76ec7882677c79f73b7e)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency eslint-plugin-github to v4.9.0 ([#1377](https://github.com/tj-actions/changed-files/issues/1377)) ([ef327f9](https://github.com/tj-actions/changed-files/commit/ef327f98b5f31e95aad0ae00e29a83a72294910a)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency eslint-plugin-jest to v27.2.3 ([#1376](https://github.com/tj-actions/changed-files/issues/1376)) ([5c1cab8](https://github.com/tj-actions/changed-files/commit/5c1cab842919e3c5e2c9385b01039715b7f81382)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.2 ([#1372](https://github.com/tj-actions/changed-files/issues/1372)) ([60e7ac7](https://github.com/tj-actions/changed-files/commit/60e7ac7c28a8e1f8d0dca3a5b0b2c558c38526d1)) - (renovate[bot])
|
||||||
|
- Update README.md ([#1371](https://github.com/tj-actions/changed-files/issues/1371)) ([76dc7bc](https://github.com/tj-actions/changed-files/commit/76dc7bcd3f1236de1b72ce30d0b98b19cea5ab9d)) - (Tonye Jack)
|
||||||
|
- Improve test coverage ([#1369](https://github.com/tj-actions/changed-files/issues/1369)) ([c7072f0](https://github.com/tj-actions/changed-files/commit/c7072f096921517be8c12059fdcdfaa3c27f8ee3)) - (Tonye Jack)
|
||||||
|
- Update readme to include downsides of skipping the initial fetch ([a5f4b54](https://github.com/tj-actions/changed-files/commit/a5f4b54b5f4e834abbbe77a9f9f94af0b3d93ab0)) - (Tonye Jack)
|
||||||
|
- **deps:** Update dependency eslint-plugin-prettier to v5.0.0 ([#1364](https://github.com/tj-actions/changed-files/issues/1364)) ([61e9ed7](https://github.com/tj-actions/changed-files/commit/61e9ed7dab363242491581aca47219f0201eb362)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.1.1 ([#1363](https://github.com/tj-actions/changed-files/issues/1363))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([139cb86](https://github.com/tj-actions/changed-files/commit/139cb86a771ba8b366563c29e123d7bd97ece0c2)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.1.1](https://github.com/tj-actions/changed-files/compare/v37.1.0...v37.1.1) - (2023-07-11)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#1361](https://github.com/tj-actions/changed-files/issues/1361))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([f53b75e](https://github.com/tj-actions/changed-files/commit/f53b75ef587410b544b17c73677519d76ebe5775)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([732c1a1](https://github.com/tj-actions/changed-files/commit/732c1a14e7c752fc78b781de8975c102ad26dc5f)) - (Tonye Jack)
|
||||||
|
- Update README.md ([de17e6c](https://github.com/tj-actions/changed-files/commit/de17e6cdf222c98c8d2caefef10216bbd23c557e)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Bump semver from 6.3.0 to 6.3.1 ([#1362](https://github.com/tj-actions/changed-files/issues/1362)) ([1f20fb8](https://github.com/tj-actions/changed-files/commit/1f20fb83f05eabed6e12ba0329edac8b6ec8e207)) - (dependabot[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v6 (major) ([#1360](https://github.com/tj-actions/changed-files/issues/1360)) ([51647ad](https://github.com/tj-actions/changed-files/commit/51647add79ed3e9ed311efd543bc342abc2db9e9)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v5.62.0 ([#1359](https://github.com/tj-actions/changed-files/issues/1359)) ([6c65324](https://github.com/tj-actions/changed-files/commit/6c6532459ab0ab44938aabe62c8e665b5fd97aad)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/jest to v29.5.3 ([#1358](https://github.com/tj-actions/changed-files/issues/1358)) ([3ab0d43](https://github.com/tj-actions/changed-files/commit/3ab0d43f2c66ea0f1eb64b6f17ea2471c0f60711)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1356](https://github.com/tj-actions/changed-files/issues/1356)) ([c7bb50a](https://github.com/tj-actions/changed-files/commit/c7bb50a40c6695f3cf2a5e98f77abcd3b8c1775f)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.1.0 ([#1355](https://github.com/tj-actions/changed-files/issues/1355))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([fe12e8f](https://github.com/tj-actions/changed-files/commit/fe12e8f13fd61b4b3acc6a385f31a0c804b71f31)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.1.0](https://github.com/tj-actions/changed-files/compare/v37.0.5...v37.1.0) - (2023-07-09)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Add support for skipping initial fetch ([#1353](https://github.com/tj-actions/changed-files/issues/1353)) ([2f49eb9](https://github.com/tj-actions/changed-files/commit/2f49eb9ee1f1dc38d9f070ebecf12b59c9436e0e)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 17 -->➖ Remove
|
||||||
|
|
||||||
|
- Deleted .github/workflows/auto-merge.yml ([d1028b2](https://github.com/tj-actions/changed-files/commit/d1028b2eb89e46a93cc618ef283598da9e43a860)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#1354](https://github.com/tj-actions/changed-files/issues/1354))
|
||||||
|
|
||||||
|
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([87e23c4](https://github.com/tj-actions/changed-files/commit/87e23c4c79a603288642711155953c7da34b11ac)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([00b3d3d](https://github.com/tj-actions/changed-files/commit/00b3d3d9e7d0efa856785fc5586fefd61cbf9e92)) - (Tonye Jack)
|
||||||
|
- Update README.md ([626a6b7](https://github.com/tj-actions/changed-files/commit/626a6b7213d3d54c32b7f8afae6251494453ded6)) - (Tonye Jack)
|
||||||
|
- Update dependabot.yml ([7ee3290](https://github.com/tj-actions/changed-files/commit/7ee3290f25f5a3f42d74b3399dd2106a7f7ce2f3)) - (Tonye Jack)
|
||||||
|
- Updated renovate.json ([e9eccdd](https://github.com/tj-actions/changed-files/commit/e9eccdd473f87222a6a8393f849d7c945568b842)) - (Tonye Jack)
|
||||||
|
- Update dependabot.yml ([6dc8c79](https://github.com/tj-actions/changed-files/commit/6dc8c796c9b6810ee03d89669f5f7edf09069788)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps-dev:** Bump prettier from 2.8.8 to 3.0.0 ([#1345](https://github.com/tj-actions/changed-files/issues/1345)) ([19193bd](https://github.com/tj-actions/changed-files/commit/19193bdb2634c8529d7b25642f3436f76eae0b45)) - (dependabot[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.4.1 ([#1351](https://github.com/tj-actions/changed-files/issues/1351)) ([d12b5fc](https://github.com/tj-actions/changed-files/commit/d12b5fc2ab2546513a4be53b41218c928fd70b99)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency jest to v29.6.1 ([#1350](https://github.com/tj-actions/changed-files/issues/1350)) ([338f354](https://github.com/tj-actions/changed-files/commit/338f3541063a272dd7dcf8ed531daa483ca95762)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1349](https://github.com/tj-actions/changed-files/issues/1349)) ([090f901](https://github.com/tj-actions/changed-files/commit/090f90127a77657c1531f97f8f22a7ec1fbeeb1c)) - (renovate[bot])
|
||||||
|
- **deps-dev:** Bump @types/node from 20.3.3 to 20.4.0 ([#1348](https://github.com/tj-actions/changed-files/issues/1348)) ([598640f](https://github.com/tj-actions/changed-files/commit/598640f3beb83bd8c85ef43b7df70d8fca22dca6)) - (dependabot[bot])
|
||||||
|
- **deps:** Update actions/setup-node action to v3.7.0 ([#1344](https://github.com/tj-actions/changed-files/issues/1344)) ([0e24ceb](https://github.com/tj-actions/changed-files/commit/0e24cebad03e8080e8912d6a4a9a200b06ebd261)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1342](https://github.com/tj-actions/changed-files/issues/1342)) ([d8f8ad9](https://github.com/tj-actions/changed-files/commit/d8f8ad9a74cda2e39386f4cebf232f27f4099887)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency jest to v29.6.0 ([#1341](https://github.com/tj-actions/changed-files/issues/1341)) ([47a703e](https://github.com/tj-actions/changed-files/commit/47a703e935c9dd0ecb0421d5656df3f8700d3a0c)) - (renovate[bot])
|
||||||
|
- Update filter pattern ([#1340](https://github.com/tj-actions/changed-files/issues/1340)) ([742b641](https://github.com/tj-actions/changed-files/commit/742b6417b4068dac99221f71a1466631de290ebb)) - (Tonye Jack)
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v5.61.0 ([#1339](https://github.com/tj-actions/changed-files/issues/1339)) ([af9376f](https://github.com/tj-actions/changed-files/commit/af9376f80142244248805dc85f751b19e5875fbf)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1338](https://github.com/tj-actions/changed-files/issues/1338)) ([adaff22](https://github.com/tj-actions/changed-files/commit/adaff22dedce1452500712c7d1445f1ae776739a)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency eslint to v8.44.0 ([#1337](https://github.com/tj-actions/changed-files/issues/1337)) ([2cd4de3](https://github.com/tj-actions/changed-files/commit/2cd4de3431b86792632cb629f30e5743924edb0a)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.3.3 ([#1336](https://github.com/tj-actions/changed-files/issues/1336)) ([b199521](https://github.com/tj-actions/changed-files/commit/b1995217737c4c6b644dfee6b73e35063eff6591)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency ts-jest to v29.1.1 ([#1333](https://github.com/tj-actions/changed-files/issues/1333)) ([aecc5eb](https://github.com/tj-actions/changed-files/commit/aecc5ebeee84c2358e83fc9101ef1a70bd0581ac)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1331](https://github.com/tj-actions/changed-files/issues/1331)) ([c060576](https://github.com/tj-actions/changed-files/commit/c060576a37b64111bff7727c21c1c91948fd88b2)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.0.5 ([#1332](https://github.com/tj-actions/changed-files/issues/1332))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||||
|
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([630aa37](https://github.com/tj-actions/changed-files/commit/630aa37bbd533646936247a99e24e04efeb41602)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.0.5](https://github.com/tj-actions/changed-files/compare/v37.0.4...v37.0.5) - (2023-06-29)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([034e423](https://github.com/tj-actions/changed-files/commit/034e423c9c8101a65e1da676ac29a3423ff442f7)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1329](https://github.com/tj-actions/changed-files/issues/1329))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([89c3181](https://github.com/tj-actions/changed-files/commit/89c31817b274e258fb873b539a68e467a4a385b0)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([e42f43b](https://github.com/tj-actions/changed-files/commit/e42f43b67b2ca0d726dec681aa34e4b875ddd284)) - (Tonye Jack)
|
||||||
|
- Update README.md ([fe20777](https://github.com/tj-actions/changed-files/commit/fe20777b56dffa2faca8f02f32ba42ae644b5a7b)) - (Tonye Jack)
|
||||||
|
- Update README.md ([89890d6](https://github.com/tj-actions/changed-files/commit/89890d6f77a064cdbf5c475517dca8d39228f154)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Lock file maintenance ([#1330](https://github.com/tj-actions/changed-files/issues/1330)) ([54849de](https://github.com/tj-actions/changed-files/commit/54849deb963ca9f24185fb5de2965e002d066e6b)) - (renovate[bot])
|
||||||
|
- Update README.md ([6fdb8b5](https://github.com/tj-actions/changed-files/commit/6fdb8b53b33f2cf5a6a6969836ebfd774e05ff87)) - (Tonye Jack)
|
||||||
|
- **deps:** Update dependency typescript to v5.1.6 ([#1328](https://github.com/tj-actions/changed-files/issues/1328)) ([3323f78](https://github.com/tj-actions/changed-files/commit/3323f78bb45033e3f3bb7d9cbc125d3f0833c243)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency typescript to v5.1.5 ([#1324](https://github.com/tj-actions/changed-files/issues/1324)) ([927a8c5](https://github.com/tj-actions/changed-files/commit/927a8c5ba3f01280932398e5ce47d64bada31e32)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.0.4 ([#1323](https://github.com/tj-actions/changed-files/issues/1323))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([5e7542f](https://github.com/tj-actions/changed-files/commit/5e7542fc4bfffb67ec6f613fb57d17364b602f57)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.0.4](https://github.com/tj-actions/changed-files/compare/v37.0.3...v37.0.4) - (2023-06-27)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- **deps:** Update dependency @octokit/rest to v19.0.13 ([#1318](https://github.com/tj-actions/changed-files/issues/1318)) ([eb59803](https://github.com/tj-actions/changed-files/commit/eb598038365111ee2d653fed71db39c68d8a5ca6)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#1314](https://github.com/tj-actions/changed-files/issues/1314))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([4904bb2](https://github.com/tj-actions/changed-files/commit/4904bb2843fce2a1cec977be83ccda6c1605ff9c)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([13e016d](https://github.com/tj-actions/changed-files/commit/13e016d7c459ba0b877df6680a5543e9f8890ef9)) - (Tonye Jack)
|
||||||
|
- Updated submodule ([#1307](https://github.com/tj-actions/changed-files/issues/1307))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||||
|
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([e6e128a](https://github.com/tj-actions/changed-files/commit/e6e128a1c4b816aabb14c127146e2371749458c0)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Lock file maintenance ([#1320](https://github.com/tj-actions/changed-files/issues/1320)) ([bb33761](https://github.com/tj-actions/changed-files/commit/bb3376162b179308a79fc4450262a15a8e1d6888)) - (renovate[bot])
|
||||||
|
- **deps:** Bump lodash from 4.17.15 to 4.17.21 ([#1322](https://github.com/tj-actions/changed-files/issues/1322)) ([6d35052](https://github.com/tj-actions/changed-files/commit/6d350523ea913b29cd86acff803c50fcbd829ffc)) - (dependabot[bot])
|
||||||
|
- Update package.json ([8838901](https://github.com/tj-actions/changed-files/commit/8838901b21e20574f67a02954a585a5ba579809e)) - (Tonye Jack)
|
||||||
|
- Update package version requirements ([#1317](https://github.com/tj-actions/changed-files/issues/1317)) ([bdf73bf](https://github.com/tj-actions/changed-files/commit/bdf73bf6aec3938ce64ef74eb6b86af0271804a2)) - (Tonye Jack)
|
||||||
|
- **deps:** Update dependency @types/node to v20.3.2 ([#1315](https://github.com/tj-actions/changed-files/issues/1315)) ([4cddd28](https://github.com/tj-actions/changed-files/commit/4cddd28d4b8f3c05636331fdba69336f95c127a2)) - (renovate[bot])
|
||||||
|
- Increase fetch-depth to resolve error with test ([#1316](https://github.com/tj-actions/changed-files/issues/1316)) ([89f014a](https://github.com/tj-actions/changed-files/commit/89f014aed90c84e49f2d9c972ad1b3b43f6e10d8)) - (Tonye Jack)
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v5.60.1 ([#1313](https://github.com/tj-actions/changed-files/issues/1313)) ([709c71a](https://github.com/tj-actions/changed-files/commit/709c71af5fefd98c04ccbfb9e588784850d867cd)) - (renovate[bot])
|
||||||
|
- Update debug message ([#1311](https://github.com/tj-actions/changed-files/issues/1311)) ([8c58d60](https://github.com/tj-actions/changed-files/commit/8c58d60f5bd07539ff823a0ed6eb66262bd89c70)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.0.3 ([#1310](https://github.com/tj-actions/changed-files/issues/1310))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([358ff4f](https://github.com/tj-actions/changed-files/commit/358ff4f347713d6c6eb579a95b43955158857ac1)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.0.3](https://github.com/tj-actions/changed-files/compare/v37.0.2...v37.0.3) - (2023-06-26)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Bug listing submodule paths ([#1308](https://github.com/tj-actions/changed-files/issues/1308)) ([7d7c695](https://github.com/tj-actions/changed-files/commit/7d7c69556b242d112e52d307ae14ba770a52af47)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Lock file maintenance ([#1309](https://github.com/tj-actions/changed-files/issues/1309)) ([ec1e14c](https://github.com/tj-actions/changed-files/commit/ec1e14cf27f4585783f463070881b2c499349a8a)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([#1306](https://github.com/tj-actions/changed-files/issues/1306)) ([cb82bb7](https://github.com/tj-actions/changed-files/commit/cb82bb73255fe3d708c0da15a592f93d820e3499)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.0.2 ([#1305](https://github.com/tj-actions/changed-files/issues/1305))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([07e161e](https://github.com/tj-actions/changed-files/commit/07e161e47fa182e1cc2cb37c80f4e3b175124385)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [37.0.2](https://github.com/tj-actions/changed-files/compare/v37.0.1...v37.0.2) - (2023-06-25)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Add warning message when unable to list submodules ([#1304](https://github.com/tj-actions/changed-files/issues/1304)) ([2106eb4](https://github.com/tj-actions/changed-files/commit/2106eb4457dd2aba4d37c8cdd16acba5d18739b9)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency @types/node to v20.3.1 ([#1303](https://github.com/tj-actions/changed-files/issues/1303)) ([4afe0ab](https://github.com/tj-actions/changed-files/commit/4afe0ab671c36efef1ae5e3e27d8286c3f797f03)) - (renovate[bot])
|
||||||
|
- **deps:** Update tj-actions/eslint-changed-files action to v20 ([#1301](https://github.com/tj-actions/changed-files/issues/1301)) ([5768dd7](https://github.com/tj-actions/changed-files/commit/5768dd7d22ef79603ef768047c6d91ea034d0cdc)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v37.0.1 ([#1300](https://github.com/tj-actions/changed-files/issues/1300))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([648f9c1](https://github.com/tj-actions/changed-files/commit/648f9c1aaf717f92ac2b503be6694ef804b8a49e)) - (tj-actions[bot])
|
||||||
|
|
||||||
# [37.0.1](https://github.com/tj-actions/changed-files/compare/v37.0.0...v37.0.1) - (2023-06-24)
|
# [37.0.1](https://github.com/tj-actions/changed-files/compare/v37.0.0...v37.0.1) - (2023-06-24)
|
||||||
|
|
||||||
## <!-- 1 -->🐛 Bug Fixes
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|||||||
375
README.md
375
README.md
@@ -13,24 +13,24 @@
|
|||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
<img width="auto" alt="Screen Shot 2021-11-19 at 4 59 21 PM" src="https://user-images.githubusercontent.com/17484350/229027815-eee0bf22-f3e5-444d-9d90-6409c68a0dc9.png">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## changed-files
|
## 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.
|
Effortlessly track all changed files and directories relative to a target branch, preceding commit or the last remote commit returning **relative paths** from the project root using this GitHub action.
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
* [Features](#features)
|
* [Features](#features)
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
|
* [On `pull_request`](#on-pull_request)
|
||||||
|
* [Using local .git history](#using-local-git-history)
|
||||||
|
* [Using Github's API](#using-githubs-api)
|
||||||
|
* [On `push`](#on-push)
|
||||||
* [Useful Acronyms](#useful-acronyms)
|
* [Useful Acronyms](#useful-acronyms)
|
||||||
* [Outputs](#outputs)
|
* [Outputs](#outputs)
|
||||||
* [Inputs](#inputs)
|
* [Inputs](#inputs)
|
||||||
* [Versioning](#versioning)
|
* [Versioning](#versioning)
|
||||||
* [Examples](#examples)
|
* [Examples](#examples)
|
||||||
* [Real world usage](#real-world-usage)
|
* [Real-world usage](#real-world-usage)
|
||||||
* [Known Limitation](#known-limitation)
|
* [Known Limitation](#known-limitation)
|
||||||
* [Migration guide](#migration-guide)
|
* [Migration guide](#migration-guide)
|
||||||
* [Credits](#credits)
|
* [Credits](#credits)
|
||||||
@@ -39,14 +39,15 @@ Effortlessly track all changed files and directories relative to a target branch
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Provides 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](https://git-scm.com/docs/git-diff) to determine changed files.
|
||||||
* Facilitates easy debugging.
|
* Facilitates easy debugging.
|
||||||
* Scales to handle large repositories.
|
* Scales to handle large repositories.
|
||||||
* Supports Git submodules.
|
* Supports Git submodules.
|
||||||
* Generates escaped JSON output for running matrix jobs based on changed files.
|
* Supports [merge queues](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) for pull requests.
|
||||||
|
* Generates escaped [JSON output for running matrix jobs](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-test.yml) based on changed files.
|
||||||
* Lists changed directories.
|
* Lists changed directories.
|
||||||
* Allows limiting the 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.
|
||||||
@@ -61,7 +62,7 @@ Effortlessly track all changed files and directories relative to a target branch
|
|||||||
* Between the last remote branch commit and the current HEAD.
|
* Between the last remote branch commit and the current HEAD.
|
||||||
* Restricts change detection to a subset of files and directories:
|
* Restricts change detection to a subset of files and directories:
|
||||||
* Provides boolean output indicating changes in specific files.
|
* Provides boolean output indicating changes in specific files.
|
||||||
* Uses [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
|
* Uses [Glob pattern](https://codepen.io/mrmlnc/pen/OXQjMe) matching.
|
||||||
* Supports Globstar.
|
* Supports Globstar.
|
||||||
* Supports brace expansion.
|
* Supports brace expansion.
|
||||||
* Supports negation.
|
* Supports negation.
|
||||||
@@ -69,65 +70,75 @@ Effortlessly track all changed files and directories relative to a target branch
|
|||||||
* Supports [YAML anchors & aliases](https://www.educative.io/blog/advanced-yaml-syntax-cheatsheet#anchors).
|
* Supports [YAML anchors & aliases](https://www.educative.io/blog/advanced-yaml-syntax-cheatsheet#anchors).
|
||||||
* Supports [YAML multi-line strings](https://learnxinyminutes.com/docs/yaml/).
|
* Supports [YAML multi-line strings](https://learnxinyminutes.com/docs/yaml/).
|
||||||
|
|
||||||
And many more.
|
And many more...
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
> **Warning**:
|
> **Warning**
|
||||||
>
|
>
|
||||||
> * **IMPORTANT:** For `push` events when configuring [`actions/checkout`](https://github.com/actions/checkout#usage) the `fetch-depth` should be set to either `fetch-depth: 0` **OR** `fetch-depth: 2` depending on your use case.
|
> * For `push` events: When configuring [`actions/checkout`](https://github.com/actions/checkout#usage), make sure to set [`fetch-depth`](https://github.com/actions/checkout#usage) to either `0` or `2`, depending on your use case.
|
||||||
> * For monorepos where pulling all the branch history might not be desired, you can omit [`actions/checkout`](https://github.com/actions/checkout#usage) - `fetch-depth` for `pull_request` events.
|
> * For mono repositories where pulling all branch history might not be desired, you can still use the default [`fetch-depth`](https://github.com/actions/checkout#usage), which is set to `1` for `pull_request` events.
|
||||||
> * All multiline inputs should not use double or single quotes since the value is already a string separated by a newline character. See [Examples](#examples) for more information.
|
> * Avoid using single or double quotes for multiline inputs, as the value is already a string separated by a newline character. See [Examples](#examples) for more information.
|
||||||
> * Ensure that `persist-credentials` is set to `true` when configuring [`actions/checkout`](https://github.com/actions/checkout#usage) if `fetch-depth` isn't set to `0`.
|
> * If [`fetch-depth`](https://github.com/actions/checkout#usage) isn't set to `0`, ensure that `persist-credentials` is set to `true` when configuring [`actions/checkout`](https://github.com/actions/checkout#usage).
|
||||||
> * For repositories that have PRs generated from forks when configuring [`actions/checkout`](https://github.com/actions/checkout#usage) set the `repository` to `${{ github.event.pull_request.head.repo.full_name }}`. See: [Example](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/test.yml#L47-L51)
|
> * For repositories that have PRs generated from forks, when configuring [`actions/checkout`](https://github.com/actions/checkout#usage), set the [`repository`](https://github.com/actions/checkout#usage) to `${{ github.event.pull_request.head.repo.full_name }}`. See [Example](https://github.com/tj-actions/changed-files/blob/main/.github/workflows/test.yml#L47-L51).
|
||||||
|
|
||||||
|
Visit the [discussions for more information](https://github.com/tj-actions/changed-files/discussions) or [create a new discussion](https://github.com/tj-actions/changed-files/discussions/new/choose) for usage-related questions.
|
||||||
|
|
||||||
|
### On `pull_request`
|
||||||
|
|
||||||
|
#### Using local .git history
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# -------------------------------------------------------------
|
# ------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
# Event `pull_request`: Returns all changed pull request files.
|
# Event `pull_request`: Compare the last commit of the main branch or last remote commit of the PR branch -> to the current commit of a PR branch.
|
||||||
# --------------------------------------------------------------
|
# ------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
job1: # Example 1 - Using GitHub's API
|
changed_files:
|
||||||
# NOTE:
|
runs-on: ubuntu-latest # windows-latest || macos-latest
|
||||||
# - This is limited to pull_request* events and would raise an error for other events.
|
|
||||||
# - A maximum of 3000 files can be returned.
|
|
||||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
|
||||||
name: Test changed-files
|
|
||||||
if: github.event_name != 'push'
|
|
||||||
permissions:
|
|
||||||
pull-requests: read
|
|
||||||
steps:
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v37
|
|
||||||
|
|
||||||
- name: List all changed files
|
|
||||||
run: |
|
|
||||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
|
||||||
echo "$file was changed"
|
|
||||||
done
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------------------------------------
|
|
||||||
# Event `push`: Compare the preceding commit -> to the current commit of the main branch.
|
|
||||||
# Event `pull_request`: Compare the last commit of main -> to the current commit of a Pull Request branch.
|
|
||||||
# ------------------------------------------------------------------------------------------------------------
|
|
||||||
job2: # Example 2 - Using local .git directory
|
|
||||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
|
||||||
name: Test changed-files
|
name: Test changed-files
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
||||||
|
|
||||||
|
# Example 1
|
||||||
|
- name: Get all test, doc and src files that have changed
|
||||||
|
id: changed-files-yaml
|
||||||
|
uses: tj-actions/changed-files@v37
|
||||||
|
with:
|
||||||
|
files_yaml: |
|
||||||
|
doc:
|
||||||
|
- '**/*.md'
|
||||||
|
- docs/**
|
||||||
|
- README.md
|
||||||
|
test:
|
||||||
|
- test/**
|
||||||
|
- '!test/**.md'
|
||||||
|
src:
|
||||||
|
- src/**
|
||||||
|
# Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml`
|
||||||
|
|
||||||
|
- name: Run step if test file(s) change
|
||||||
|
# NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
|
||||||
|
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
|
||||||
|
run: |
|
||||||
|
echo "One or more test file(s) has changed."
|
||||||
|
echo "List all the files that have changed: ${{ steps.changed-files-yaml.outputs.test_all_changed_files }}"
|
||||||
|
|
||||||
|
- name: Run step if doc file(s) change
|
||||||
|
if: steps.changed-files-yaml.outputs.doc_any_changed == 'true'
|
||||||
|
run: |
|
||||||
|
echo "One or more doc file(s) has changed."
|
||||||
|
echo "List all the files that have changed: ${{ steps.changed-files-yaml.outputs.doc_all_changed_files }}"
|
||||||
|
|
||||||
|
# Example 2
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v37
|
uses: tj-actions/changed-files@v37
|
||||||
@@ -142,84 +153,124 @@ jobs:
|
|||||||
echo "$file was changed"
|
echo "$file was changed"
|
||||||
done
|
done
|
||||||
|
|
||||||
job3: # Example 3 - Using local .git directory
|
# Example 3
|
||||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
|
||||||
name: Test changed-files
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
|
||||||
|
|
||||||
- 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@v37
|
uses: tj-actions/changed-files@v37
|
||||||
with:
|
with:
|
||||||
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
|
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
|
||||||
|
files_ignore: docs/static.js
|
||||||
|
|
||||||
- name: Run step if any file(s) in the docs folder change
|
- name: Run step if any file(s) in the docs folder change
|
||||||
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "One or more files in the docs folder has changed."
|
echo "One or more files in the docs folder has changed."
|
||||||
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
|
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
|
||||||
|
```
|
||||||
|
|
||||||
job4: # Example 4 - Using local .git directory
|
#### Using Github's API
|
||||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
|
||||||
|
```yaml
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# Event `pull_request`: Returns all changed pull request files.
|
||||||
|
# --------------------------------------------------------------
|
||||||
|
changed_files:
|
||||||
|
# NOTE:
|
||||||
|
# - This is limited to pull_request* events and would raise an error for other events.
|
||||||
|
# - A maximum of 3000 files can be returned.
|
||||||
|
# - For more flexibility and no limitations see "Using local .git history" above.
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest # windows-latest || macos-latest
|
||||||
name: Test changed-files
|
name: Test changed-files
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Get changed files
|
||||||
with:
|
id: changed-files
|
||||||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
|
||||||
|
|
||||||
- name: Get all changed .js file(s) or any file in the static folder excluding the docs folder
|
|
||||||
id: changed-files-excluded
|
|
||||||
uses: tj-actions/changed-files@v37
|
uses: tj-actions/changed-files@v37
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
**.js
|
|
||||||
static
|
|
||||||
files_ignore: docs
|
|
||||||
|
|
||||||
- name: Run step if any .js file(s) or any file in the static folder change
|
- name: List all changed files
|
||||||
if: steps.changed-files-excluded.outputs.any_changed == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
echo "One or more .js file(s) or any file in the static folder but not in the doc folder has changed."
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||||
echo "List all the files that have changed: ${{ steps.changed-files-excluded.outputs.all_changed_files }}"
|
echo "$file was changed"
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
job5: # Example 5 - Using local .git directory
|
### On `push`
|
||||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
|
||||||
|
```yaml
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
# -------------------------------
|
||||||
|
# Optionally run on other events
|
||||||
|
# -------------------------------
|
||||||
|
# schedule:
|
||||||
|
# - cron: '0 0 * * *'
|
||||||
|
#
|
||||||
|
# release:
|
||||||
|
# types: [...]
|
||||||
|
#
|
||||||
|
# workflow_dispatch:
|
||||||
|
#
|
||||||
|
# push:
|
||||||
|
# tags:
|
||||||
|
# - '**'
|
||||||
|
#
|
||||||
|
# merge_group:
|
||||||
|
#
|
||||||
|
# ...and many more
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# Using GitHub's API is not supported for push events
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
# Using local .git history
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
# Event `push`: Compare the preceding remote commit -> to the current commit of the main branch
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
changed_files:
|
||||||
|
runs-on: ubuntu-latest # windows-latest || macos-latest
|
||||||
name: Test changed-files
|
name: Test changed-files
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
||||||
|
|
||||||
- name: Get all test, doc and src files that have changed
|
# Example 1
|
||||||
id: changed-files-yaml
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v37
|
uses: tj-actions/changed-files@v37
|
||||||
with:
|
|
||||||
files_yaml: |
|
|
||||||
doc:
|
|
||||||
- *.md
|
|
||||||
- docs/**
|
|
||||||
- !docs/README.md
|
|
||||||
test:
|
|
||||||
- test/**
|
|
||||||
- !test/README.md
|
|
||||||
src:
|
|
||||||
- src/**
|
|
||||||
# Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml`
|
|
||||||
|
|
||||||
- name: Run step if test file(s) change
|
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
|
||||||
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
|
|
||||||
|
- name: List all changed files
|
||||||
run: |
|
run: |
|
||||||
echo "One or more test file(s) has changed."
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||||
echo "List all the files that have changed: ${{ steps.changed-files-yaml.outputs.test_all_changed_files }}"
|
echo "$file was changed"
|
||||||
|
done
|
||||||
- name: Run step if doc file(s) change
|
|
||||||
if: steps.changed-files-yaml.outputs.doc_any_changed == 'true'
|
# Example 2: See above
|
||||||
run: |
|
...
|
||||||
echo "One or more doc file(s) has changed."
|
|
||||||
echo "List all the files that have changed: ${{ steps.changed-files-yaml.outputs.doc_all_changed_files }}"
|
# Example 3: See above
|
||||||
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
To access more examples, navigate to the [Examples](#examples) section.
|
To access more examples, navigate to the [Examples](#examples) section.
|
||||||
@@ -247,6 +298,10 @@ Support this project with a :star:
|
|||||||
| U | Unmerged |
|
| U | Unmerged |
|
||||||
| X | Unknown |
|
| X | Unknown |
|
||||||
|
|
||||||
|
> **Warning**
|
||||||
|
>
|
||||||
|
> * When using `files_yaml*` inputs ensure all outputs are prefixed by the key `test_{...}` e.g. `test_added_files`, `test_any_changed`
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
<!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section -->
|
<!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section -->
|
||||||
@@ -296,47 +351,54 @@ Support this project with a :star:
|
|||||||
|
|
||||||
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
||||||
|
|
||||||
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|
||||||
|----------------------------------------------|--------|----------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|----------------------------------------------|--------|----------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| api\_url | string | false | `"${{ github.api_url }}"` | Github API URL. |
|
| api\_url | string | false | `"${{ github.api_url }}"` | Github API URL. |
|
||||||
| base\_sha | string | false | | Specify a different base commit <br>SHA used for comparing changes |
|
| base\_sha | string | false | | Specify a different base commit <br>SHA used for comparing changes |
|
||||||
| diff\_relative | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
|
| diff\_relative | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
|
||||||
| dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. |
|
| dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. |
|
||||||
| dir\_names\_exclude\_current\_dir | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. |
|
| dir\_names\_exclude\_current\_dir | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. |
|
||||||
| dir\_names\_max\_depth | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. |
|
| dir\_names\_include\_files | string | false | | Include files in the output <br>when `dir_names` is set to <br>`true`. **NOTE:** This returns only <br>the matching files and also <br>the directory names. |
|
||||||
| escape\_json | string | false | `"true"` | Escape JSON output. |
|
| dir\_names\_include\_files\_separator | string | false | `"\n"` | Separator used to split the <br>`dir_names_include_files` input |
|
||||||
| fetch\_depth | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
|
| dir\_names\_max\_depth | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. |
|
||||||
| files | string | false | | File and directory patterns used <br>to detect changes (Defaults to the entire repo if unset) **NOTE:** <br>Multiline file/directory patterns should not <br>include quotes. |
|
| escape\_json | string | false | `"true"` | Escape JSON output. |
|
||||||
| files\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files` input. |
|
| fetch\_depth | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
|
||||||
| files\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input |
|
| files | string | false | | File and directory patterns used <br>to detect changes (Defaults to the entire repo if unset) **NOTE:** <br>Multiline file/directory patterns should not <br>include quotes. |
|
||||||
| files\_ignore | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. |
|
| files\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files` input. |
|
||||||
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore` input |
|
| files\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input |
|
||||||
| files\_ignore\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input |
|
| files\_ignore | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. |
|
||||||
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore` input |
|
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore` input |
|
||||||
| files\_ignore\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>ignore changes |
|
| files\_ignore\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input |
|
||||||
| files\_ignore\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
|
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore` input |
|
||||||
| files\_ignore\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_yaml_from_source_file` input |
|
| files\_ignore\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>ignore changes |
|
||||||
| files\_separator | string | false | `"\n"` | Separator used to split the <br>`files` input |
|
| files\_ignore\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
|
||||||
| files\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>detect changes |
|
| files\_ignore\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_yaml_from_source_file` input |
|
||||||
| files\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
|
| files\_separator | string | false | `"\n"` | Separator used to split the <br>`files` input |
|
||||||
| files\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` input |
|
| files\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>detect changes |
|
||||||
| include\_all\_old\_new\_renamed\_files | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this <br>can generate a large output <br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
|
| files\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
|
||||||
| json | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. |
|
| files\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` input |
|
||||||
| old\_new\_files\_separator | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
|
| include\_all\_old\_new\_renamed\_files | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this <br>can generate a large output <br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
|
||||||
| old\_new\_separator | string | false | `","` | Split character for old and <br>new filename pairs. |
|
| json | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. |
|
||||||
| output\_dir | string | false | `".github/outputs"` | Directory to store output files. |
|
| old\_new\_files\_separator | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
|
||||||
| output\_renamed\_files\_as\_deleted\_and\_added | string | false | `"false"` | Output renamed files as deleted <br>and added files. |
|
| old\_new\_separator | string | false | `","` | Split character for old and <br>new filename pairs. |
|
||||||
| path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
|
| output\_dir | string | false | `".github/outputs"` | Directory to store output files. |
|
||||||
| quotepath | string | false | `"true"` | Use non-ascii characters to match <br>files and output the filenames <br>completely verbatim by setting this <br>to `false` |
|
| output\_renamed\_files\_as\_deleted\_and\_added | string | false | `"false"` | Output renamed files as deleted <br>and added files. |
|
||||||
| recover\_deleted\_files | string | false | `"false"` | Recover deleted files. |
|
| path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
|
||||||
| recover\_deleted\_files\_to\_destination | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. |
|
| quotepath | string | false | `"true"` | Use non-ascii characters to match <br>files and output the filenames <br>completely verbatim by setting this <br>to `false` |
|
||||||
| separator | string | false | `" "` | Split character for output strings |
|
| recover\_deleted\_files | string | false | `"false"` | Recover deleted files. |
|
||||||
| sha | string | false | | Specify a different commit SHA <br>used for comparing changes |
|
| recover\_deleted\_files\_to\_destination | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. |
|
||||||
| since | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. |
|
| recover\_files | string | false | | File and directory patterns used <br>to recover deleted files, defaults <br>to the patterns provided via <br>the `files`, `files_from_source_file`, `files_ignore` and <br>`files_ignore_from_source_file` inputs or all deleted <br>files if no patterns are <br>provided. |
|
||||||
| since\_last\_remote\_commit | string | false | `"false"` | Use the last commit on <br>the remote branch as the <br>`base_sha`. Defaults to the last <br>non-merge commit on the target <br>branch for pull request events <br>and the previous remote commit <br>of the current branch for <br>push events. |
|
| recover\_files\_ignore | string | false | | File and directory patterns to <br>ignore when recovering deleted files. |
|
||||||
| token | string | false | `"${{ github.token }}"` | Github token used to fetch <br>changed files from Github's API. |
|
| recover\_files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`recover_files_ignore` input |
|
||||||
| until | string | false | | Get changed files for commits <br>whose timestamp is earlier than <br>the given time. |
|
| recover\_files\_separator | string | false | `"\n"` | Separator used to split the <br>`recover_files` input |
|
||||||
| write\_output\_files | string | false | `"false"` | Write outputs to the `output_dir` <br>defaults to `.github/outputs` folder. **NOTE:** <br>This creates a `.txt` file <br>by default and a `.json` <br>file if `json` is set <br>to `true`. |
|
| separator | string | false | `" "` | Split character for output strings |
|
||||||
|
| sha | string | false | | Specify a different commit SHA <br>used for comparing changes |
|
||||||
|
| since | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. |
|
||||||
|
| since\_last\_remote\_commit | string | false | `"false"` | Use the last commit on <br>the remote branch as the <br>`base_sha`. Defaults to the last <br>non-merge commit on the target <br>branch for pull request events <br>and the previous remote commit <br>of the current branch for <br>push events. |
|
||||||
|
| skip\_initial\_fetch | string | false | `"false"` | Skip the initial fetch to <br>improve performance for shallow repositories. <br>**NOTE**: This could lead to <br>errors with missing history and <br>the intended use is limited <br>to when you've fetched the <br>history necessary to perform the <br>diff. |
|
||||||
|
| token | string | false | `"${{ github.token }}"` | Github token used to fetch <br>changed files from Github's API. |
|
||||||
|
| until | string | false | | Get changed files for commits <br>whose timestamp is earlier than <br>the given time. |
|
||||||
|
| write\_output\_files | string | false | `"false"` | Write outputs to the `output_dir` <br>defaults to `.github/outputs` folder. **NOTE:** <br>This creates a `.txt` file <br>by default and a `.json` <br>file if `json` is set <br>to `true`. |
|
||||||
|
|
||||||
<!-- AUTO-DOC-INPUT:END -->
|
<!-- AUTO-DOC-INPUT:END -->
|
||||||
|
|
||||||
@@ -368,7 +430,7 @@ The format of the version string is as follows:
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Get all changed files and using a comma separator</summary>
|
<summary>Get all changed files and use a comma separator</summary>
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
@@ -431,7 +493,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
|||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
|
|
||||||
- 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: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -450,7 +512,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
- 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: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -680,7 +742,7 @@ See [inputs](#inputs) for more information.
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Get all changed files with non äšćįí characters i.e (Filename in other languages)</summary>
|
<summary>Get all changed files with non-äšćįí characters i.e (Filename in other languages)</summary>
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
@@ -747,10 +809,10 @@ See [inputs](#inputs) for more information.
|
|||||||
- uses: nrwl/nx-set-shas@v3
|
- uses: nrwl/nx-set-shas@v3
|
||||||
id: last_successful_commit_pull_request
|
id: last_successful_commit_pull_request
|
||||||
with:
|
with:
|
||||||
main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }} # Get the last successful commit on master or main branch
|
main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }} # Get the last successful commit on the master or main branch
|
||||||
workflow_id: 'test.yml'
|
workflow_id: 'test.yml'
|
||||||
|
|
||||||
- name: Run changed-files with the commit of the last successful test workflow run on main
|
- 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@v37
|
uses: tj-actions/changed-files@v37
|
||||||
with:
|
with:
|
||||||
@@ -762,7 +824,9 @@ See [inputs](#inputs) for more information.
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
> **Warning**: This setting overrides the commit sha used by setting `since_last_remote_commit` to true.
|
> **Warning**
|
||||||
|
>
|
||||||
|
> This setting overrides the commit sha used by setting `since_last_remote_commit` to true.
|
||||||
> It is recommended to use either solution that works for your use case.
|
> It is recommended to use either solution that works for your use case.
|
||||||
|
|
||||||
See [inputs](#inputs) for more information.
|
See [inputs](#inputs) for more information.
|
||||||
@@ -791,7 +855,7 @@ See [inputs](#inputs) for more information.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
- 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@v37
|
uses: tj-actions/changed-files@v37
|
||||||
with:
|
with:
|
||||||
@@ -826,7 +890,7 @@ See [inputs](#inputs) for more information.
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## Real world usage
|
## Real-world usage
|
||||||
|
|
||||||
* [vitejs/vite: uses tj-actions/changed-files to automate testing](https://github.com/vitejs/vite/blob/8da04227d6f818a8ad9efc0056101968037c2e36/.github/workflows/ci.yml#L61)
|
* [vitejs/vite: uses tj-actions/changed-files to automate testing](https://github.com/vitejs/vite/blob/8da04227d6f818a8ad9efc0056101968037c2e36/.github/workflows/ci.yml#L61)
|
||||||
|
|
||||||
@@ -842,16 +906,18 @@ 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)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
And many more...
|
And many more...
|
||||||
|
|
||||||
## Known Limitation
|
## Known Limitation
|
||||||
|
|
||||||
> **Warning**:
|
> **Warning**
|
||||||
>
|
>
|
||||||
> * Spaces in file names can introduce bugs when using bash loops. See: [#216](https://github.com/tj-actions/changed-files/issues/216)
|
> * Spaces in file names can introduce bugs when using bash loops. See: [#216](https://github.com/tj-actions/changed-files/issues/216)
|
||||||
> However, this action will handle spaces in file names, with a recommendation of using a separator to prevent hidden issues.
|
> However, this action will handle spaces in file names, with a recommendation of using a separator to prevent any hidden issues.
|
||||||
>
|
>
|
||||||
> 
|
> 
|
||||||
|
|
||||||
@@ -869,9 +935,8 @@ With the switch from using grep's Extended regex to match files to the natively
|
|||||||
- \.sh$
|
- \.sh$
|
||||||
- .(sql|py)$
|
- .(sql|py)$
|
||||||
- ^(dir1|dir2)
|
- ^(dir1|dir2)
|
||||||
+ *.{sh,sql,py}
|
+ **/*.{sh,sql,py}
|
||||||
+ dir1
|
+ {dir1,dir2}/**
|
||||||
+ dir2
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Free software: [MIT license](LICENSE)
|
* Free software: [MIT license](LICENSE)
|
||||||
|
|||||||
28
action.yml
28
action.yml
@@ -112,6 +112,14 @@ inputs:
|
|||||||
description: "Exclude the current directory represented by `.` from the output when `dir_names` is set to `true`."
|
description: "Exclude the current directory represented by `.` from the output when `dir_names` is set to `true`."
|
||||||
required: false
|
required: false
|
||||||
default: "false"
|
default: "false"
|
||||||
|
dir_names_include_files:
|
||||||
|
description: "Include files in the output when `dir_names` is set to `true`. **NOTE:** This returns only the matching files and also the directory names."
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
dir_names_include_files_separator:
|
||||||
|
description: "Separator used to split the `dir_names_include_files` input"
|
||||||
|
default: "\n"
|
||||||
|
required: false
|
||||||
json:
|
json:
|
||||||
description: "Output list of changed files in a JSON formatted string which can be used for matrix jobs."
|
description: "Output list of changed files in a JSON formatted string which can be used for matrix jobs."
|
||||||
required: false
|
required: false
|
||||||
@@ -124,6 +132,10 @@ inputs:
|
|||||||
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: "50"
|
||||||
|
skip_initial_fetch:
|
||||||
|
description: "Skip the initial fetch to improve performance for shallow repositories. **NOTE**: This could lead to errors with missing history and the intended use is limited to when you've fetched the history necessary to perform the diff."
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
since_last_remote_commit:
|
since_last_remote_commit:
|
||||||
description: "Use the last commit on the remote branch as the `base_sha`. Defaults to the last non-merge commit on the target branch for pull request events and the previous remote commit of the current branch for push events."
|
description: "Use the last commit on the remote branch as the `base_sha`. Defaults to the last non-merge commit on the target branch for pull request events and the previous remote commit of the current branch for push events."
|
||||||
required: false
|
required: false
|
||||||
@@ -148,6 +160,22 @@ inputs:
|
|||||||
description: "Recover deleted files to a new destination directory, defaults to the original location."
|
description: "Recover deleted files to a new destination directory, defaults to the original location."
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
|
recover_files:
|
||||||
|
description: "File and directory patterns used to recover deleted files, defaults to the patterns provided via the `files`, `files_from_source_file`, `files_ignore` and `files_ignore_from_source_file` inputs or all deleted files if no patterns are provided."
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
recover_files_separator:
|
||||||
|
description: "Separator used to split the `recover_files` input"
|
||||||
|
default: "\n"
|
||||||
|
required: false
|
||||||
|
recover_files_ignore:
|
||||||
|
description: "File and directory patterns to ignore when recovering deleted files."
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
recover_files_ignore_separator:
|
||||||
|
description: "Separator used to split the `recover_files_ignore` input"
|
||||||
|
default: "\n"
|
||||||
|
required: false
|
||||||
token:
|
token:
|
||||||
description: "Github token used to fetch changed files from Github's API."
|
description: "Github token used to fetch changed files from Github's API."
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
780
dist/index.js
generated
vendored
780
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
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
55
package.json
55
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@tj-actions/glob",
|
"name": "@tj-actions/changed-files",
|
||||||
"version": "17.2.5",
|
"version": "37.4.0",
|
||||||
"description": "Glob pattern matching github action",
|
"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": {
|
||||||
"registry": "https://npm.pkg.github.com"
|
"registry": "https://npm.pkg.github.com"
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint **/*.ts --max-warnings 0",
|
||||||
"lint:fix": "eslint --fix src/**/*.ts",
|
"lint:fix": "eslint --fix 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",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/tj-actions/glob.git"
|
"url": "git+https://github.com/tj-actions/changed-files.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"actions",
|
"actions",
|
||||||
@@ -28,34 +28,35 @@
|
|||||||
"author": "Tonye Jack",
|
"author": "Tonye Jack",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/tj-actions/glob/issues"
|
"url": "https://github.com/tj-actions/changed-files/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/tj-actions/glob#readme",
|
"homepage": "https://github.com/tj-actions/changed-files#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "5.1.1",
|
"@actions/github": "^5.1.1",
|
||||||
"lodash": "^4.17.15",
|
"@octokit/rest": "^19.0.13",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"micromatch": "^4.0.5",
|
"micromatch": "^4.0.5",
|
||||||
"yaml": "^2.3.1",
|
"yaml": "^2.3.1"
|
||||||
"@octokit/rest": "^19.0.7"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@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.1",
|
"@types/node": "^20.3.2",
|
||||||
"@types/uuid": "9.0.2",
|
"@types/uuid": "^9.0.2",
|
||||||
"@typescript-eslint/eslint-plugin": "5.60.0",
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
"@typescript-eslint/parser": "5.60.0",
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
"@vercel/ncc": "0.36.1",
|
"@vercel/ncc": "^0.36.1",
|
||||||
"eslint": "8.43.0",
|
"eslint": "^8.43.0",
|
||||||
"eslint-plugin-github": "4.8.0",
|
"eslint-plugin-github": "^4.8.0",
|
||||||
"eslint-plugin-jest": "27.2.2",
|
"eslint-plugin-jest": "^27.2.2",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0-alpha.2",
|
||||||
"jest": "29.5.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"prettier": "2.8.8",
|
"jest": "^29.5.0",
|
||||||
"ts-jest": "29.1.0",
|
"prettier": "^3.0.0",
|
||||||
"typescript": "5.1.3"
|
"ts-jest": "^29.1.0",
|
||||||
|
"typescript": "^5.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
"config:base"
|
"config:base"
|
||||||
],
|
],
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"prHourlyLimit": 30,
|
"prHourlyLimit": 10,
|
||||||
"prConcurrentLimit": 10,
|
"prConcurrentLimit": 5,
|
||||||
"rebaseWhen": "behind-base-branch",
|
"rebaseWhen": "behind-base-branch",
|
||||||
"addLabels": [
|
"addLabels": [
|
||||||
"dependencies",
|
"dependencies",
|
||||||
@@ -20,13 +20,21 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"automerge": true
|
"automerge": true
|
||||||
},
|
},
|
||||||
|
"nvm": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
"packageRules": [
|
"packageRules": [
|
||||||
{
|
{
|
||||||
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
"matchUpdateTypes": [
|
||||||
|
"minor",
|
||||||
|
"patch",
|
||||||
|
"pin",
|
||||||
|
"digest"
|
||||||
|
],
|
||||||
"automerge": true,
|
"automerge": true,
|
||||||
"rebaseWhen": "behind-base-branch",
|
"rebaseWhen": "behind-base-branch",
|
||||||
"addLabels": [
|
"addLabels": [
|
||||||
"automerge"
|
"merge when passing"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -34,10 +42,15 @@
|
|||||||
"matchLanguages": [
|
"matchLanguages": [
|
||||||
"docker"
|
"docker"
|
||||||
],
|
],
|
||||||
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
"matchUpdateTypes": [
|
||||||
|
"minor",
|
||||||
|
"patch",
|
||||||
|
"pin",
|
||||||
|
"digest"
|
||||||
|
],
|
||||||
"rebaseWhen": "behind-base-branch",
|
"rebaseWhen": "behind-base-branch",
|
||||||
"addLabels": [
|
"addLabels": [
|
||||||
"automerge"
|
"merge when passing"
|
||||||
],
|
],
|
||||||
"automerge": true
|
"automerge": true
|
||||||
}
|
}
|
||||||
|
|||||||
578
src/__tests__/utils.test.ts
Normal file
578
src/__tests__/utils.test.ts
Normal file
@@ -0,0 +1,578 @@
|
|||||||
|
import {ChangeTypeEnum} from '../changedFiles'
|
||||||
|
import {
|
||||||
|
getDirname,
|
||||||
|
getDirnameMaxDepth,
|
||||||
|
getFilteredChangedFiles,
|
||||||
|
normalizeSeparators
|
||||||
|
} from '../utils'
|
||||||
|
|
||||||
|
const originalPlatform = process.platform
|
||||||
|
|
||||||
|
function mockedPlatform(platform: string): void {
|
||||||
|
Object.defineProperty(process, 'platform', {
|
||||||
|
value: platform
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('utils test', () => {
|
||||||
|
afterEach(() => {
|
||||||
|
Object.defineProperty(process, 'platform', {
|
||||||
|
value: originalPlatform
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('getDirnameMaxDepth_function', () => {
|
||||||
|
// Tests that the function returns the correct dirname when the relative path has multiple directories
|
||||||
|
it('test_multiple_directories', () => {
|
||||||
|
const result = getDirnameMaxDepth({
|
||||||
|
relativePath: 'path/to/some/file',
|
||||||
|
dirNamesMaxDepth: 2,
|
||||||
|
excludeCurrentDir: false
|
||||||
|
})
|
||||||
|
expect(result).toEqual('path/to')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname when the relative path has only one directory
|
||||||
|
it('test_single_directory', () => {
|
||||||
|
const result = getDirnameMaxDepth({
|
||||||
|
relativePath: 'path/to',
|
||||||
|
dirNamesMaxDepth: 1,
|
||||||
|
excludeCurrentDir: false
|
||||||
|
})
|
||||||
|
expect(result).toEqual('path')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname when the relative path has no directories
|
||||||
|
it('test_no_directories', () => {
|
||||||
|
const result = getDirnameMaxDepth({
|
||||||
|
relativePath: 'file.txt',
|
||||||
|
dirNamesMaxDepth: 1,
|
||||||
|
excludeCurrentDir: false
|
||||||
|
})
|
||||||
|
expect(result).toEqual('.')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname when dirNamesMaxDepth is set to a value less than the number of directories in the relative path
|
||||||
|
it('test_dirnames_max_depth_less_than_num_directories', () => {
|
||||||
|
const result = getDirnameMaxDepth({
|
||||||
|
relativePath: 'path/to/some/file',
|
||||||
|
dirNamesMaxDepth: 1,
|
||||||
|
excludeCurrentDir: false
|
||||||
|
})
|
||||||
|
expect(result).toEqual('path')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns an empty string when excludeCurrentDir is true and the output is '.'
|
||||||
|
it('test_exclude_current_dir_is_true_and_output_is_dot', () => {
|
||||||
|
const result = getDirnameMaxDepth({
|
||||||
|
relativePath: '.',
|
||||||
|
dirNamesMaxDepth: 1,
|
||||||
|
excludeCurrentDir: true
|
||||||
|
})
|
||||||
|
expect(result).toEqual('')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname when the relative path is a Windows drive root and excludeCurrentDir is true
|
||||||
|
it('test_windows_drive_root_and_exclude_current_dir_is_true', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const result = getDirnameMaxDepth({
|
||||||
|
relativePath: 'C:\\',
|
||||||
|
dirNamesMaxDepth: 1,
|
||||||
|
excludeCurrentDir: true
|
||||||
|
})
|
||||||
|
expect(result).toEqual('')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getDirnameMaxDepth handles a relative path with a trailing separator correctly
|
||||||
|
it('test_trailing_separator', () => {
|
||||||
|
const input = {
|
||||||
|
relativePath: 'path/to/dir/',
|
||||||
|
dirNamesMaxDepth: 2,
|
||||||
|
excludeCurrentDir: true
|
||||||
|
}
|
||||||
|
const expectedOutput = 'path/to'
|
||||||
|
const actualOutput = getDirnameMaxDepth(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getDirnameMaxDepth returns an empty string when excludeCurrentDir is true and the output is '.'
|
||||||
|
it('test_trailing_separator_exclude_current_dir', () => {
|
||||||
|
const input = {
|
||||||
|
relativePath: 'file',
|
||||||
|
excludeCurrentDir: true
|
||||||
|
}
|
||||||
|
const expectedOutput = ''
|
||||||
|
const actualOutput = getDirnameMaxDepth(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getDirnameMaxDepth returns the correct output for a Windows UNC root path
|
||||||
|
it('test_windows_unc_root', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const input = {
|
||||||
|
relativePath: '\\hello',
|
||||||
|
dirNamesMaxDepth: 2,
|
||||||
|
excludeCurrentDir: true
|
||||||
|
}
|
||||||
|
const expectedOutput = ''
|
||||||
|
expect(getDirnameMaxDepth(input)).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getDirnameMaxDepth returns an empty string when given a Windows UNC root and excludeCurrentDir is true
|
||||||
|
it('test_windows_unc_root_exclude_current_dir', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const relativePath = '\\hello'
|
||||||
|
const result = getDirnameMaxDepth({
|
||||||
|
relativePath,
|
||||||
|
excludeCurrentDir: true
|
||||||
|
})
|
||||||
|
expect(result).toEqual('')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getDirnameMaxDepth returns the correct dirname with a relative path that contains both forward and backward slashes
|
||||||
|
it('test_relative_path_with_slashes', () => {
|
||||||
|
const relativePath = 'path/to\file'
|
||||||
|
const expectedOutput = 'path'
|
||||||
|
const actualOutput = getDirnameMaxDepth({relativePath})
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getDirnameMaxDepth returns the correct dirname for a relative path that contains special characters
|
||||||
|
it('test_special_characters', () => {
|
||||||
|
const relativePath =
|
||||||
|
'path/with/special/characters/!@#$%^&*()_+{}|:<>?[];,./'
|
||||||
|
const expectedDirname = 'path/with/special/characters'
|
||||||
|
const actualDirname = getDirnameMaxDepth({relativePath})
|
||||||
|
expect(actualDirname).toEqual(expectedDirname)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('getDirname_function', () => {
|
||||||
|
// Tests that the function returns the correct dirname for a valid path
|
||||||
|
it('test valid path', () => {
|
||||||
|
expect(getDirname('/path/to/file')).toEqual('/path/to')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname for a valid Windows UNC root path
|
||||||
|
it('test windows unc root path', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
expect(getDirname('\\helloworld')).toEqual('.')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname for a path with a trailing slash
|
||||||
|
it('test path with trailing slash', () => {
|
||||||
|
expect(getDirname('/path/to/file/')).toEqual('/path/to')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname for a Windows UNC root path with a trailing slash
|
||||||
|
it('test windows unc root path with trailing slash', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
expect(getDirname('\\hello\\world\\')).toEqual('.')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname for a path with multiple slashes
|
||||||
|
it('test path with multiple slashes', () => {
|
||||||
|
expect(getDirname('/path//to/file')).toEqual('/path/to')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns the correct dirname for a Windows UNC root path with multiple slashes
|
||||||
|
it('test windows unc root path with multiple slashes', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
expect(getDirname('\\hello\\world')).toEqual('.')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('normalizeSeparators_function', () => {
|
||||||
|
// Tests that forward slashes are normalized on Linux
|
||||||
|
it('test forward slashes linux', () => {
|
||||||
|
const input = 'path/to/file'
|
||||||
|
const expectedOutput = 'path/to/file'
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that backslashes are normalized on Windows
|
||||||
|
it('test backslashes windows', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const input = 'path\\to\\file'
|
||||||
|
const expectedOutput = 'path\\to\\file'
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that forward slashes are normalized on Windows
|
||||||
|
it('test mixed slashes windows', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const input = 'path/to/file'
|
||||||
|
const expectedOutput = 'path\\to\\file'
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that mixed slashes are normalized on Windows
|
||||||
|
it('test mixed slashes windows', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const input = 'path\\to/file'
|
||||||
|
const expectedOutput = 'path\\to\\file'
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that an empty string returns an empty string
|
||||||
|
it('test empty string', () => {
|
||||||
|
const input = ''
|
||||||
|
const expectedOutput = ''
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that multiple consecutive slashes are removed
|
||||||
|
it('test multiple consecutive slashes', () => {
|
||||||
|
const input = 'path//to//file'
|
||||||
|
const expectedOutput = 'path/to/file'
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that UNC format is preserved on Windows
|
||||||
|
it('test unc format windows', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const input = '\\\\hello\\world'
|
||||||
|
const expectedOutput = '\\\\hello\\world'
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that a drive root is preserved on Windows
|
||||||
|
it('test drive root windows', () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const input = 'C:\\'
|
||||||
|
const expectedOutput = 'C:\\'
|
||||||
|
const actualOutput = normalizeSeparators(input)
|
||||||
|
expect(actualOutput).toEqual(expectedOutput)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('getFilteredChangedFiles', () => {
|
||||||
|
// Tests that the function returns an empty object when allDiffFiles and filePatterns are empty
|
||||||
|
it('should return an empty object when allDiffFiles and filePatterns are empty', async () => {
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles: {
|
||||||
|
[ChangeTypeEnum.Added]: [],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
},
|
||||||
|
filePatterns: []
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: [],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns allDiffFiles when filePatterns is empty
|
||||||
|
it('should return allDiffFiles when filePatterns is empty', async () => {
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: ['file1.txt'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: []
|
||||||
|
})
|
||||||
|
expect(result).toEqual(allDiffFiles)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns an empty object when allDiffFiles is empty
|
||||||
|
it('should return an empty object when allDiffFiles is empty', async () => {
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles: {
|
||||||
|
[ChangeTypeEnum.Added]: [],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
},
|
||||||
|
filePatterns: ['*.txt']
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: [],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns only the files that match the file patterns on non windows platforms
|
||||||
|
it('should return only the files that match the file patterns', async () => {
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: [
|
||||||
|
'file1.txt',
|
||||||
|
'file2.md',
|
||||||
|
'file3.txt',
|
||||||
|
'test/dir/file4.txt',
|
||||||
|
'test/dir/file5.txt',
|
||||||
|
'dir/file6.md'
|
||||||
|
],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: ['*.txt']
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: ['file1.txt', 'file3.txt'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns only the files that match the file patterns on windows
|
||||||
|
it('should return only the files that match the file patterns on windows', async () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: [
|
||||||
|
'file1.txt',
|
||||||
|
'file2.md',
|
||||||
|
'file3.txt',
|
||||||
|
'test\\dir\\file4.txt',
|
||||||
|
'test\\dir\\file5.txt',
|
||||||
|
'dir\\file6.md'
|
||||||
|
],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: ['*.txt']
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: ['file1.txt', 'file3.txt'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns only the files that match the file patterns with globstar on non windows platforms
|
||||||
|
it('should return only the files that match the file patterns with globstar', async () => {
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: [
|
||||||
|
'file1.txt',
|
||||||
|
'file2.md',
|
||||||
|
'file3.txt',
|
||||||
|
'test/dir/file4.txt',
|
||||||
|
'test/dir/file5.txt',
|
||||||
|
'dir/file6.md'
|
||||||
|
],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: ['**.txt']
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: [
|
||||||
|
'file1.txt',
|
||||||
|
'file3.txt',
|
||||||
|
'test/dir/file4.txt',
|
||||||
|
'test/dir/file5.txt'
|
||||||
|
],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns only the files that match the file patterns with globstar on windows
|
||||||
|
it('should return only the files that match the file patterns with globstar on windows', async () => {
|
||||||
|
mockedPlatform('win32')
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: ['test/**']
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function returns an empty object when there are no files that match the file patterns
|
||||||
|
it('should return an empty object when there are no files that match the file patterns', async () => {
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: ['file1.md', 'file2.md', 'file3.md'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: ['*.txt']
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: [],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that the function can handle file names with special characters
|
||||||
|
it('should handle file names with special characters', async () => {
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: [
|
||||||
|
'file1.txt',
|
||||||
|
'file2 with spaces.txt',
|
||||||
|
'file3$$.txt'
|
||||||
|
],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const result = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: ['file2*.txt']
|
||||||
|
})
|
||||||
|
expect(result).toEqual({
|
||||||
|
[ChangeTypeEnum.Added]: ['file2 with spaces.txt'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getFilteredChangedFiles correctly filters files using glob patterns
|
||||||
|
it('should filter files using glob patterns', async () => {
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: ['test/migrations/test.sql'],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const filePatterns = ['test/migrations/**']
|
||||||
|
const filteredFiles = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns
|
||||||
|
})
|
||||||
|
expect(filteredFiles[ChangeTypeEnum.Added]).toEqual([
|
||||||
|
'test/migrations/test.sql'
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tests that getFilteredChangedFiles correctly filters files using ignore glob patterns
|
||||||
|
it('should filter files using ignore glob patterns', async () => {
|
||||||
|
const allDiffFiles = {
|
||||||
|
[ChangeTypeEnum.Added]: [],
|
||||||
|
[ChangeTypeEnum.Copied]: [],
|
||||||
|
[ChangeTypeEnum.Deleted]: [],
|
||||||
|
[ChangeTypeEnum.Modified]: [
|
||||||
|
'assets/scripts/configure-minikube-linux.sh'
|
||||||
|
],
|
||||||
|
[ChangeTypeEnum.Renamed]: [],
|
||||||
|
[ChangeTypeEnum.TypeChanged]: [],
|
||||||
|
[ChangeTypeEnum.Unmerged]: [],
|
||||||
|
[ChangeTypeEnum.Unknown]: []
|
||||||
|
}
|
||||||
|
const filePatterns = [
|
||||||
|
'assets/scripts/**.sh',
|
||||||
|
'!assets/scripts/configure-minikube-linux.sh'
|
||||||
|
]
|
||||||
|
const filteredFiles = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns
|
||||||
|
})
|
||||||
|
expect(filteredFiles[ChangeTypeEnum.Modified]).toEqual([])
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -1,19 +1,22 @@
|
|||||||
import * as core from '@actions/core'
|
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 mm from 'micromatch'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
|
||||||
import {DiffResult} from './commitSha'
|
import {DiffResult} from './commitSha'
|
||||||
import {Env} from './env'
|
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
import {
|
import {
|
||||||
|
canDiffCommits,
|
||||||
|
getAllChangedFiles,
|
||||||
getDirnameMaxDepth,
|
getDirnameMaxDepth,
|
||||||
|
getDirNamesIncludeFilesPattern,
|
||||||
gitRenamedFiles,
|
gitRenamedFiles,
|
||||||
gitSubmoduleDiffSHA,
|
gitSubmoduleDiffSHA,
|
||||||
jsonOutput,
|
isWindows,
|
||||||
getAllChangedFiles
|
jsonOutput
|
||||||
} from './utils'
|
} from './utils'
|
||||||
import flatten from 'lodash/flatten'
|
|
||||||
|
|
||||||
export const getRenamedFiles = async ({
|
export const getRenamedFiles = async ({
|
||||||
inputs,
|
inputs,
|
||||||
@@ -52,11 +55,24 @@ export const getRenamedFiles = async ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
|
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
|
||||||
|
let diff = '...'
|
||||||
|
|
||||||
|
if (
|
||||||
|
!(await canDiffCommits({
|
||||||
|
cwd: submoduleWorkingDirectory,
|
||||||
|
sha1: submoduleShaResult.previousSha,
|
||||||
|
sha2: submoduleShaResult.currentSha,
|
||||||
|
diff
|
||||||
|
}))
|
||||||
|
) {
|
||||||
|
diff = '..'
|
||||||
|
}
|
||||||
|
|
||||||
const submoduleRenamedFiles = await gitRenamedFiles({
|
const submoduleRenamedFiles = await gitRenamedFiles({
|
||||||
cwd: submoduleWorkingDirectory,
|
cwd: submoduleWorkingDirectory,
|
||||||
sha1: submoduleShaResult.previousSha,
|
sha1: submoduleShaResult.previousSha,
|
||||||
sha2: submoduleShaResult.currentSha,
|
sha2: submoduleShaResult.currentSha,
|
||||||
diff: diffResult.diff,
|
diff,
|
||||||
oldNewSeparator: inputs.oldNewSeparator,
|
oldNewSeparator: inputs.oldNewSeparator,
|
||||||
isSubmodule: true,
|
isSubmodule: true,
|
||||||
parentDir: submodulePath
|
parentDir: submodulePath
|
||||||
@@ -131,11 +147,24 @@ export const getAllDiffFiles = async ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
|
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
|
||||||
|
let diff = '...'
|
||||||
|
|
||||||
|
if (
|
||||||
|
!(await canDiffCommits({
|
||||||
|
cwd: submoduleWorkingDirectory,
|
||||||
|
sha1: submoduleShaResult.previousSha,
|
||||||
|
sha2: submoduleShaResult.currentSha,
|
||||||
|
diff
|
||||||
|
}))
|
||||||
|
) {
|
||||||
|
diff = '..'
|
||||||
|
}
|
||||||
|
|
||||||
const submoduleFiles = await getAllChangedFiles({
|
const submoduleFiles = await getAllChangedFiles({
|
||||||
cwd: submoduleWorkingDirectory,
|
cwd: submoduleWorkingDirectory,
|
||||||
sha1: submoduleShaResult.previousSha,
|
sha1: submoduleShaResult.previousSha,
|
||||||
sha2: submoduleShaResult.currentSha,
|
sha2: submoduleShaResult.currentSha,
|
||||||
diff: diffResult.diff,
|
diff,
|
||||||
isSubmodule: true,
|
isSubmodule: true,
|
||||||
parentDir: submodulePath,
|
parentDir: submodulePath,
|
||||||
outputRenamedFilesAsDeletedAndAdded
|
outputRenamedFilesAsDeletedAndAdded
|
||||||
@@ -156,6 +185,35 @@ export const getAllDiffFiles = async ({
|
|||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function* getFilePaths({
|
||||||
|
inputs,
|
||||||
|
filePaths,
|
||||||
|
dirNamesIncludeFilePatterns
|
||||||
|
}: {
|
||||||
|
inputs: Inputs
|
||||||
|
filePaths: string[]
|
||||||
|
dirNamesIncludeFilePatterns: string[]
|
||||||
|
}): Generator<string> {
|
||||||
|
for (const filePath of filePaths) {
|
||||||
|
if (inputs.dirNames) {
|
||||||
|
if (dirNamesIncludeFilePatterns.length > 0) {
|
||||||
|
const isWin = isWindows()
|
||||||
|
const matchOptions = {dot: true, windows: isWin, noext: true}
|
||||||
|
if (mm.isMatch(filePath, dirNamesIncludeFilePatterns, matchOptions)) {
|
||||||
|
yield filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yield getDirnameMaxDepth({
|
||||||
|
relativePath: filePath,
|
||||||
|
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
|
||||||
|
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
yield filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function* getChangeTypeFilesGenerator({
|
function* getChangeTypeFilesGenerator({
|
||||||
inputs,
|
inputs,
|
||||||
changedFiles,
|
changedFiles,
|
||||||
@@ -165,18 +223,21 @@ function* getChangeTypeFilesGenerator({
|
|||||||
changedFiles: ChangedFiles
|
changedFiles: ChangedFiles
|
||||||
changeTypes: ChangeTypeEnum[]
|
changeTypes: ChangeTypeEnum[]
|
||||||
}): Generator<string> {
|
}): Generator<string> {
|
||||||
|
const dirNamesIncludeFilePatterns = getDirNamesIncludeFilesPattern({inputs})
|
||||||
|
core.debug(
|
||||||
|
`Dir names include file patterns: ${JSON.stringify(
|
||||||
|
dirNamesIncludeFilePatterns
|
||||||
|
)}`
|
||||||
|
)
|
||||||
|
|
||||||
for (const changeType of changeTypes) {
|
for (const changeType of changeTypes) {
|
||||||
const files = changedFiles[changeType] || []
|
const filePaths = changedFiles[changeType] || []
|
||||||
for (const file of files) {
|
for (const filePath of getFilePaths({
|
||||||
if (inputs.dirNames) {
|
inputs,
|
||||||
yield getDirnameMaxDepth({
|
filePaths,
|
||||||
pathStr: file,
|
dirNamesIncludeFilePatterns
|
||||||
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
|
})) {
|
||||||
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
|
yield filePath
|
||||||
})
|
|
||||||
} else {
|
|
||||||
yield file
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,7 +253,7 @@ export const getChangeTypeFiles = async ({
|
|||||||
}): Promise<{paths: string; count: string}> => {
|
}): Promise<{paths: string; count: string}> => {
|
||||||
const files = [
|
const files = [
|
||||||
...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes}))
|
...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes}))
|
||||||
]
|
].filter(Boolean)
|
||||||
|
|
||||||
if (inputs.json) {
|
if (inputs.json) {
|
||||||
return {
|
return {
|
||||||
@@ -214,16 +275,21 @@ function* getAllChangeTypeFilesGenerator({
|
|||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
changedFiles: ChangedFiles
|
changedFiles: ChangedFiles
|
||||||
}): Generator<string> {
|
}): Generator<string> {
|
||||||
for (const file of flatten(Object.values(changedFiles))) {
|
const dirNamesIncludeFilePatterns = getDirNamesIncludeFilesPattern({inputs})
|
||||||
if (inputs.dirNames) {
|
core.debug(
|
||||||
yield getDirnameMaxDepth({
|
`Dir names include file patterns: ${JSON.stringify(
|
||||||
pathStr: file,
|
dirNamesIncludeFilePatterns
|
||||||
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
|
)}`
|
||||||
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
|
)
|
||||||
})
|
|
||||||
} else {
|
const filePaths = flatten(Object.values(changedFiles))
|
||||||
yield file
|
|
||||||
}
|
for (const filePath of getFilePaths({
|
||||||
|
inputs,
|
||||||
|
filePaths,
|
||||||
|
dirNamesIncludeFilePatterns
|
||||||
|
})) {
|
||||||
|
yield filePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +302,7 @@ export const getAllChangeTypeFiles = async ({
|
|||||||
}): Promise<{paths: string; count: string}> => {
|
}): Promise<{paths: string; count: string}> => {
|
||||||
const files = [
|
const files = [
|
||||||
...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles}))
|
...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles}))
|
||||||
]
|
].filter(Boolean)
|
||||||
|
|
||||||
if (inputs.json) {
|
if (inputs.json) {
|
||||||
return {
|
return {
|
||||||
@@ -252,11 +318,9 @@ export const getAllChangeTypeFiles = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getChangedFilesFromGithubAPI = async ({
|
export const getChangedFilesFromGithubAPI = async ({
|
||||||
inputs,
|
inputs
|
||||||
env
|
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
env: Env
|
|
||||||
}): Promise<ChangedFiles> => {
|
}): Promise<ChangedFiles> => {
|
||||||
const octokit = github.getOctokit(inputs.token, {
|
const octokit = github.getOctokit(inputs.token, {
|
||||||
baseUrl: inputs.apiUrl
|
baseUrl: inputs.apiUrl
|
||||||
@@ -277,13 +341,14 @@ export const getChangedFilesFromGithubAPI = async ({
|
|||||||
const options = octokit.rest.pulls.listFiles.endpoint.merge({
|
const options = octokit.rest.pulls.listFiles.endpoint.merge({
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
pull_number: env.GITHUB_EVENT_PULL_REQUEST_NUMBER,
|
pull_number: github.context.payload.pull_request?.number,
|
||||||
per_page: 100
|
per_page: 100
|
||||||
})
|
})
|
||||||
|
|
||||||
const paginatedResponse = await octokit.paginate<
|
const paginatedResponse =
|
||||||
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
|
await octokit.paginate<
|
||||||
>(options)
|
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
|
||||||
|
>(options)
|
||||||
|
|
||||||
core.info(`Found ${paginatedResponse.length} changed files from GitHub API`)
|
core.info(`Found ${paginatedResponse.length} changed files from GitHub API`)
|
||||||
const statusMap: Record<string, ChangeTypeEnum> = {
|
const statusMap: Record<string, ChangeTypeEnum> = {
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import {
|
|||||||
getAllChangeTypeFiles,
|
getAllChangeTypeFiles,
|
||||||
getChangeTypeFiles
|
getChangeTypeFiles
|
||||||
} from './changedFiles'
|
} from './changedFiles'
|
||||||
import {DiffResult} from './commitSha'
|
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
import {getFilteredChangedFiles, recoverDeletedFiles, setOutput} from './utils'
|
import {setOutput} from './utils'
|
||||||
|
|
||||||
const getOutputKey = (key: string, outputPrefix: string): string => {
|
const getOutputKey = (key: string, outputPrefix: string): string => {
|
||||||
return outputPrefix ? `${outputPrefix}_${key}` : key
|
return outputPrefix ? `${outputPrefix}_${key}` : key
|
||||||
@@ -15,40 +14,23 @@ const getOutputKey = (key: string, outputPrefix: string): string => {
|
|||||||
|
|
||||||
export const setChangedFilesOutput = async ({
|
export const setChangedFilesOutput = async ({
|
||||||
allDiffFiles,
|
allDiffFiles,
|
||||||
|
allFilteredDiffFiles,
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory,
|
|
||||||
diffResult,
|
|
||||||
filePatterns = [],
|
filePatterns = [],
|
||||||
outputPrefix = ''
|
outputPrefix = ''
|
||||||
}: {
|
}: {
|
||||||
allDiffFiles: ChangedFiles
|
allDiffFiles: ChangedFiles
|
||||||
|
allFilteredDiffFiles: ChangedFiles
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
workingDirectory: string
|
|
||||||
diffResult?: DiffResult
|
|
||||||
filePatterns?: string[]
|
filePatterns?: string[]
|
||||||
outputPrefix?: string
|
outputPrefix?: string
|
||||||
}): Promise<void> => {
|
}): Promise<void> => {
|
||||||
const allFilteredDiffFiles = await getFilteredChangedFiles({
|
|
||||||
allDiffFiles,
|
|
||||||
filePatterns
|
|
||||||
})
|
|
||||||
core.debug(`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`)
|
|
||||||
|
|
||||||
if (diffResult) {
|
|
||||||
await recoverDeletedFiles({
|
|
||||||
inputs,
|
|
||||||
workingDirectory,
|
|
||||||
deletedFiles: allFilteredDiffFiles[ChangeTypeEnum.Deleted],
|
|
||||||
sha: diffResult.previousSha
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const addedFiles = await getChangeTypeFiles({
|
const addedFiles = await getChangeTypeFiles({
|
||||||
inputs,
|
inputs,
|
||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.Added]
|
changeTypes: [ChangeTypeEnum.Added]
|
||||||
})
|
})
|
||||||
core.debug(`Added files: ${addedFiles}`)
|
core.debug(`Added files: ${JSON.stringify(addedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('added_files', outputPrefix),
|
key: getOutputKey('added_files', outputPrefix),
|
||||||
value: addedFiles.paths,
|
value: addedFiles.paths,
|
||||||
@@ -65,7 +47,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.Copied]
|
changeTypes: [ChangeTypeEnum.Copied]
|
||||||
})
|
})
|
||||||
core.debug(`Copied files: ${copiedFiles}`)
|
core.debug(`Copied files: ${JSON.stringify(copiedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('copied_files', outputPrefix),
|
key: getOutputKey('copied_files', outputPrefix),
|
||||||
value: copiedFiles.paths,
|
value: copiedFiles.paths,
|
||||||
@@ -83,7 +65,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.Modified]
|
changeTypes: [ChangeTypeEnum.Modified]
|
||||||
})
|
})
|
||||||
core.debug(`Modified files: ${modifiedFiles}`)
|
core.debug(`Modified files: ${JSON.stringify(modifiedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('modified_files', outputPrefix),
|
key: getOutputKey('modified_files', outputPrefix),
|
||||||
value: modifiedFiles.paths,
|
value: modifiedFiles.paths,
|
||||||
@@ -101,7 +83,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.Renamed]
|
changeTypes: [ChangeTypeEnum.Renamed]
|
||||||
})
|
})
|
||||||
core.debug(`Renamed files: ${renamedFiles}`)
|
core.debug(`Renamed files: ${JSON.stringify(renamedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('renamed_files', outputPrefix),
|
key: getOutputKey('renamed_files', outputPrefix),
|
||||||
value: renamedFiles.paths,
|
value: renamedFiles.paths,
|
||||||
@@ -119,7 +101,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.TypeChanged]
|
changeTypes: [ChangeTypeEnum.TypeChanged]
|
||||||
})
|
})
|
||||||
core.debug(`Type changed files: ${typeChangedFiles}`)
|
core.debug(`Type changed files: ${JSON.stringify(typeChangedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('type_changed_files', outputPrefix),
|
key: getOutputKey('type_changed_files', outputPrefix),
|
||||||
value: typeChangedFiles.paths,
|
value: typeChangedFiles.paths,
|
||||||
@@ -137,7 +119,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.Unmerged]
|
changeTypes: [ChangeTypeEnum.Unmerged]
|
||||||
})
|
})
|
||||||
core.debug(`Unmerged files: ${unmergedFiles}`)
|
core.debug(`Unmerged files: ${JSON.stringify(unmergedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('unmerged_files', outputPrefix),
|
key: getOutputKey('unmerged_files', outputPrefix),
|
||||||
value: unmergedFiles.paths,
|
value: unmergedFiles.paths,
|
||||||
@@ -155,7 +137,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.Unknown]
|
changeTypes: [ChangeTypeEnum.Unknown]
|
||||||
})
|
})
|
||||||
core.debug(`Unknown files: ${unknownFiles}`)
|
core.debug(`Unknown files: ${JSON.stringify(unknownFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('unknown_files', outputPrefix),
|
key: getOutputKey('unknown_files', outputPrefix),
|
||||||
value: unknownFiles.paths,
|
value: unknownFiles.paths,
|
||||||
@@ -172,7 +154,11 @@ export const setChangedFilesOutput = async ({
|
|||||||
inputs,
|
inputs,
|
||||||
changedFiles: allFilteredDiffFiles
|
changedFiles: allFilteredDiffFiles
|
||||||
})
|
})
|
||||||
core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`)
|
core.debug(
|
||||||
|
`All changed and modified files: ${JSON.stringify(
|
||||||
|
allChangedAndModifiedFiles
|
||||||
|
)}`
|
||||||
|
)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('all_changed_and_modified_files', outputPrefix),
|
key: getOutputKey('all_changed_and_modified_files', outputPrefix),
|
||||||
value: allChangedAndModifiedFiles.paths,
|
value: allChangedAndModifiedFiles.paths,
|
||||||
@@ -195,7 +181,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
ChangeTypeEnum.Renamed
|
ChangeTypeEnum.Renamed
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
core.debug(`All changed files: ${allChangedFiles}`)
|
core.debug(`All changed files: ${JSON.stringify(allChangedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('all_changed_files', outputPrefix),
|
key: getOutputKey('all_changed_files', outputPrefix),
|
||||||
value: allChangedFiles.paths,
|
value: allChangedFiles.paths,
|
||||||
@@ -224,7 +210,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
ChangeTypeEnum.Renamed
|
ChangeTypeEnum.Renamed
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
core.debug(`All other changed files: ${allOtherChangedFiles}`)
|
core.debug(`All other changed files: ${JSON.stringify(allOtherChangedFiles)}`)
|
||||||
|
|
||||||
const otherChangedFiles = allOtherChangedFiles.paths
|
const otherChangedFiles = allOtherChangedFiles.paths
|
||||||
.split(inputs.separator)
|
.split(inputs.separator)
|
||||||
@@ -267,7 +253,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
ChangeTypeEnum.Deleted
|
ChangeTypeEnum.Deleted
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
core.debug(`All modified files: ${allModifiedFiles}`)
|
core.debug(`All modified files: ${JSON.stringify(allModifiedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('all_modified_files', outputPrefix),
|
key: getOutputKey('all_modified_files', outputPrefix),
|
||||||
value: allModifiedFiles.paths,
|
value: allModifiedFiles.paths,
|
||||||
@@ -333,7 +319,7 @@ export const setChangedFilesOutput = async ({
|
|||||||
changedFiles: allFilteredDiffFiles,
|
changedFiles: allFilteredDiffFiles,
|
||||||
changeTypes: [ChangeTypeEnum.Deleted]
|
changeTypes: [ChangeTypeEnum.Deleted]
|
||||||
})
|
})
|
||||||
core.debug(`Deleted files: ${deletedFiles}`)
|
core.debug(`Deleted files: ${JSON.stringify(deletedFiles)}`)
|
||||||
await setOutput({
|
await setOutput({
|
||||||
key: getOutputKey('deleted_files', outputPrefix),
|
key: getOutputKey('deleted_files', outputPrefix),
|
||||||
value: deletedFiles.paths,
|
value: deletedFiles.paths,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
|
import * as github from '@actions/github'
|
||||||
|
|
||||||
import {Env} from './env'
|
import {Env} from './env'
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
@@ -15,11 +16,9 @@ import {
|
|||||||
} from './utils'
|
} from './utils'
|
||||||
|
|
||||||
const getCurrentSHA = async ({
|
const getCurrentSHA = async ({
|
||||||
env,
|
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory
|
workingDirectory
|
||||||
}: {
|
}: {
|
||||||
env: Env
|
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
}): Promise<string> => {
|
}): Promise<string> => {
|
||||||
@@ -50,14 +49,16 @@ const getCurrentSHA = async ({
|
|||||||
} else {
|
} else {
|
||||||
if (!currentSha) {
|
if (!currentSha) {
|
||||||
if (
|
if (
|
||||||
env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA &&
|
github.context.payload.pull_request?.head?.sha &&
|
||||||
(await verifyCommitSha({
|
(await verifyCommitSha({
|
||||||
sha: env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA,
|
sha: github.context.payload.pull_request?.head?.sha,
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
showAsErrorMessage: false
|
showAsErrorMessage: false
|
||||||
})) === 0
|
})) === 0
|
||||||
) {
|
) {
|
||||||
currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
|
currentSha = github.context.payload.pull_request?.head?.sha
|
||||||
|
} else if (github.context.eventName === 'merge_group') {
|
||||||
|
currentSha = github.context.payload.merge_group?.head_sha
|
||||||
} else {
|
} else {
|
||||||
currentSha = await getHeadSha({cwd: workingDirectory})
|
currentSha = await getHeadSha({cwd: workingDirectory})
|
||||||
}
|
}
|
||||||
@@ -79,7 +80,7 @@ export interface DiffResult {
|
|||||||
initialCommit?: boolean
|
initialCommit?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSHAForPushEvent = async (
|
export const getSHAForNonPullRequestEvent = async (
|
||||||
inputs: Inputs,
|
inputs: Inputs,
|
||||||
env: Env,
|
env: Env,
|
||||||
workingDirectory: string,
|
workingDirectory: string,
|
||||||
@@ -92,13 +93,21 @@ export const getSHAForPushEvent = async (
|
|||||||
const currentBranch = targetBranch
|
const currentBranch = targetBranch
|
||||||
let initialCommit = false
|
let initialCommit = false
|
||||||
|
|
||||||
if (isShallow) {
|
if (isShallow && !inputs.skipInitialFetch) {
|
||||||
core.info('Repository is shallow, fetching more history...')
|
core.info('Repository is shallow, fetching more history...')
|
||||||
|
|
||||||
if (isTag) {
|
if (isTag) {
|
||||||
const sourceBranch =
|
let sourceBranch = ''
|
||||||
env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '') ||
|
|
||||||
env.GITHUB_EVENT_RELEASE_TARGET_COMMITISH
|
if (github.context.payload.base_ref) {
|
||||||
|
sourceBranch = github.context.payload.base_ref.replace(
|
||||||
|
'refs/heads/',
|
||||||
|
''
|
||||||
|
)
|
||||||
|
} else if (github.context.payload.release?.target_commitish) {
|
||||||
|
sourceBranch = github.context.payload.release?.target_commitish
|
||||||
|
}
|
||||||
|
|
||||||
await gitFetch({
|
await gitFetch({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@@ -137,7 +146,7 @@ export const getSHAForPushEvent = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentSha = await getCurrentSHA({env, inputs, workingDirectory})
|
const currentSha = await getCurrentSHA({inputs, workingDirectory})
|
||||||
let previousSha = inputs.baseSha
|
let previousSha = inputs.baseSha
|
||||||
const diff = '..'
|
const diff = '..'
|
||||||
|
|
||||||
@@ -190,9 +199,17 @@ export const getSHAForPushEvent = async (
|
|||||||
previousSha = sha
|
previousSha = sha
|
||||||
targetBranch = tag
|
targetBranch = tag
|
||||||
} else {
|
} else {
|
||||||
core.debug('Getting previous SHA for last remote commit...')
|
if (github.context.eventName === 'merge_group') {
|
||||||
if (env.GITHUB_EVENT_FORCED === 'false' || !env.GITHUB_EVENT_FORCED) {
|
core.debug('Getting previous SHA for merge group...')
|
||||||
previousSha = env.GITHUB_EVENT_BEFORE
|
previousSha = github.context.payload.merge_group?.base_sha
|
||||||
|
} else {
|
||||||
|
core.debug('Getting previous SHA for last remote commit...')
|
||||||
|
if (
|
||||||
|
github.context.payload.forced === 'false' ||
|
||||||
|
!github.context.payload.forced
|
||||||
|
) {
|
||||||
|
previousSha = github.context.payload.before
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -265,13 +282,13 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
hasSubmodule: boolean,
|
hasSubmodule: boolean,
|
||||||
gitFetchExtraArgs: string[]
|
gitFetchExtraArgs: string[]
|
||||||
): Promise<DiffResult> => {
|
): Promise<DiffResult> => {
|
||||||
let targetBranch = env.GITHUB_EVENT_PULL_REQUEST_BASE_REF
|
let targetBranch = github.context.payload.pull_request?.base?.ref
|
||||||
const currentBranch = env.GITHUB_EVENT_PULL_REQUEST_HEAD_REF
|
const currentBranch = github.context.payload.pull_request?.head?.ref
|
||||||
if (inputs.sinceLastRemoteCommit) {
|
if (inputs.sinceLastRemoteCommit) {
|
||||||
targetBranch = currentBranch
|
targetBranch = currentBranch
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isShallow) {
|
if (isShallow && !inputs.skipInitialFetch) {
|
||||||
core.info('Repository is shallow, fetching more history...')
|
core.info('Repository is shallow, fetching more history...')
|
||||||
|
|
||||||
let prFetchExitCode = await gitFetch({
|
let prFetchExitCode = await gitFetch({
|
||||||
@@ -281,7 +298,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
'origin',
|
'origin',
|
||||||
`pull/${env.GITHUB_EVENT_PULL_REQUEST_NUMBER}/head:${currentBranch}`
|
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -334,7 +351,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
core.info('Completed fetching more history.')
|
core.info('Completed fetching more history.')
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentSha = await getCurrentSHA({env, inputs, workingDirectory})
|
const currentSha = await getCurrentSHA({inputs, workingDirectory})
|
||||||
let previousSha = inputs.baseSha
|
let previousSha = inputs.baseSha
|
||||||
let diff = '...'
|
let diff = '...'
|
||||||
|
|
||||||
@@ -362,15 +379,15 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!env.GITHUB_EVENT_PULL_REQUEST_BASE_REF ||
|
!github.context.payload.pull_request?.base?.ref ||
|
||||||
env.GITHUB_EVENT_HEAD_REPO_FORK === 'true'
|
github.context.payload.head?.repo?.fork === 'true'
|
||||||
) {
|
) {
|
||||||
diff = '..'
|
diff = '..'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!previousSha) {
|
if (!previousSha) {
|
||||||
if (inputs.sinceLastRemoteCommit) {
|
if (inputs.sinceLastRemoteCommit) {
|
||||||
previousSha = env.GITHUB_EVENT_BEFORE
|
previousSha = github.context.payload.before
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!previousSha ||
|
!previousSha ||
|
||||||
@@ -389,7 +406,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
core.warning(
|
core.warning(
|
||||||
'Unable to locate the previous commit in the local history. Falling back to the pull request base sha.'
|
'Unable to locate the previous commit in the local history. Falling back to the pull request base sha.'
|
||||||
)
|
)
|
||||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
previousSha = github.context.payload.pull_request?.base?.sha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -399,7 +416,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (!previousSha) {
|
if (!previousSha) {
|
||||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
previousSha = github.context.payload.pull_request?.base?.sha
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isShallow) {
|
if (isShallow) {
|
||||||
@@ -411,7 +428,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
diff
|
diff
|
||||||
}))
|
}))
|
||||||
) {
|
) {
|
||||||
core.debug(
|
core.info(
|
||||||
'Merge base is not in the local history, fetching remote target branch...'
|
'Merge base is not in the local history, fetching remote target branch...'
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -439,17 +456,17 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(
|
core.info(
|
||||||
'Merge base is not in the local history, fetching remote target branch again...'
|
'Merge base is not in the local history, fetching remote target branch again...'
|
||||||
)
|
)
|
||||||
core.debug(`Attempt ${i}/10`)
|
core.info(`Attempt ${i}/10`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!previousSha || previousSha === currentSha) {
|
if (!previousSha || previousSha === currentSha) {
|
||||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
previousSha = github.context.payload.pull_request?.base?.sha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,7 +511,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
// uses: actions/checkout@v3
|
// uses: actions/checkout@v3
|
||||||
// with:
|
// with:
|
||||||
// repository: ${{ github.event.pull_request.head.repo.full_name }}
|
// repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
if (env.GITHUB_EVENT_NAME === 'pull_request_target') {
|
if (github.context.eventName === 'pull_request_target') {
|
||||||
core.warning(
|
core.warning(
|
||||||
'If this pull request is from a forked repository, please set the checkout action `repository` input to the same repository as the pull request.'
|
'If this pull request is from a forked repository, please set the checkout action `repository` input to the same repository as the pull request.'
|
||||||
)
|
)
|
||||||
|
|||||||
68
src/env.ts
68
src/env.ts
@@ -1,80 +1,16 @@
|
|||||||
import {promises as fs} from 'fs'
|
|
||||||
import * as core from '@actions/core'
|
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
|
||||||
GITHUB_EVENT_ACTION: string
|
|
||||||
GITHUB_EVENT_NAME: string
|
|
||||||
GITHUB_EVENT_FORCED: string
|
|
||||||
GITHUB_EVENT_BEFORE: string
|
|
||||||
GITHUB_EVENT_BASE_REF: string
|
|
||||||
GITHUB_EVENT_RELEASE_TARGET_COMMITISH: string
|
|
||||||
GITHUB_EVENT_HEAD_REPO_FORK: string
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: string
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: string
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: string
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_HEAD_REF: string
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_BASE_REF: string
|
|
||||||
GITHUB_REPOSITORY_OWNER: string
|
|
||||||
GITHUB_REPOSITORY: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type GithubEvent = {
|
|
||||||
action?: string
|
|
||||||
forced?: string
|
|
||||||
pull_request?: {
|
|
||||||
head: {
|
|
||||||
ref: string
|
|
||||||
sha: string
|
|
||||||
}
|
|
||||||
base: {
|
|
||||||
ref: string
|
|
||||||
sha: string
|
|
||||||
}
|
|
||||||
number: string
|
|
||||||
}
|
|
||||||
release?: {
|
|
||||||
target_commitish: string
|
|
||||||
}
|
|
||||||
before?: string
|
|
||||||
base_ref?: string
|
|
||||||
head?: {
|
|
||||||
repo?: {
|
|
||||||
fork: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getEnv = async (): Promise<Env> => {
|
export const getEnv = async (): Promise<Env> => {
|
||||||
const eventPath = process.env.GITHUB_EVENT_PATH
|
core.debug(`Process Env: ${JSON.stringify(process.env, null, 2)}`)
|
||||||
let eventJson: GithubEvent = {}
|
|
||||||
|
|
||||||
if (eventPath) {
|
|
||||||
eventJson = JSON.parse(await fs.readFile(eventPath, {encoding: 'utf8'}))
|
|
||||||
}
|
|
||||||
core.debug(`Env: ${JSON.stringify(process.env, null, 2)}`)
|
|
||||||
core.debug(`Event: ${JSON.stringify(eventJson, null, 2)}`)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
GITHUB_EVENT_PULL_REQUEST_HEAD_REF: eventJson.pull_request?.head?.ref || '',
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_BASE_REF: eventJson.pull_request?.base?.ref || '',
|
|
||||||
GITHUB_EVENT_BEFORE: eventJson.before || '',
|
|
||||||
GITHUB_EVENT_BASE_REF: eventJson.base_ref || '',
|
|
||||||
GITHUB_EVENT_RELEASE_TARGET_COMMITISH:
|
|
||||||
eventJson.release?.target_commitish || '',
|
|
||||||
GITHUB_EVENT_HEAD_REPO_FORK: eventJson.head?.repo?.fork || '',
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '',
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '',
|
|
||||||
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: eventJson.pull_request?.head?.sha || '',
|
|
||||||
GITHUB_EVENT_FORCED: eventJson.forced || '',
|
|
||||||
GITHUB_EVENT_ACTION: eventJson.action || '',
|
|
||||||
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 || '',
|
||||||
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE || '',
|
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE || ''
|
||||||
GITHUB_EVENT_NAME: process.env.GITHUB_EVENT_NAME || '',
|
|
||||||
GITHUB_REPOSITORY_OWNER: process.env.GITHUB_REPOSITORY_OWNER || '',
|
|
||||||
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY || ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ export type Inputs = {
|
|||||||
dirNames: boolean
|
dirNames: boolean
|
||||||
dirNamesMaxDepth?: number
|
dirNamesMaxDepth?: number
|
||||||
dirNamesExcludeCurrentDir: boolean
|
dirNamesExcludeCurrentDir: boolean
|
||||||
|
dirNamesIncludeFiles: string
|
||||||
|
dirNamesIncludeFilesSeparator: string
|
||||||
json: boolean
|
json: boolean
|
||||||
escapeJson: boolean
|
escapeJson: boolean
|
||||||
fetchDepth?: number
|
fetchDepth?: number
|
||||||
@@ -38,8 +40,13 @@ export type Inputs = {
|
|||||||
outputRenamedFilesAsDeletedAndAdded: boolean
|
outputRenamedFilesAsDeletedAndAdded: boolean
|
||||||
recoverDeletedFiles: boolean
|
recoverDeletedFiles: boolean
|
||||||
recoverDeletedFilesToDestination: string
|
recoverDeletedFilesToDestination: string
|
||||||
|
recoverFiles: string
|
||||||
|
recoverFilesSeparator: string
|
||||||
|
recoverFilesIgnore: string
|
||||||
|
recoverFilesIgnoreSeparator: string
|
||||||
token: string
|
token: string
|
||||||
apiUrl: string
|
apiUrl: string
|
||||||
|
skipInitialFetch: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getInputs = (): Inputs => {
|
export const getInputs = (): Inputs => {
|
||||||
@@ -130,6 +137,16 @@ export const getInputs = (): Inputs => {
|
|||||||
required: false
|
required: false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
const dirNamesIncludeFiles = core.getInput('dir_names_include_files', {
|
||||||
|
required: false
|
||||||
|
})
|
||||||
|
const dirNamesIncludeFilesSeparator = core.getInput(
|
||||||
|
'dir_names_include_files_separator',
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
trimWhitespace: false
|
||||||
|
}
|
||||||
|
)
|
||||||
const json = core.getBooleanInput('json', {required: false})
|
const json = core.getBooleanInput('json', {required: false})
|
||||||
const escapeJson = core.getBooleanInput('escape_json', {required: false})
|
const escapeJson = core.getBooleanInput('escape_json', {required: false})
|
||||||
const fetchDepth = core.getInput('fetch_depth', {required: false})
|
const fetchDepth = core.getInput('fetch_depth', {required: false})
|
||||||
@@ -152,8 +169,26 @@ export const getInputs = (): Inputs => {
|
|||||||
'recover_deleted_files_to_destination',
|
'recover_deleted_files_to_destination',
|
||||||
{required: false}
|
{required: false}
|
||||||
)
|
)
|
||||||
|
const recoverFiles = core.getInput('recover_files', {required: false})
|
||||||
|
const recoverFilesSeparator = core.getInput('recover_files_separator', {
|
||||||
|
required: false,
|
||||||
|
trimWhitespace: false
|
||||||
|
})
|
||||||
|
const recoverFilesIgnore = core.getInput('recover_files_ignore', {
|
||||||
|
required: false
|
||||||
|
})
|
||||||
|
const recoverFilesIgnoreSeparator = core.getInput(
|
||||||
|
'recover_files_ignore_separator',
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
trimWhitespace: false
|
||||||
|
}
|
||||||
|
)
|
||||||
const token = core.getInput('token', {required: false})
|
const token = core.getInput('token', {required: false})
|
||||||
const apiUrl = core.getInput('api_url', {required: false})
|
const apiUrl = core.getInput('api_url', {required: false})
|
||||||
|
const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', {
|
||||||
|
required: false
|
||||||
|
})
|
||||||
|
|
||||||
const inputs: Inputs = {
|
const inputs: Inputs = {
|
||||||
files,
|
files,
|
||||||
@@ -182,12 +217,19 @@ export const getInputs = (): Inputs => {
|
|||||||
sinceLastRemoteCommit,
|
sinceLastRemoteCommit,
|
||||||
recoverDeletedFiles,
|
recoverDeletedFiles,
|
||||||
recoverDeletedFilesToDestination,
|
recoverDeletedFilesToDestination,
|
||||||
|
recoverFiles,
|
||||||
|
recoverFilesSeparator,
|
||||||
|
recoverFilesIgnore,
|
||||||
|
recoverFilesIgnoreSeparator,
|
||||||
includeAllOldNewRenamedFiles,
|
includeAllOldNewRenamedFiles,
|
||||||
oldNewSeparator,
|
oldNewSeparator,
|
||||||
oldNewFilesSeparator,
|
oldNewFilesSeparator,
|
||||||
|
skipInitialFetch,
|
||||||
// End Not Supported via REST API
|
// End Not Supported via REST API
|
||||||
dirNames,
|
dirNames,
|
||||||
dirNamesExcludeCurrentDir,
|
dirNamesExcludeCurrentDir,
|
||||||
|
dirNamesIncludeFiles,
|
||||||
|
dirNamesIncludeFilesSeparator,
|
||||||
json,
|
json,
|
||||||
escapeJson,
|
escapeJson,
|
||||||
writeOutputFiles,
|
writeOutputFiles,
|
||||||
|
|||||||
255
src/main.ts
255
src/main.ts
@@ -1,6 +1,9 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
|
import * as github from '@actions/github'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import {
|
import {
|
||||||
|
ChangedFiles,
|
||||||
|
ChangeTypeEnum,
|
||||||
getAllDiffFiles,
|
getAllDiffFiles,
|
||||||
getChangedFilesFromGithubAPI,
|
getChangedFilesFromGithubAPI,
|
||||||
getRenamedFiles
|
getRenamedFiles
|
||||||
@@ -8,31 +11,104 @@ import {
|
|||||||
import {setChangedFilesOutput} from './changedFilesOutput'
|
import {setChangedFilesOutput} from './changedFilesOutput'
|
||||||
import {
|
import {
|
||||||
DiffResult,
|
DiffResult,
|
||||||
getSHAForPullRequestEvent,
|
getSHAForNonPullRequestEvent,
|
||||||
getSHAForPushEvent
|
getSHAForPullRequestEvent
|
||||||
} from './commitSha'
|
} from './commitSha'
|
||||||
import {Env, getEnv} from './env'
|
import {Env, getEnv} from './env'
|
||||||
import {getInputs, Inputs} from './inputs'
|
import {getInputs, Inputs} from './inputs'
|
||||||
import {
|
import {
|
||||||
getFilePatterns,
|
getFilePatterns,
|
||||||
|
getFilteredChangedFiles,
|
||||||
|
getRecoverFilePatterns,
|
||||||
getSubmodulePath,
|
getSubmodulePath,
|
||||||
getYamlFilePatterns,
|
getYamlFilePatterns,
|
||||||
hasLocalGitDirectory,
|
hasLocalGitDirectory,
|
||||||
isRepoShallow,
|
isRepoShallow,
|
||||||
|
recoverDeletedFiles,
|
||||||
setOutput,
|
setOutput,
|
||||||
submoduleExists,
|
submoduleExists,
|
||||||
updateGitGlobalConfig,
|
updateGitGlobalConfig,
|
||||||
verifyMinimumGitVersion
|
verifyMinimumGitVersion
|
||||||
} from './utils'
|
} from './utils'
|
||||||
|
|
||||||
|
const changedFilesOutput = async ({
|
||||||
|
filePatterns,
|
||||||
|
allDiffFiles,
|
||||||
|
inputs,
|
||||||
|
yamlFilePatterns
|
||||||
|
}: {
|
||||||
|
filePatterns: string[]
|
||||||
|
allDiffFiles: ChangedFiles
|
||||||
|
inputs: Inputs
|
||||||
|
yamlFilePatterns: Record<string, string[]>
|
||||||
|
}): Promise<void> => {
|
||||||
|
if (filePatterns.length > 0) {
|
||||||
|
core.startGroup('changed-files-patterns')
|
||||||
|
const allFilteredDiffFiles = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns
|
||||||
|
})
|
||||||
|
core.debug(
|
||||||
|
`All filtered diff files: ${JSON.stringify(allFilteredDiffFiles)}`
|
||||||
|
)
|
||||||
|
await setChangedFilesOutput({
|
||||||
|
allDiffFiles,
|
||||||
|
allFilteredDiffFiles,
|
||||||
|
inputs,
|
||||||
|
filePatterns
|
||||||
|
})
|
||||||
|
core.info('All Done!')
|
||||||
|
core.endGroup()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.keys(yamlFilePatterns).length > 0) {
|
||||||
|
for (const key of Object.keys(yamlFilePatterns)) {
|
||||||
|
core.startGroup(`changed-files-yaml-${key}`)
|
||||||
|
const allFilteredDiffFiles = await getFilteredChangedFiles({
|
||||||
|
allDiffFiles,
|
||||||
|
filePatterns: yamlFilePatterns[key]
|
||||||
|
})
|
||||||
|
core.debug(
|
||||||
|
`All filtered diff files for ${key}: ${JSON.stringify(
|
||||||
|
allFilteredDiffFiles
|
||||||
|
)}`
|
||||||
|
)
|
||||||
|
await setChangedFilesOutput({
|
||||||
|
allDiffFiles,
|
||||||
|
allFilteredDiffFiles,
|
||||||
|
inputs,
|
||||||
|
filePatterns: yamlFilePatterns[key],
|
||||||
|
outputPrefix: key
|
||||||
|
})
|
||||||
|
core.info('All Done!')
|
||||||
|
core.endGroup()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
|
||||||
|
core.startGroup('changed-files-all')
|
||||||
|
await setChangedFilesOutput({
|
||||||
|
allDiffFiles,
|
||||||
|
allFilteredDiffFiles: allDiffFiles,
|
||||||
|
inputs
|
||||||
|
})
|
||||||
|
core.info('All Done!')
|
||||||
|
core.endGroup()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getChangedFilesFromLocalGit = async ({
|
const getChangedFilesFromLocalGit = async ({
|
||||||
inputs,
|
inputs,
|
||||||
env,
|
env,
|
||||||
workingDirectory
|
workingDirectory,
|
||||||
|
filePatterns,
|
||||||
|
yamlFilePatterns
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
env: Env
|
env: Env
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
|
filePatterns: string[]
|
||||||
|
yamlFilePatterns: Record<string, string[]>
|
||||||
}): Promise<void> => {
|
}): Promise<void> => {
|
||||||
await verifyMinimumGitVersion()
|
await verifyMinimumGitVersion()
|
||||||
|
|
||||||
@@ -72,9 +148,9 @@ const getChangedFilesFromLocalGit = async ({
|
|||||||
|
|
||||||
let diffResult: DiffResult
|
let diffResult: DiffResult
|
||||||
|
|
||||||
if (!env.GITHUB_EVENT_PULL_REQUEST_BASE_REF) {
|
if (!github.context.payload.pull_request?.base?.ref) {
|
||||||
core.info(`Running on a ${env.GITHUB_EVENT_NAME || 'push'} event...`)
|
core.info(`Running on a ${github.context.eventName || 'push'} event...`)
|
||||||
diffResult = await getSHAForPushEvent(
|
diffResult = await getSHAForNonPullRequestEvent(
|
||||||
inputs,
|
inputs,
|
||||||
env,
|
env,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
@@ -85,8 +161,8 @@ const getChangedFilesFromLocalGit = async ({
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(
|
||||||
`Running on a ${env.GITHUB_EVENT_NAME || 'pull_request'} (${
|
`Running on a ${github.context.eventName || 'pull_request'} (${
|
||||||
env.GITHUB_EVENT_ACTION
|
github.context.payload.action
|
||||||
}) event...`
|
}) event...`
|
||||||
)
|
)
|
||||||
diffResult = await getSHAForPullRequestEvent(
|
diffResult = await getSHAForPullRequestEvent(
|
||||||
@@ -120,59 +196,30 @@ const getChangedFilesFromLocalGit = async ({
|
|||||||
core.info('All Done!')
|
core.info('All Done!')
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
const filePatterns = await getFilePatterns({
|
if (inputs.recoverDeletedFiles) {
|
||||||
inputs,
|
let recoverPatterns = getRecoverFilePatterns({inputs})
|
||||||
workingDirectory
|
|
||||||
})
|
|
||||||
core.debug(`File patterns: ${filePatterns}`)
|
|
||||||
|
|
||||||
if (filePatterns.length > 0) {
|
if (recoverPatterns.length > 0 && filePatterns.length > 0) {
|
||||||
core.startGroup('changed-files-patterns')
|
core.info('No recover patterns found; defaulting to file patterns')
|
||||||
await setChangedFilesOutput({
|
recoverPatterns = filePatterns
|
||||||
allDiffFiles,
|
|
||||||
filePatterns,
|
|
||||||
inputs,
|
|
||||||
workingDirectory,
|
|
||||||
diffResult
|
|
||||||
})
|
|
||||||
core.info('All Done!')
|
|
||||||
core.endGroup()
|
|
||||||
}
|
|
||||||
|
|
||||||
const yamlFilePatterns = await getYamlFilePatterns({
|
|
||||||
inputs,
|
|
||||||
workingDirectory
|
|
||||||
})
|
|
||||||
core.debug(`Yaml file patterns: ${JSON.stringify(yamlFilePatterns)}`)
|
|
||||||
|
|
||||||
if (Object.keys(yamlFilePatterns).length > 0) {
|
|
||||||
for (const key of Object.keys(yamlFilePatterns)) {
|
|
||||||
core.startGroup(`changed-files-yaml-${key}`)
|
|
||||||
await setChangedFilesOutput({
|
|
||||||
allDiffFiles,
|
|
||||||
filePatterns: yamlFilePatterns[key],
|
|
||||||
outputPrefix: key,
|
|
||||||
inputs,
|
|
||||||
workingDirectory,
|
|
||||||
diffResult
|
|
||||||
})
|
|
||||||
core.info('All Done!')
|
|
||||||
core.endGroup()
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
|
await recoverDeletedFiles({
|
||||||
core.startGroup('changed-files-all')
|
|
||||||
await setChangedFilesOutput({
|
|
||||||
allDiffFiles,
|
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
diffResult
|
deletedFiles: allDiffFiles[ChangeTypeEnum.Deleted],
|
||||||
|
recoverPatterns,
|
||||||
|
sha: diffResult.previousSha
|
||||||
})
|
})
|
||||||
core.info('All Done!')
|
|
||||||
core.endGroup()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await changedFilesOutput({
|
||||||
|
filePatterns,
|
||||||
|
allDiffFiles,
|
||||||
|
inputs,
|
||||||
|
yamlFilePatterns
|
||||||
|
})
|
||||||
|
|
||||||
if (inputs.includeAllOldNewRenamedFiles) {
|
if (inputs.includeAllOldNewRenamedFiles) {
|
||||||
core.startGroup('changed-files-all-old-new-renamed-files')
|
core.startGroup('changed-files-all-old-new-renamed-files')
|
||||||
const allOldNewRenamedFiles = await getRenamedFiles({
|
const allOldNewRenamedFiles = await getRenamedFiles({
|
||||||
@@ -200,69 +247,25 @@ const getChangedFilesFromLocalGit = async ({
|
|||||||
|
|
||||||
const getChangedFilesFromRESTAPI = async ({
|
const getChangedFilesFromRESTAPI = async ({
|
||||||
inputs,
|
inputs,
|
||||||
env,
|
filePatterns,
|
||||||
workingDirectory
|
yamlFilePatterns
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
env: Env
|
filePatterns: string[]
|
||||||
workingDirectory: string
|
yamlFilePatterns: Record<string, string[]>
|
||||||
}): Promise<void> => {
|
}): Promise<void> => {
|
||||||
const allDiffFiles = await getChangedFilesFromGithubAPI({
|
const allDiffFiles = await getChangedFilesFromGithubAPI({
|
||||||
inputs,
|
inputs
|
||||||
env
|
|
||||||
})
|
})
|
||||||
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`)
|
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`)
|
||||||
core.info('All Done!')
|
core.info('All Done!')
|
||||||
|
|
||||||
const filePatterns = await getFilePatterns({
|
await changedFilesOutput({
|
||||||
|
filePatterns,
|
||||||
|
allDiffFiles,
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory
|
yamlFilePatterns
|
||||||
})
|
})
|
||||||
core.debug(`File patterns: ${filePatterns}`)
|
|
||||||
|
|
||||||
if (filePatterns.length > 0) {
|
|
||||||
core.startGroup('changed-files-patterns')
|
|
||||||
await setChangedFilesOutput({
|
|
||||||
allDiffFiles,
|
|
||||||
filePatterns,
|
|
||||||
inputs,
|
|
||||||
workingDirectory
|
|
||||||
})
|
|
||||||
core.info('All Done!')
|
|
||||||
core.endGroup()
|
|
||||||
}
|
|
||||||
|
|
||||||
const yamlFilePatterns = await getYamlFilePatterns({
|
|
||||||
inputs,
|
|
||||||
workingDirectory
|
|
||||||
})
|
|
||||||
core.debug(`Yaml file patterns: ${JSON.stringify(yamlFilePatterns)}`)
|
|
||||||
|
|
||||||
if (Object.keys(yamlFilePatterns).length > 0) {
|
|
||||||
for (const key of Object.keys(yamlFilePatterns)) {
|
|
||||||
core.startGroup(`changed-files-yaml-${key}`)
|
|
||||||
await setChangedFilesOutput({
|
|
||||||
allDiffFiles,
|
|
||||||
filePatterns: yamlFilePatterns[key],
|
|
||||||
outputPrefix: key,
|
|
||||||
inputs,
|
|
||||||
workingDirectory
|
|
||||||
})
|
|
||||||
core.info('All Done!')
|
|
||||||
core.endGroup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
|
|
||||||
core.startGroup('changed-files-all')
|
|
||||||
await setChangedFilesOutput({
|
|
||||||
allDiffFiles,
|
|
||||||
inputs,
|
|
||||||
workingDirectory
|
|
||||||
})
|
|
||||||
core.info('All Done!')
|
|
||||||
core.endGroup()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
@@ -270,17 +273,36 @@ export async function run(): Promise<void> {
|
|||||||
|
|
||||||
const env = await getEnv()
|
const env = await getEnv()
|
||||||
core.debug(`Env: ${JSON.stringify(env, null, 2)}`)
|
core.debug(`Env: ${JSON.stringify(env, null, 2)}`)
|
||||||
|
|
||||||
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.path
|
inputs.path
|
||||||
)
|
)
|
||||||
|
core.debug(`Working directory: ${workingDirectory}`)
|
||||||
|
|
||||||
const hasGitDirectory = await hasLocalGitDirectory({workingDirectory})
|
const hasGitDirectory = await hasLocalGitDirectory({workingDirectory})
|
||||||
|
core.debug(`Has git directory: ${hasGitDirectory}`)
|
||||||
|
|
||||||
|
const filePatterns = await getFilePatterns({
|
||||||
|
inputs,
|
||||||
|
workingDirectory
|
||||||
|
})
|
||||||
|
core.debug(`File patterns: ${filePatterns}`)
|
||||||
|
|
||||||
|
const yamlFilePatterns = await getYamlFilePatterns({
|
||||||
|
inputs,
|
||||||
|
workingDirectory
|
||||||
|
})
|
||||||
|
core.debug(`Yaml file patterns: ${JSON.stringify(yamlFilePatterns)}`)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
inputs.token &&
|
inputs.token &&
|
||||||
env.GITHUB_EVENT_PULL_REQUEST_NUMBER &&
|
github.context.payload.pull_request?.number &&
|
||||||
!hasGitDirectory
|
!hasGitDirectory
|
||||||
) {
|
) {
|
||||||
core.info("Using GitHub's REST API to get changed files")
|
core.info("Using GitHub's REST API to get changed files")
|
||||||
@@ -292,7 +314,10 @@ export async function run(): Promise<void> {
|
|||||||
'sinceLastRemoteCommit',
|
'sinceLastRemoteCommit',
|
||||||
'recoverDeletedFiles',
|
'recoverDeletedFiles',
|
||||||
'recoverDeletedFilesToDestination',
|
'recoverDeletedFilesToDestination',
|
||||||
'includeAllOldNewRenamedFiles'
|
'recoverFiles',
|
||||||
|
'recoverFilesIgnore',
|
||||||
|
'includeAllOldNewRenamedFiles',
|
||||||
|
'skipInitialFetch'
|
||||||
]
|
]
|
||||||
|
|
||||||
for (const input of unsupportedInputs) {
|
for (const input of unsupportedInputs) {
|
||||||
@@ -302,7 +327,11 @@ export async function run(): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await getChangedFilesFromRESTAPI({inputs, env, workingDirectory})
|
await getChangedFilesFromRESTAPI({
|
||||||
|
inputs,
|
||||||
|
filePatterns,
|
||||||
|
yamlFilePatterns
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
if (!hasGitDirectory) {
|
if (!hasGitDirectory) {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
@@ -312,7 +341,13 @@ export async function run(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
core.info('Using local .git directory')
|
core.info('Using local .git directory')
|
||||||
await getChangedFilesFromLocalGit({inputs, env, workingDirectory})
|
await getChangedFilesFromLocalGit({
|
||||||
|
inputs,
|
||||||
|
env,
|
||||||
|
workingDirectory,
|
||||||
|
filePatterns,
|
||||||
|
yamlFilePatterns
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
325
src/utils.ts
325
src/utils.ts
@@ -12,17 +12,20 @@ import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
|
|||||||
|
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
|
|
||||||
const IS_WINDOWS = process.platform === 'win32'
|
|
||||||
const MINIMUM_GIT_VERSION = '2.18.0'
|
const MINIMUM_GIT_VERSION = '2.18.0'
|
||||||
|
|
||||||
|
export const isWindows = (): boolean => {
|
||||||
|
return process.platform === 'win32'
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normalize file path separators to '/' on Windows and Linux/macOS
|
* Normalize file path separators to '/' on Linux/macOS and '\\' on Windows
|
||||||
* @param p file path
|
* @param p - file path
|
||||||
* @returns file path with normalized separators
|
* @returns file path with normalized separators
|
||||||
*/
|
*/
|
||||||
const normalizeSeparators = (p: string): string => {
|
export const normalizeSeparators = (p: string): string => {
|
||||||
// Windows
|
// Windows
|
||||||
if (IS_WINDOWS) {
|
if (isWindows()) {
|
||||||
// Convert slashes on Windows
|
// Convert slashes on Windows
|
||||||
p = p.replace(/\//g, '\\')
|
p = p.replace(/\//g, '\\')
|
||||||
|
|
||||||
@@ -37,7 +40,7 @@ const normalizeSeparators = (p: string): string => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Trims unnecessary trailing slash from file path
|
* Trims unnecessary trailing slash from file path
|
||||||
* @param p file path
|
* @param p - file path
|
||||||
* @returns file path without unnecessary trailing slash
|
* @returns file path without unnecessary trailing slash
|
||||||
*/
|
*/
|
||||||
const safeTrimTrailingSeparator = (p: string): string => {
|
const safeTrimTrailingSeparator = (p: string): string => {
|
||||||
@@ -60,7 +63,7 @@ const safeTrimTrailingSeparator = (p: string): string => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On Windows, avoid trimming the drive root, e.g. C:\ or \\hello
|
// On Windows, avoid trimming the drive root, e.g. C:\ or \\hello
|
||||||
if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) {
|
if (isWindows() && /^[A-Z]:\\$/i.test(p)) {
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,12 +71,18 @@ const safeTrimTrailingSeparator = (p: string): string => {
|
|||||||
return p.substring(0, p.length - 1)
|
return p.substring(0, p.length - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const dirname = (p: string): string => {
|
/**
|
||||||
|
* Gets the dirname of a path, similar to the Node.js path.dirname() function except that this function
|
||||||
|
* also works for Windows UNC root paths, e.g. \\hello\world
|
||||||
|
* @param p - file path
|
||||||
|
* @returns dirname of path
|
||||||
|
*/
|
||||||
|
export const getDirname = (p: string): string => {
|
||||||
// Normalize slashes and trim unnecessary trailing slash
|
// Normalize slashes and trim unnecessary trailing slash
|
||||||
p = safeTrimTrailingSeparator(p)
|
p = safeTrimTrailingSeparator(p)
|
||||||
|
|
||||||
// Windows UNC root, e.g. \\hello or \\hello\world
|
// Windows UNC root, e.g. \\hello or \\hello\world
|
||||||
if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) {
|
if (isWindows() && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) {
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,18 +90,31 @@ const dirname = (p: string): string => {
|
|||||||
let result = path.dirname(p)
|
let result = path.dirname(p)
|
||||||
|
|
||||||
// Trim trailing slash for Windows UNC root, e.g. \\hello\world\
|
// Trim trailing slash for Windows UNC root, e.g. \\hello\world\
|
||||||
if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) {
|
if (isWindows() && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) {
|
||||||
result = safeTrimTrailingSeparator(result)
|
result = safeTrimTrailingSeparator(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts the version string to a number
|
||||||
|
* @param version - version string
|
||||||
|
* @returns version number
|
||||||
|
*/
|
||||||
const versionToNumber = (version: string): number => {
|
const versionToNumber = (version: string): number => {
|
||||||
const [major, minor, patch] = version.split('.').map(Number)
|
const [major, minor, patch] = version.split('.').map(Number)
|
||||||
return major * 1000000 + minor * 1000 + patch
|
return major * 1000000 + minor * 1000 + patch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies the minimum required git version
|
||||||
|
* @returns minimum required git version
|
||||||
|
* @throws Minimum git version requirement is not met
|
||||||
|
* @throws Git is not installed
|
||||||
|
* @throws Git is not found in PATH
|
||||||
|
* @throws An unexpected error occurred
|
||||||
|
*/
|
||||||
export const verifyMinimumGitVersion = async (): Promise<void> => {
|
export const verifyMinimumGitVersion = async (): Promise<void> => {
|
||||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
@@ -113,6 +135,11 @@ export const verifyMinimumGitVersion = async (): Promise<void> => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a path exists
|
||||||
|
* @param filePath - path to check
|
||||||
|
* @returns path exists
|
||||||
|
*/
|
||||||
const exists = async (filePath: string): Promise<boolean> => {
|
const exists = async (filePath: string): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
await fs.access(filePath)
|
await fs.access(filePath)
|
||||||
@@ -122,6 +149,11 @@ const exists = async (filePath: string): Promise<boolean> => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates lines of a file as an async iterable iterator
|
||||||
|
* @param filePath - path of file to read
|
||||||
|
* @param excludedFiles - whether to exclude files
|
||||||
|
*/
|
||||||
async function* lineOfFileGenerator({
|
async function* lineOfFileGenerator({
|
||||||
filePath,
|
filePath,
|
||||||
excludedFiles
|
excludedFiles
|
||||||
@@ -153,6 +185,11 @@ async function* lineOfFileGenerator({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the file patterns from a source file
|
||||||
|
* @param filePaths - paths of files to read
|
||||||
|
* @param excludedFiles - whether to exclude the file patterns
|
||||||
|
*/
|
||||||
const getFilesFromSourceFile = async ({
|
const getFilesFromSourceFile = async ({
|
||||||
filePaths,
|
filePaths,
|
||||||
excludedFiles = false
|
excludedFiles = false
|
||||||
@@ -169,6 +206,12 @@ const getFilesFromSourceFile = async ({
|
|||||||
return lines
|
return lines
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the global git configs
|
||||||
|
* @param name - name of config
|
||||||
|
* @param value - value of config
|
||||||
|
* @throws Couldn't update git global config
|
||||||
|
*/
|
||||||
export const updateGitGlobalConfig = async ({
|
export const updateGitGlobalConfig = async ({
|
||||||
name,
|
name,
|
||||||
value
|
value
|
||||||
@@ -191,6 +234,11 @@ export const updateGitGlobalConfig = async ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a git repository is shallow
|
||||||
|
* @param cwd - working directory
|
||||||
|
* @returns repository is shallow
|
||||||
|
*/
|
||||||
export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
|
export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
|
||||||
const {stdout} = await exec.getExecOutput(
|
const {stdout} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
@@ -204,6 +252,11 @@ export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
|
|||||||
return stdout.trim() === 'true'
|
return stdout.trim() === 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a submodule exists
|
||||||
|
* @param cwd - working directory
|
||||||
|
* @returns submodule exists
|
||||||
|
*/
|
||||||
export const submoduleExists = async ({
|
export const submoduleExists = async ({
|
||||||
cwd
|
cwd
|
||||||
}: {
|
}: {
|
||||||
@@ -227,6 +280,11 @@ export const submoduleExists = async ({
|
|||||||
return stdout.trim() !== ''
|
return stdout.trim() !== ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches the git repository
|
||||||
|
* @param args - arguments for fetch command
|
||||||
|
* @param cwd - working directory
|
||||||
|
*/
|
||||||
export const gitFetch = async ({
|
export const gitFetch = async ({
|
||||||
args,
|
args,
|
||||||
cwd
|
cwd
|
||||||
@@ -243,6 +301,11 @@ export const gitFetch = async ({
|
|||||||
return exitCode
|
return exitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches the git repository submodules
|
||||||
|
* @param args - arguments for fetch command
|
||||||
|
* @param cwd - working directory
|
||||||
|
*/
|
||||||
export const gitFetchSubmodules = async ({
|
export const gitFetchSubmodules = async ({
|
||||||
args,
|
args,
|
||||||
cwd
|
cwd
|
||||||
@@ -266,10 +329,10 @@ export const gitFetchSubmodules = async ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const normalizePath = (p: string): string => {
|
/**
|
||||||
return p.replace(/\\/g, '/')
|
* Retrieves all the submodule paths
|
||||||
}
|
* @param cwd - working directory
|
||||||
|
*/
|
||||||
export const getSubmodulePath = async ({
|
export const getSubmodulePath = async ({
|
||||||
cwd
|
cwd
|
||||||
}: {
|
}: {
|
||||||
@@ -293,9 +356,17 @@ export const getSubmodulePath = async ({
|
|||||||
return stdout
|
return stdout
|
||||||
.trim()
|
.trim()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map((line: string) => normalizePath(line.split(' ')[1]))
|
.map((line: string) => normalizeSeparators(line.trim().split(' ')[1]))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves commit sha of a submodule from a parent commit
|
||||||
|
* @param cwd - working directory
|
||||||
|
* @param parentSha1 - parent commit sha
|
||||||
|
* @param parentSha2 - parent commit sha
|
||||||
|
* @param submodulePath - path of submodule
|
||||||
|
* @param diff - diff type between parent commits (`..` or `...`)
|
||||||
|
*/
|
||||||
export const gitSubmoduleDiffSHA = async ({
|
export const gitSubmoduleDiffSHA = async ({
|
||||||
cwd,
|
cwd,
|
||||||
parentSha1,
|
parentSha1,
|
||||||
@@ -311,7 +382,7 @@ export const gitSubmoduleDiffSHA = async ({
|
|||||||
}): Promise<{previousSha?: string; currentSha?: string}> => {
|
}): Promise<{previousSha?: string; currentSha?: string}> => {
|
||||||
const {stdout} = await exec.getExecOutput(
|
const {stdout} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['diff', parentSha1, parentSha2, '--', submodulePath],
|
['diff', `${parentSha1}${diff}${parentSha2}`, '--', submodulePath],
|
||||||
{
|
{
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@@ -398,16 +469,28 @@ export const gitRenamedFiles = async ({
|
|||||||
core.debug(`Renamed file: ${line}`)
|
core.debug(`Renamed file: ${line}`)
|
||||||
const [, oldPath, newPath] = line.split('\t')
|
const [, oldPath, newPath] = line.split('\t')
|
||||||
if (isSubmodule) {
|
if (isSubmodule) {
|
||||||
return `${normalizePath(
|
return `${normalizeSeparators(
|
||||||
path.join(parentDir, oldPath)
|
path.join(parentDir, oldPath)
|
||||||
)}${oldNewSeparator}${normalizePath(path.join(parentDir, newPath))}`
|
)}${oldNewSeparator}${normalizeSeparators(
|
||||||
|
path.join(parentDir, newPath)
|
||||||
|
)}`
|
||||||
}
|
}
|
||||||
return `${normalizePath(oldPath)}${oldNewSeparator}${normalizePath(
|
return `${normalizeSeparators(
|
||||||
newPath
|
oldPath
|
||||||
)}`
|
)}${oldNewSeparator}${normalizeSeparators(newPath)}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all the changed files between two commits
|
||||||
|
* @param cwd - working directory
|
||||||
|
* @param sha1 - commit sha
|
||||||
|
* @param sha2 - commit sha
|
||||||
|
* @param diff - diff type between parent commits (`..` or `...`)
|
||||||
|
* @param isSubmodule - is the repo a submodule
|
||||||
|
* @param parentDir - parent directory of the submodule
|
||||||
|
* @param outputRenamedFilesAsDeletedAndAdded - output renamed files as deleted and added
|
||||||
|
*/
|
||||||
export const getAllChangedFiles = async ({
|
export const getAllChangedFiles = async ({
|
||||||
cwd,
|
cwd,
|
||||||
sha1,
|
sha1,
|
||||||
@@ -474,11 +557,11 @@ export const getAllChangedFiles = async ({
|
|||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
const [changeType, filePath, newPath = ''] = line.split('\t')
|
const [changeType, filePath, newPath = ''] = line.split('\t')
|
||||||
const normalizedFilePath = isSubmodule
|
const normalizedFilePath = isSubmodule
|
||||||
? normalizePath(path.join(parentDir, filePath))
|
? normalizeSeparators(path.join(parentDir, filePath))
|
||||||
: normalizePath(filePath)
|
: normalizeSeparators(filePath)
|
||||||
const normalizedNewPath = isSubmodule
|
const normalizedNewPath = isSubmodule
|
||||||
? normalizePath(path.join(parentDir, newPath))
|
? normalizeSeparators(path.join(parentDir, newPath))
|
||||||
: normalizePath(newPath)
|
: normalizeSeparators(newPath)
|
||||||
|
|
||||||
if (changeType.startsWith('R')) {
|
if (changeType.startsWith('R')) {
|
||||||
if (outputRenamedFilesAsDeletedAndAdded) {
|
if (outputRenamedFilesAsDeletedAndAdded) {
|
||||||
@@ -494,6 +577,11 @@ export const getAllChangedFiles = async ({
|
|||||||
return changedFiles
|
return changedFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters the changed files by the file patterns
|
||||||
|
* @param allDiffFiles - all the changed files
|
||||||
|
* @param filePatterns - file patterns to filter by
|
||||||
|
*/
|
||||||
export const getFilteredChangedFiles = async ({
|
export const getFilteredChangedFiles = async ({
|
||||||
allDiffFiles,
|
allDiffFiles,
|
||||||
filePatterns
|
filePatterns
|
||||||
@@ -512,15 +600,16 @@ export const getFilteredChangedFiles = async ({
|
|||||||
[ChangeTypeEnum.Unknown]: []
|
[ChangeTypeEnum.Unknown]: []
|
||||||
}
|
}
|
||||||
const hasFilePatterns = filePatterns.length > 0
|
const hasFilePatterns = filePatterns.length > 0
|
||||||
|
const isWin = isWindows()
|
||||||
|
|
||||||
for (const changeType of Object.keys(allDiffFiles)) {
|
for (const changeType of Object.keys(allDiffFiles)) {
|
||||||
const files = allDiffFiles[changeType as ChangeTypeEnum]
|
const files = allDiffFiles[changeType as ChangeTypeEnum]
|
||||||
if (hasFilePatterns) {
|
if (hasFilePatterns) {
|
||||||
changedFiles[changeType as ChangeTypeEnum] = mm(files, filePatterns, {
|
changedFiles[changeType as ChangeTypeEnum] = mm(files, filePatterns, {
|
||||||
dot: true,
|
dot: true,
|
||||||
windows: IS_WINDOWS,
|
windows: isWin,
|
||||||
noext: true
|
noext: true
|
||||||
})
|
}).map(normalizeSeparators)
|
||||||
} else {
|
} else {
|
||||||
changedFiles[changeType as ChangeTypeEnum] = files
|
changedFiles[changeType as ChangeTypeEnum] = files
|
||||||
}
|
}
|
||||||
@@ -650,7 +739,7 @@ export const getPreviousGitTag = async ({
|
|||||||
}): Promise<{tag: string; sha: string}> => {
|
}): Promise<{tag: string; sha: string}> => {
|
||||||
const {stdout} = await exec.getExecOutput(
|
const {stdout} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['tag', '--sort=-version:refname'],
|
['tag', '--sort=-creatordate'],
|
||||||
{
|
{
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@@ -691,9 +780,58 @@ export const canDiffCommits = async ({
|
|||||||
sha2: string
|
sha2: string
|
||||||
diff: string
|
diff: string
|
||||||
}): Promise<boolean> => {
|
}): Promise<boolean> => {
|
||||||
const {exitCode, stderr} = await exec.getExecOutput(
|
if (diff === '...') {
|
||||||
|
const mergeBase = await getMergeBase(cwd, sha1, sha2)
|
||||||
|
|
||||||
|
if (!mergeBase) {
|
||||||
|
core.warning(`Unable to find merge base between ${sha1} and ${sha2}`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
const {exitCode, stderr} = await exec.getExecOutput(
|
||||||
|
'git',
|
||||||
|
['log', '--format=%H', `${mergeBase}..${sha2}`],
|
||||||
|
{
|
||||||
|
cwd,
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
silent: !core.isDebug()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (exitCode !== 0) {
|
||||||
|
core.warning(stderr || `Error checking commit history`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
const {exitCode, stderr} = await exec.getExecOutput(
|
||||||
|
'git',
|
||||||
|
['diff', '--quiet', sha1, sha2],
|
||||||
|
{
|
||||||
|
cwd,
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
silent: !core.isDebug()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (exitCode !== 0) {
|
||||||
|
core.warning(stderr || `Error checking commit history`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getMergeBase = async (
|
||||||
|
cwd: string,
|
||||||
|
sha1: string,
|
||||||
|
sha2: string
|
||||||
|
): Promise<string | null> => {
|
||||||
|
const {exitCode, stdout} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`],
|
['merge-base', sha1, sha2],
|
||||||
{
|
{
|
||||||
cwd,
|
cwd,
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
@@ -702,23 +840,22 @@ export const canDiffCommits = async ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
core.warning(stderr || `Unable find merge base between ${sha1} and ${sha2}`)
|
return null
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return stdout.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getDirnameMaxDepth = ({
|
export const getDirnameMaxDepth = ({
|
||||||
pathStr,
|
relativePath,
|
||||||
dirNamesMaxDepth,
|
dirNamesMaxDepth,
|
||||||
excludeCurrentDir
|
excludeCurrentDir
|
||||||
}: {
|
}: {
|
||||||
pathStr: string
|
relativePath: string
|
||||||
dirNamesMaxDepth?: number
|
dirNamesMaxDepth?: number
|
||||||
excludeCurrentDir?: boolean
|
excludeCurrentDir?: boolean
|
||||||
}): string => {
|
}): string => {
|
||||||
const pathArr = dirname(pathStr).split(path.sep)
|
const pathArr = getDirname(relativePath).split(path.sep)
|
||||||
const maxDepth = Math.min(dirNamesMaxDepth || pathArr.length, pathArr.length)
|
const maxDepth = Math.min(dirNamesMaxDepth || pathArr.length, pathArr.length)
|
||||||
let output = pathArr[0]
|
let output = pathArr[0]
|
||||||
|
|
||||||
@@ -730,7 +867,7 @@ export const getDirnameMaxDepth = ({
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
return normalizePath(output)
|
return normalizeSeparators(output)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const jsonOutput = ({
|
export const jsonOutput = ({
|
||||||
@@ -745,6 +882,16 @@ export const jsonOutput = ({
|
|||||||
return shouldEscape ? result.replace(/"/g, '\\"') : result
|
return shouldEscape ? result.replace(/"/g, '\\"') : result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getDirNamesIncludeFilesPattern = ({
|
||||||
|
inputs
|
||||||
|
}: {
|
||||||
|
inputs: Inputs
|
||||||
|
}): string[] => {
|
||||||
|
return inputs.dirNamesIncludeFiles
|
||||||
|
.split(inputs.dirNamesIncludeFilesSeparator)
|
||||||
|
.filter(Boolean)
|
||||||
|
}
|
||||||
|
|
||||||
export const getFilePatterns = async ({
|
export const getFilePatterns = async ({
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory
|
workingDirectory
|
||||||
@@ -754,7 +901,7 @@ export const getFilePatterns = async ({
|
|||||||
}): Promise<string[]> => {
|
}): Promise<string[]> => {
|
||||||
let filePatterns = inputs.files
|
let filePatterns = inputs.files
|
||||||
.split(inputs.filesSeparator)
|
.split(inputs.filesSeparator)
|
||||||
.filter(p => p !== '')
|
.filter(Boolean)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
|
|
||||||
if (inputs.filesFromSourceFile !== '') {
|
if (inputs.filesFromSourceFile !== '') {
|
||||||
@@ -815,12 +962,12 @@ export const getFilePatterns = async ({
|
|||||||
filePatterns = filePatterns.concat('\n', filesIgnoreFromSourceFiles)
|
filePatterns = filePatterns.concat('\n', filesIgnoreFromSourceFiles)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_WINDOWS) {
|
if (isWindows()) {
|
||||||
filePatterns = filePatterns.replace(/\r\n/g, '\n')
|
filePatterns = filePatterns.replace(/\r\n/g, '\n')
|
||||||
filePatterns = filePatterns.replace(/\r/g, '\n')
|
filePatterns = filePatterns.replace(/\r/g, '\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(`file patterns: ${filePatterns}`)
|
core.debug(`Input file patterns: ${filePatterns}`)
|
||||||
|
|
||||||
return filePatterns
|
return filePatterns
|
||||||
.trim()
|
.trim()
|
||||||
@@ -830,10 +977,10 @@ export const getFilePatterns = async ({
|
|||||||
if (pattern.endsWith('/')) {
|
if (pattern.endsWith('/')) {
|
||||||
return `${pattern}**`
|
return `${pattern}**`
|
||||||
} else {
|
} else {
|
||||||
const pathParts = pattern.split(path.sep)
|
const pathParts = pattern.split('/')
|
||||||
const lastPart = pathParts[pathParts.length - 1]
|
const lastPart = pathParts[pathParts.length - 1]
|
||||||
if (!lastPart.includes('.')) {
|
if (!lastPart.includes('.') && !lastPart.includes('*')) {
|
||||||
return `${pattern}${path.sep}**`
|
return `${pattern}/**`
|
||||||
} else {
|
} else {
|
||||||
return pattern
|
return pattern
|
||||||
}
|
}
|
||||||
@@ -893,17 +1040,17 @@ const getYamlFilePatternsFromContents = async ({
|
|||||||
|
|
||||||
if (doc.errors.length > 0) {
|
if (doc.errors.length > 0) {
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
core.warning(`YAML errors in ${filePath}: ${doc.errors}`)
|
throw new Error(`YAML errors in ${filePath}: ${doc.errors}`)
|
||||||
} else {
|
} else {
|
||||||
core.warning(`YAML errors: ${doc.errors}`)
|
throw new Error(`YAML errors: ${doc.errors}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc.warnings.length > 0) {
|
if (doc.warnings.length > 0) {
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
core.warning(`YAML warnings in ${filePath}: ${doc.warnings}`)
|
throw new Error(`YAML warnings in ${filePath}: ${doc.warnings}`)
|
||||||
} else {
|
} else {
|
||||||
core.warning(`YAML warnings: ${doc.warnings}`)
|
throw new Error(`YAML warnings: ${doc.warnings}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1028,6 +1175,36 @@ export const getYamlFilePatterns = async ({
|
|||||||
return filePatterns
|
return filePatterns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getRecoverFilePatterns = ({
|
||||||
|
inputs
|
||||||
|
}: {
|
||||||
|
inputs: Inputs
|
||||||
|
}): string[] => {
|
||||||
|
let filePatterns: string[] = inputs.recoverFiles.split(
|
||||||
|
inputs.recoverFilesSeparator
|
||||||
|
)
|
||||||
|
|
||||||
|
if (inputs.recoverFilesIgnore) {
|
||||||
|
const ignoreFilePatterns = inputs.recoverFilesIgnore.split(
|
||||||
|
inputs.recoverFilesSeparator
|
||||||
|
)
|
||||||
|
|
||||||
|
filePatterns = filePatterns.concat(
|
||||||
|
ignoreFilePatterns.map(p => {
|
||||||
|
if (p.startsWith('!')) {
|
||||||
|
return p
|
||||||
|
} else {
|
||||||
|
return `!${p}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
core.debug(`recover file patterns: ${filePatterns}`)
|
||||||
|
|
||||||
|
return filePatterns.filter(Boolean)
|
||||||
|
}
|
||||||
|
|
||||||
export const setOutput = async ({
|
export const setOutput = async ({
|
||||||
key,
|
key,
|
||||||
value,
|
value,
|
||||||
@@ -1084,36 +1261,48 @@ export const recoverDeletedFiles = async ({
|
|||||||
inputs,
|
inputs,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
deletedFiles,
|
deletedFiles,
|
||||||
|
recoverPatterns,
|
||||||
sha
|
sha
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
deletedFiles: string[]
|
deletedFiles: string[]
|
||||||
|
recoverPatterns: string[]
|
||||||
sha: string
|
sha: string
|
||||||
}): Promise<void> => {
|
}): Promise<void> => {
|
||||||
if (inputs.recoverDeletedFiles) {
|
let recoverableDeletedFiles = deletedFiles
|
||||||
for (const deletedFile of deletedFiles) {
|
core.debug(`recoverable deleted files: ${recoverableDeletedFiles}`)
|
||||||
let target = path.join(workingDirectory, deletedFile)
|
|
||||||
|
|
||||||
if (inputs.recoverDeletedFilesToDestination) {
|
if (recoverPatterns.length > 0) {
|
||||||
target = path.join(
|
recoverableDeletedFiles = mm(deletedFiles, recoverPatterns, {
|
||||||
workingDirectory,
|
dot: true,
|
||||||
inputs.recoverDeletedFilesToDestination,
|
windows: isWindows(),
|
||||||
deletedFile
|
noext: true
|
||||||
)
|
})
|
||||||
}
|
core.debug(`filtered recoverable deleted files: ${recoverableDeletedFiles}`)
|
||||||
|
}
|
||||||
|
|
||||||
const deletedFileContents = await getDeletedFileContents({
|
for (const deletedFile of recoverableDeletedFiles) {
|
||||||
cwd: workingDirectory,
|
let target = path.join(workingDirectory, deletedFile)
|
||||||
filePath: deletedFile,
|
|
||||||
sha
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!(await exists(path.dirname(target)))) {
|
if (inputs.recoverDeletedFilesToDestination) {
|
||||||
await fs.mkdir(path.dirname(target), {recursive: true})
|
target = path.join(
|
||||||
}
|
workingDirectory,
|
||||||
await fs.writeFile(target, deletedFileContents)
|
inputs.recoverDeletedFilesToDestination,
|
||||||
|
deletedFile
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deletedFileContents = await getDeletedFileContents({
|
||||||
|
cwd: workingDirectory,
|
||||||
|
filePath: deletedFile,
|
||||||
|
sha
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!(await exists(path.dirname(target)))) {
|
||||||
|
await fs.mkdir(path.dirname(target), {recursive: true})
|
||||||
|
}
|
||||||
|
await fs.writeFile(target, deletedFileContents)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,9 +1311,7 @@ export const hasLocalGitDirectory = async ({
|
|||||||
}: {
|
}: {
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
}): Promise<boolean> => {
|
}): Promise<boolean> => {
|
||||||
const insideWorkTree = await isInsideWorkTree({
|
return await isInsideWorkTree({
|
||||||
cwd: workingDirectory
|
cwd: workingDirectory
|
||||||
})
|
})
|
||||||
|
|
||||||
return insideWorkTree
|
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule test/demo updated: 83ccca9b63...e168fac86c
Reference in New Issue
Block a user