Compare commits
145 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
2106eb4457 | ||
|
|
4afe0ab671 | ||
|
|
5768dd7d22 | ||
|
|
648f9c1aaf | ||
|
|
e5efec47f6 | ||
|
|
d6d7cb291e | ||
|
|
5817a9efb0 | ||
|
|
33d50af03f | ||
|
|
a4cd522ee2 | ||
|
|
a553a029f5 | ||
|
|
faa5db4b1d | ||
|
|
63f203d400 | ||
|
|
fd5b3a411d | ||
|
|
c4a394a9cf | ||
|
|
50ae49b0e4 | ||
|
|
588d46e858 | ||
|
|
bdeaa9108c | ||
|
|
4d8812d205 | ||
|
|
668fd3a713 | ||
|
|
b952f3beb3 | ||
|
|
ce8bc5d49a | ||
|
|
9ff3603359 | ||
|
|
54479c37f5 | ||
|
|
6d89069134 | ||
|
|
3bbaba4ae7 | ||
|
|
18c62c592a | ||
|
|
c39b06f825 | ||
|
|
4c2f8eda37 | ||
|
|
2c8123e91e | ||
|
|
e1754a427f | ||
|
|
f573054697 | ||
|
|
c3c3db7fee | ||
|
|
480e87dd66 | ||
|
|
7fcd53ac00 | ||
|
|
749fe3bb28 | ||
|
|
d7af20bab3 | ||
|
|
690b721958 | ||
|
|
77f9e6c7c6 | ||
|
|
c82a34e7e5 | ||
|
|
7a1c64e8b1 | ||
|
|
71290f02ff | ||
|
|
ecf455a884 | ||
|
|
432e0c810c | ||
|
|
fcdeb5b3d7 | ||
|
|
01e83d6024 | ||
|
|
c706c70eed | ||
|
|
d4f86e9d16 | ||
|
|
d9105a4631 | ||
|
|
0621d936c0 | ||
|
|
024cd58ac6 | ||
|
|
c9a1c56f6d | ||
|
|
54a8c99a03 | ||
|
|
9bf09145c3 | ||
|
|
c25c77a67a | ||
|
|
ea90b5ced9 | ||
|
|
d144c0c92d | ||
|
|
341b80da8b | ||
|
|
6cf9c8246e | ||
|
|
955946132d | ||
|
|
1f2cb3b00f | ||
|
|
c9124514c3 | ||
|
|
90ef0b1b22 | ||
|
|
c648759d89 | ||
|
|
b9ea510e42 | ||
|
|
174a2a6360 | ||
|
|
2d0b52f440 | ||
|
|
d0e3a7c3aa | ||
|
|
2c6893c21a | ||
|
|
17ca5bb3e5 | ||
|
|
61845c2b19 | ||
|
|
417f924dea | ||
|
|
c51a48d4f6 | ||
|
|
a625ca325f | ||
|
|
752970edd0 | ||
|
|
7b64c76932 | ||
|
|
6d9ee62035 | ||
|
|
b27dcc252a | ||
|
|
b60e479cea | ||
|
|
ab8493166b | ||
|
|
9333a5cf0c | ||
|
|
8ec721eb3b | ||
|
|
7d1d4d2cce | ||
|
|
fb20f4d248 | ||
|
|
b2a0ba40a4 | ||
|
|
c467712045 | ||
|
|
f41e41fa3f | ||
|
|
f490eeaa59 | ||
|
|
37e5be95e2 | ||
|
|
e208eb429a | ||
|
|
c784b6f1c4 | ||
|
|
6dc4095801 | ||
|
|
a522bdb715 | ||
|
|
07e0177b72 | ||
|
|
fee9327009 | ||
|
|
f991633730 | ||
|
|
1fc4377f03 | ||
|
|
353ea22e6f | ||
|
|
cdf9afcec8 | ||
|
|
f58fe58af9 | ||
|
|
9ab423063b | ||
|
|
b8dd3a1a06 | ||
|
|
6e4b6b77a3 | ||
|
|
b13786805a | ||
|
|
7c72320404 | ||
|
|
763a7bfbb5 | ||
|
|
c789aecfa6 | ||
|
|
1aae16084a | ||
|
|
a593948c90 | ||
|
|
96134b7430 | ||
|
|
5d2fcdb4cb | ||
|
|
c0a8bcfa6a | ||
|
|
4bc117de0c | ||
|
|
47db5bd435 | ||
|
|
eeb5a258f5 | ||
|
|
5436326dcf | ||
|
|
9ecc6e7fe2 | ||
|
|
72cf8893fc | ||
|
|
28d6f2964c |
@@ -60,6 +60,8 @@
|
||||
"@typescript-eslint/promise-function-async": "error",
|
||||
"@typescript-eslint/require-array-sort-compare": "error",
|
||||
"@typescript-eslint/restrict-plus-operands": "error",
|
||||
"no-shadow": "off",
|
||||
"@typescript-eslint/no-shadow": "error",
|
||||
"semi": "off",
|
||||
"filenames/match-regex": [
|
||||
"error",
|
||||
|
||||
2
.github/workflows/manual-test.yml
vendored
2
.github/workflows/manual-test.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
fail-fast: false
|
||||
max-parallel: 7
|
||||
matrix:
|
||||
platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
|
||||
platform: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
4
.github/workflows/matrix-test.yml
vendored
4
.github/workflows/matrix-test.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: List all changed files
|
||||
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
|
||||
- id: set-matrix
|
||||
run: echo "matrix={\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
|
||||
run: echo "matrix={\"files\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
matrix-job:
|
||||
name: Run Matrix Job
|
||||
@@ -41,4 +41,4 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Test
|
||||
run: |
|
||||
echo ${{ matrix.container }}
|
||||
echo ${{ matrix.files }}
|
||||
|
||||
2
.github/workflows/submodule-sync.yml
vendored
2
.github/workflows/submodule-sync.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
git submodule update --remote --recursive
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5.0.1
|
||||
uses: peter-evans/create-pull-request@v5.0.2
|
||||
with:
|
||||
title: "Updated submodule"
|
||||
labels: "merge when passing"
|
||||
|
||||
2
.github/workflows/sync-release-version.yml
vendored
2
.github/workflows/sync-release-version.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
- name: Run git-cliff
|
||||
uses: tj-actions/git-cliff@v1
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5.0.1
|
||||
uses: peter-evans/create-pull-request@v5.0.2
|
||||
with:
|
||||
base: "main"
|
||||
labels: "merge when passing"
|
||||
|
||||
366
.github/workflows/test.yml
vendored
366
.github/workflows/test.yml
vendored
@@ -4,14 +4,31 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- sec
|
||||
pull_request_review:
|
||||
types: [edited, dismissed, submitted]
|
||||
pull_request_target:
|
||||
pull_request:
|
||||
types:
|
||||
- assigned
|
||||
- unassigned
|
||||
- labeled
|
||||
- unlabeled
|
||||
- opened
|
||||
- edited
|
||||
- closed
|
||||
- reopened
|
||||
- synchronize
|
||||
- converted_to_draft
|
||||
- ready_for_review
|
||||
- locked
|
||||
- unlocked
|
||||
- review_requested
|
||||
- review_request_removed
|
||||
- auto_merge_enabled
|
||||
- auto_merge_disabled
|
||||
branches:
|
||||
- main
|
||||
- sec
|
||||
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
@@ -19,10 +36,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
- name: shellcheck
|
||||
uses: reviewdog/action-shellcheck@v1.17
|
||||
uses: reviewdog/action-shellcheck@v1.18
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -31,6 +48,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Use Node.js 16.x
|
||||
uses: actions/setup-node@v3.6.0
|
||||
@@ -48,8 +66,8 @@ jobs:
|
||||
yarn install
|
||||
|
||||
- name: Run eslint on changed files
|
||||
uses: tj-actions/eslint-changed-files@v19
|
||||
if: github.event_name != 'push'
|
||||
uses: tj-actions/eslint-changed-files@v20
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
config_path: ".eslintrc.json"
|
||||
@@ -60,16 +78,16 @@ jobs:
|
||||
yarn all
|
||||
|
||||
- name: Verify Changed files
|
||||
uses: tj-actions/verify-changed-files@v14
|
||||
uses: tj-actions/verify-changed-files@v16
|
||||
id: changed_files
|
||||
if: github.event_name != 'push'
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
files: |
|
||||
src
|
||||
dist
|
||||
|
||||
- name: Commit files
|
||||
if: steps.changed_files.outputs.files_changed == 'true' && github.event_name != 'push'
|
||||
if: steps.changed_files.outputs.files_changed == 'true' && github.event_name == 'pull_request'
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
@@ -78,6 +96,7 @@ jobs:
|
||||
|
||||
- name: Push changes
|
||||
if: steps.changed_files.outputs.files_changed == 'true' && github.event_name == 'pull_request'
|
||||
continue-on-error: true
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.PAT_TOKEN }}
|
||||
@@ -104,6 +123,7 @@ jobs:
|
||||
- name: Checkout into dir1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
path: dir1
|
||||
@@ -112,6 +132,7 @@ jobs:
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-assets
|
||||
path: dir1/dist
|
||||
|
||||
- name: Run changed-files with defaults on the dir1
|
||||
id: changed-files-dir1
|
||||
@@ -133,9 +154,16 @@ jobs:
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Download build assets
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-assets
|
||||
path: dir2/dist
|
||||
|
||||
- name: Checkout into dir2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
path: dir2
|
||||
@@ -167,9 +195,10 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download build assets
|
||||
@@ -223,9 +252,10 @@ jobs:
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download build assets
|
||||
@@ -259,9 +289,10 @@ jobs:
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download build assets
|
||||
@@ -294,9 +325,10 @@ jobs:
|
||||
input-fetch_depth: [1, 50]
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: ${{ matrix.fetch-depth }}
|
||||
|
||||
- name: Download build assets
|
||||
@@ -323,7 +355,7 @@ jobs:
|
||||
if: github.event_name != 'push'
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
@@ -355,11 +387,12 @@ jobs:
|
||||
fetch-depth: [1, 2, 0]
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: ${{ matrix.fetch-depth }}
|
||||
persist-credentials: false
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
- name: Download build assets
|
||||
uses: actions/download-artifact@v3
|
||||
@@ -382,7 +415,7 @@ jobs:
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download build assets
|
||||
@@ -435,7 +468,7 @@ jobs:
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download build assets
|
||||
@@ -482,6 +515,38 @@ jobs:
|
||||
echo "Expected: (failure) got ${{ steps.changed-files-specific.outcome }}"
|
||||
exit 1
|
||||
|
||||
test-rest-api:
|
||||
name: Test changed-files with REST API
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.event_name != 'push'
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: Checkout into dir1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
path: dir1
|
||||
|
||||
- name: Download build assets
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-assets
|
||||
path: dir1/dist
|
||||
|
||||
- name: Run changed-files with REST API
|
||||
id: changed-files
|
||||
uses: ./dir1
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
|
||||
test-submodules:
|
||||
name: Test changed-files with submodule
|
||||
runs-on: ubuntu-latest
|
||||
@@ -493,7 +558,7 @@ jobs:
|
||||
fetch-depth: [0, 1, 2]
|
||||
|
||||
steps:
|
||||
- name: Checkout to branch
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
@@ -524,6 +589,209 @@ jobs:
|
||||
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
||||
shell:
|
||||
bash
|
||||
test-yaml:
|
||||
name: Test changed-files with yaml
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
fetch-depth: [0, 1, 2]
|
||||
|
||||
steps:
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
submodules: recursive
|
||||
fetch-depth: ${{ matrix.fetch-depth }}
|
||||
|
||||
- name: Download build assets
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-assets
|
||||
|
||||
- name: Run changed-files with files_yaml
|
||||
id: changed-files
|
||||
uses: ./
|
||||
with:
|
||||
files_yaml: |
|
||||
test:
|
||||
- test/**.txt
|
||||
- test/**.md
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Run changed-files with files_yaml_from_source_file
|
||||
id: changed-files-from-source-file
|
||||
uses: ./
|
||||
with:
|
||||
files_yaml_from_source_file: |
|
||||
test/changed-files.yml
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo "${{ toJSON(steps.changed-files-from-source-file.outputs) }}"
|
||||
shell:
|
||||
bash
|
||||
|
||||
test_recover_deleted_file:
|
||||
name: Test changed-files recover deleted file
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
fetch-depth: [0, 1, 2]
|
||||
|
||||
steps:
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
submodules: recursive
|
||||
fetch-depth: ${{ matrix.fetch-depth }}
|
||||
|
||||
- name: Download build assets
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-assets
|
||||
|
||||
- name: Run changed-files with recover_deleted_files
|
||||
id: changed-files-recover-deleted-files
|
||||
uses: ./
|
||||
with:
|
||||
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
|
||||
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
||||
recover_deleted_files: true
|
||||
fetch_depth: 60000
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo "${{ toJSON(steps.changed-files-recover-deleted-files.outputs) }}"
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Verify deleted files
|
||||
if: steps.changed-files-recover-deleted-files.outputs.deleted_files != 'test/test deleted.txt'
|
||||
run: |
|
||||
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files.outputs.deleted_files }}"
|
||||
exit 1
|
||||
|
||||
- name: Verify that test/test deleted.txt is restored
|
||||
run: |
|
||||
if [ ! -f "test/test deleted.txt" ]; then
|
||||
echo "Expected: (test/test deleted.txt) to exist"
|
||||
exit 1
|
||||
else
|
||||
cat "test/test deleted.txt"
|
||||
rm "test/test deleted.txt"
|
||||
fi
|
||||
|
||||
- name: Run changed-files with recover_deleted_files and files input
|
||||
id: changed-files-recover-deleted-files-with-files
|
||||
uses: ./
|
||||
with:
|
||||
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
|
||||
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
||||
files: |
|
||||
test
|
||||
recover_deleted_files: true
|
||||
fetch_depth: 60000
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo "${{ toJSON(steps.changed-files-recover-deleted-files-with-files.outputs) }}"
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Verify deleted files
|
||||
if: steps.changed-files-recover-deleted-files-with-files.outputs.deleted_files != 'test/test deleted.txt'
|
||||
run: |
|
||||
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-with-files.outputs.deleted_files }}"
|
||||
exit 1
|
||||
|
||||
- name: Verify that test/test deleted.txt is restored
|
||||
run: |
|
||||
if [ ! -f "test/test deleted.txt" ]; then
|
||||
echo "Expected: (test/test deleted.txt) to exist"
|
||||
exit 1
|
||||
else
|
||||
cat "test/test deleted.txt"
|
||||
rm "test/test deleted.txt"
|
||||
fi
|
||||
|
||||
- name: Run changed-files with recover_deleted_files and files_yaml input
|
||||
id: changed-files-recover-deleted-files-with-files-yaml
|
||||
uses: ./
|
||||
with:
|
||||
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
|
||||
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
||||
files_yaml: |
|
||||
test:
|
||||
- test/**.txt
|
||||
- test/**.md
|
||||
recover_deleted_files: true
|
||||
fetch_depth: 60000
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo "${{ toJSON(steps.changed-files-recover-deleted-files-with-files-yaml.outputs) }}"
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Verify deleted files
|
||||
if: steps.changed-files-recover-deleted-files-with-files-yaml.outputs.test_deleted_files != 'test/test deleted.txt'
|
||||
run: |
|
||||
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-with-files-yaml.outputs.test_deleted_files }}"
|
||||
exit 1
|
||||
|
||||
- name: Verify that test/test deleted.txt is restored
|
||||
run: |
|
||||
if [ ! -f "test/test deleted.txt" ]; then
|
||||
echo "Expected: (test/test deleted.txt) to exist"
|
||||
exit 1
|
||||
else
|
||||
cat "test/test deleted.txt"
|
||||
rm "test/test deleted.txt"
|
||||
fi
|
||||
|
||||
- name: Run changed-files with recover_deleted_files and recover_deleted_files_to_destination
|
||||
id: changed-files-recover-deleted-files-to-destination
|
||||
uses: ./
|
||||
with:
|
||||
base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338"
|
||||
sha: "432e0c810c60ef1332850a971c5ec39022034b4c"
|
||||
recover_deleted_files: true
|
||||
recover_deleted_files_to_destination: "deleted_files"
|
||||
fetch_depth: 60000
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo "${{ toJSON(steps.changed-files-recover-deleted-files-to-destination.outputs) }}"
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Verify deleted files
|
||||
if: steps.changed-files-recover-deleted-files-to-destination.outputs.deleted_files != 'test/test deleted.txt'
|
||||
run: |
|
||||
echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-to-destination.outputs.deleted_files }}"
|
||||
exit 1
|
||||
|
||||
- name: Verify that test/test deleted.txt is restored
|
||||
run: |
|
||||
if [ ! -f "deleted_files/test/test deleted.txt" ]; then
|
||||
echo "Expected: (deleted_files/test/test deleted.txt) to exist"
|
||||
exit 1
|
||||
else
|
||||
cat "deleted_files/test/test deleted.txt"
|
||||
fi
|
||||
|
||||
test:
|
||||
name: Test changed-files
|
||||
@@ -541,6 +809,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
fetch-depth: ${{ matrix.fetch-depth }}
|
||||
- name: Download build assets
|
||||
uses: actions/download-artifact@v3
|
||||
@@ -655,7 +924,7 @@ jobs:
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with dir_names and dir_names_exclude_root
|
||||
- name: Run changed-files with dir_names and dir_names_exclude_current_dir
|
||||
id: changed-files-dir-names-exclude-root
|
||||
uses: ./
|
||||
with:
|
||||
@@ -663,7 +932,7 @@ jobs:
|
||||
sha: ce8c1983
|
||||
fetch_depth: 60000
|
||||
dir_names: "true"
|
||||
dir_names_exclude_root: "true"
|
||||
dir_names_exclude_current_dir: "true"
|
||||
dir_names_max_depth: "1"
|
||||
- name: Show output
|
||||
run: |
|
||||
@@ -822,6 +1091,13 @@ jobs:
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt')"
|
||||
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 }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files for old new filenames test rename 2
|
||||
id: changed-files-all-old-new-renamed-files-2
|
||||
uses: ./
|
||||
@@ -842,6 +1118,48 @@ jobs:
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt')"
|
||||
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 }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- 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
|
||||
uses: ./
|
||||
with:
|
||||
base_sha: 4d04215
|
||||
sha: fe238e6
|
||||
fetch_depth: 60000
|
||||
include_all_old_new_renamed_files: true
|
||||
output_renamed_files_as_deleted_and_added: true
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check all_old_new_renamed_files output
|
||||
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')"
|
||||
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 }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check deleted_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt')"
|
||||
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 }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check added_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt')"
|
||||
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 }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with specific files
|
||||
id: changed-files-specific
|
||||
uses: ./
|
||||
@@ -1231,7 +1549,7 @@ jobs:
|
||||
main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }}
|
||||
workflow-id: 'test.yml'
|
||||
- name: Run changed-files with a custom base sha
|
||||
if: github.event_name != 'push' && github.event.action != 'closed' && matrix.fetch-depth == 0
|
||||
if: github.event_name != 'push' && github.event.action != 'closed' && matrix.fetch-depth == 0 && steps.last_successful_commit.outputs.base != steps.last_successful_commit.outputs.head
|
||||
id: changed-files-custom-base-sha
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
2
.github/workflows/update-readme.yml
vendored
2
.github/workflows/update-readme.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
uses: tj-actions/remark@v3
|
||||
|
||||
- name: Verify Changed files
|
||||
uses: tj-actions/verify-changed-files@v14
|
||||
uses: tj-actions/verify-changed-files@v16
|
||||
id: verify_changed_files
|
||||
with:
|
||||
files: |
|
||||
|
||||
447
HISTORY.md
447
HISTORY.md
@@ -1,5 +1,452 @@
|
||||
# Changelog
|
||||
|
||||
# [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)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Error using current path to determine the .git dir location ([#1299](https://github.com/tj-actions/changed-files/issues/1299)) ([e5efec4](https://github.com/tj-actions/changed-files/commit/e5efec47f620e0fde64a1ad8f53bbf53d51a8c97)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v37 ([#1298](https://github.com/tj-actions/changed-files/issues/1298))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([d6d7cb2](https://github.com/tj-actions/changed-files/commit/d6d7cb291e28bba32464fbbf0d13c7f6c2c75de1)) - (tj-actions[bot])
|
||||
|
||||
# [37.0.0](https://github.com/tj-actions/changed-files/compare/v36.4.1...v37.0.0) - (2023-06-23)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add support for retrieving changed files via github rest api ([#1289](https://github.com/tj-actions/changed-files/issues/1289)) ([fd5b3a4](https://github.com/tj-actions/changed-files/commit/fd5b3a411da53db8da7b4b197cc1b1066dcd5360)) - (Tonye Jack)
|
||||
|
||||
## <!-- 17 -->➖ Remove
|
||||
|
||||
- Deprecated dir_names_exclude_root ([#1291](https://github.com/tj-actions/changed-files/issues/1291)) ([faa5db4](https://github.com/tj-actions/changed-files/commit/faa5db4b1d5c904bd14ba8dc0d429e2c257c9638)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1295](https://github.com/tj-actions/changed-files/issues/1295))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([a553a02](https://github.com/tj-actions/changed-files/commit/a553a029f5a46a8e74f782b41db046e63aab0cfb)) - (tj-actions[bot])
|
||||
- Updated README.md ([#1292](https://github.com/tj-actions/changed-files/issues/1292))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([63f203d](https://github.com/tj-actions/changed-files/commit/63f203d400de5479b07e8a01487881309f2bc0ce)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- Update README.md ([5817a9e](https://github.com/tj-actions/changed-files/commit/5817a9efb0d7cc34b917d8146ea10b9f32044968)) - (Tonye Jack)
|
||||
- **deps:** Lock file maintenance ([#1297](https://github.com/tj-actions/changed-files/issues/1297)) ([33d50af](https://github.com/tj-actions/changed-files/commit/33d50af03f5e8e0914e7ddea9455ca6cde2033b1)) - (renovate[bot])
|
||||
- Use input api url ([#1293](https://github.com/tj-actions/changed-files/issues/1293)) ([a4cd522](https://github.com/tj-actions/changed-files/commit/a4cd522ee2e5d7999bb102867e6d806e59861c52)) - (Tonye Jack)
|
||||
- **deps:** Lock file maintenance ([#1290](https://github.com/tj-actions/changed-files/issues/1290)) ([c4a394a](https://github.com/tj-actions/changed-files/commit/c4a394a9cfbbfcea1d864b5d6c9f9aa2b7960a9b)) - (renovate[bot])
|
||||
- **deps:** Update tj-actions/verify-changed-files action to v16 ([#1288](https://github.com/tj-actions/changed-files/issues/1288)) ([50ae49b](https://github.com/tj-actions/changed-files/commit/50ae49b0e4dc2c5bdccb7aad26373561c753b17f)) - (renovate[bot])
|
||||
- Update manual-test.yml ([588d46e](https://github.com/tj-actions/changed-files/commit/588d46e858ff7c814f5a26458ae8794b715d690a)) - (Tonye Jack)
|
||||
- Update README.md ([bdeaa91](https://github.com/tj-actions/changed-files/commit/bdeaa9108ce22a3e92aefbe165c85ea29b839a24)) - (Tonye Jack)
|
||||
- Update matrix-test.yml ([4d8812d](https://github.com/tj-actions/changed-files/commit/4d8812d205c7d0bca52560321514947f65c7a2f9)) - (Tonye Jack)
|
||||
- **deps:** Lock file maintenance ([#1287](https://github.com/tj-actions/changed-files/issues/1287)) ([668fd3a](https://github.com/tj-actions/changed-files/commit/668fd3a7139e499b321f1889c2f1a90b508da43e)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([#1285](https://github.com/tj-actions/changed-files/issues/1285)) ([b952f3b](https://github.com/tj-actions/changed-files/commit/b952f3beb3bb65ec19163628da458efb10e5f3d6)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([#1284](https://github.com/tj-actions/changed-files/issues/1284)) ([ce8bc5d](https://github.com/tj-actions/changed-files/commit/ce8bc5d49a2cf03a217066239554d467140a3054)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.4.1 ([#1283](https://github.com/tj-actions/changed-files/issues/1283))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([9ff3603](https://github.com/tj-actions/changed-files/commit/9ff36033594327f40a8c22612579a3604e90fc7a)) - (tj-actions[bot])
|
||||
|
||||
# [36.4.1](https://github.com/tj-actions/changed-files/compare/v36.4.0...v36.4.1) - (2023-06-19)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug with returning old filename in renamed files output ([#1281](https://github.com/tj-actions/changed-files/issues/1281)) ([54479c3](https://github.com/tj-actions/changed-files/commit/54479c37f5eb47a43e595c6b71e1df2c112ce7f1)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Update action.yml ([18c62c5](https://github.com/tj-actions/changed-files/commit/18c62c592a1bb252205275ac68d523e142aa3256)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update typescript-eslint monorepo to v5.60.0 ([#1282](https://github.com/tj-actions/changed-files/issues/1282)) ([6d89069](https://github.com/tj-actions/changed-files/commit/6d890691342f29ee654d14841dae8c5d46b23180)) - (renovate[bot])
|
||||
- **deps:** Update reviewdog/action-shellcheck action to v1.18 ([#1279](https://github.com/tj-actions/changed-files/issues/1279)) ([3bbaba4](https://github.com/tj-actions/changed-files/commit/3bbaba4ae79020f9eaff96b5cbecc0f0663214a1)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint-plugin-jest to v27.2.2 ([#1278](https://github.com/tj-actions/changed-files/issues/1278)) ([c39b06f](https://github.com/tj-actions/changed-files/commit/c39b06f825efcb60a604e5f952a513b644de6164)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([#1277](https://github.com/tj-actions/changed-files/issues/1277)) ([4c2f8ed](https://github.com/tj-actions/changed-files/commit/4c2f8eda370a246578045fa9ad100be4dd83fdc6)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.4.0 ([#1275](https://github.com/tj-actions/changed-files/issues/1275))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2c8123e](https://github.com/tj-actions/changed-files/commit/2c8123e91ee0d1adea852dca2c0139cb15c3aabf)) - (tj-actions[bot])
|
||||
|
||||
# [36.4.0](https://github.com/tj-actions/changed-files/compare/v36.3.0...v36.4.0) - (2023-06-17)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add support for returning changed file counts ([#1273](https://github.com/tj-actions/changed-files/issues/1273)) ([f573054](https://github.com/tj-actions/changed-files/commit/f573054697fceee32a3bbc0ecf27286247aabb56)) - (Tonye Jack)
|
||||
- Move deleted file recovery to leverage filter ([#1272](https://github.com/tj-actions/changed-files/issues/1272)) ([c3c3db7](https://github.com/tj-actions/changed-files/commit/c3c3db7feee6dc9447b2c03b41ae18e63e043fe2)) - (Tonye Jack)
|
||||
- Add support for recovering deleted files ([#1269](https://github.com/tj-actions/changed-files/issues/1269)) ([77f9e6c](https://github.com/tj-actions/changed-files/commit/77f9e6c7c636ec1a11598091308b26a1c1ccf131)) - (Tonye Jack)
|
||||
- Add support for recovering deleted files ([d9105a4](https://github.com/tj-actions/changed-files/commit/d9105a4631593f0dc11f3ae6bfbcb5ac43625523)) - (Tonye Jack)
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
- Added deleted file
|
||||
([fcdeb5b](https://github.com/tj-actions/changed-files/commit/fcdeb5b3d797752d95f6dbe98552a95c29dad338)) - (Tonye Jack)
|
||||
- Added missing changes and modified dist assets.
|
||||
([01e83d6](https://github.com/tj-actions/changed-files/commit/01e83d602481802f6822004896b864b1e5e56cfb)) - (GitHub Action)
|
||||
|
||||
## <!-- 17 -->➖ Remove
|
||||
|
||||
- Removed test file
|
||||
([432e0c8](https://github.com/tj-actions/changed-files/commit/432e0c810c60ef1332850a971c5ec39022034b4c)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1274](https://github.com/tj-actions/changed-files/issues/1274))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([e1754a4](https://github.com/tj-actions/changed-files/commit/e1754a427f478b8778d349341b8f1d80f1f47f44)) - (tj-actions[bot])
|
||||
- Updated README.md ([#1270](https://github.com/tj-actions/changed-files/issues/1270))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([7fcd53a](https://github.com/tj-actions/changed-files/commit/7fcd53ac001f9faf1b1f57a58e10cd958da114ed)) - (tj-actions[bot])
|
||||
- Update README.md ([d7af20b](https://github.com/tj-actions/changed-files/commit/d7af20bab3d42577ec79dffc4e793c14d0df65b3)) - (Tonye Jack)
|
||||
- Update README.md ([690b721](https://github.com/tj-actions/changed-files/commit/690b721958b0220fa3f827e13559c5023d277b61)) - (Tonye Jack)
|
||||
- Updated the test
|
||||
([c82a34e](https://github.com/tj-actions/changed-files/commit/c82a34e7e5e87a5c69ee4aff0facae82e5177e3b)) - (Tonye Jack)
|
||||
- Updated the test
|
||||
([7a1c64e](https://github.com/tj-actions/changed-files/commit/7a1c64e8b15493fe087b9289d565d0502f1a97ab)) - (Tonye Jack)
|
||||
- Updated dist assets
|
||||
([71290f0](https://github.com/tj-actions/changed-files/commit/71290f02ff8f886712b65679f29e64216aa3e131)) - (Tonye Jack)
|
||||
- Updated test
|
||||
([ecf455a](https://github.com/tj-actions/changed-files/commit/ecf455a884019154bc08fa00fa237fd5a07b2287)) - (Tonye Jack)
|
||||
- Update README.md ([024cd58](https://github.com/tj-actions/changed-files/commit/024cd58ac6e73a0f9617287edc3954db32e85394)) - (Tonye Jack)
|
||||
- Update README.md ([c9a1c56](https://github.com/tj-actions/changed-files/commit/c9a1c56f6da50ec6d7986486064919eaeea692cc)) - (Tonye Jack)
|
||||
|
||||
## <!-- 30 -->📝 Other
|
||||
|
||||
- Merge branch 'feat/add-support-for-recovering-deleted-files'
|
||||
([749fe3b](https://github.com/tj-actions/changed-files/commit/749fe3bb283cc8d46fc71f976e78eb6e1669f37d)) - (Tonye Jack)
|
||||
- Merge d4f86e9d1689a5d2ddb94e173669f31cc3497351 into 0621d936c0d15c7a5a116268ea1f7c362b76c50b
|
||||
([c706c70](https://github.com/tj-actions/changed-files/commit/c706c70eed92c7d5843cd3921da0a078663423e8)) - (Tonye Jack)
|
||||
- Merge branch 'main' into feat/add-support-for-recovering-deleted-files ([d4f86e9](https://github.com/tj-actions/changed-files/commit/d4f86e9d1689a5d2ddb94e173669f31cc3497351)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Lock file maintenance ([#1271](https://github.com/tj-actions/changed-files/issues/1271)) ([480e87d](https://github.com/tj-actions/changed-files/commit/480e87dd66bdf2a6036db2fd2ea72906a92cfde2)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint to v8.43.0 ([#1268](https://github.com/tj-actions/changed-files/issues/1268)) ([0621d93](https://github.com/tj-actions/changed-files/commit/0621d936c0d15c7a5a116268ea1f7c362b76c50b)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.3.0 ([#1267](https://github.com/tj-actions/changed-files/issues/1267))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([54a8c99](https://github.com/tj-actions/changed-files/commit/54a8c99a03eb57f7f561696dd7879bea7587e469)) - (tj-actions[bot])
|
||||
|
||||
# [36.3.0](https://github.com/tj-actions/changed-files/compare/v36.2.1...v36.3.0) - (2023-06-16)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add support for complex filters ([#1265](https://github.com/tj-actions/changed-files/issues/1265)) ([c25c77a](https://github.com/tj-actions/changed-files/commit/c25c77a67a4da177bd7550612cacb74714d054f6)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1266](https://github.com/tj-actions/changed-files/issues/1266))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([9bf0914](https://github.com/tj-actions/changed-files/commit/9bf09145c3560e451e8d8e87b42ccb3fef5b692d)) - (tj-actions[bot])
|
||||
- Updated README.md ([#1264](https://github.com/tj-actions/changed-files/issues/1264))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||
Co-authored-by: GitHub Action <action@github.com> ([d144c0c](https://github.com/tj-actions/changed-files/commit/d144c0c92d678494b332227c803cea83b4f7bdee)) - (tj-actions[bot])
|
||||
- Update README.md ([341b80d](https://github.com/tj-actions/changed-files/commit/341b80da8b4d69e7a389dc6f2df8c8ee41ea5736)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- Update test.yml ([ea90b5c](https://github.com/tj-actions/changed-files/commit/ea90b5ced9a0c8d0d18077656d2ecada2bb67ff3)) - (Tonye Jack)
|
||||
- Move check out of loop ([6cf9c82](https://github.com/tj-actions/changed-files/commit/6cf9c8246e3225cbcdc00d6c86ba6d6a05b2e231)) - (Tonye Jack)
|
||||
- **deps:** Lock file maintenance ([#1263](https://github.com/tj-actions/changed-files/issues/1263)) ([9559461](https://github.com/tj-actions/changed-files/commit/955946132d0133d584404b86a03462e591ff30b3)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.2.1 ([#1262](https://github.com/tj-actions/changed-files/issues/1262))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([1f2cb3b](https://github.com/tj-actions/changed-files/commit/1f2cb3b00f32f8700ede1b03398337e39a64d448)) - (tj-actions[bot])
|
||||
|
||||
# [36.2.1](https://github.com/tj-actions/changed-files/compare/v36.2.0...v36.2.1) - (2023-06-14)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add support for outputting renamed files as deleted and added ([#1260](https://github.com/tj-actions/changed-files/issues/1260)) ([90ef0b1](https://github.com/tj-actions/changed-files/commit/90ef0b1b22b674a0dea8c832029e63eed9fb8e13)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1261](https://github.com/tj-actions/changed-files/issues/1261))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([c912451](https://github.com/tj-actions/changed-files/commit/c9124514c375de5dbb9697afa6f2e36a236ee58c)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- Rename git fetch arguments ([#1259](https://github.com/tj-actions/changed-files/issues/1259)) ([b9ea510](https://github.com/tj-actions/changed-files/commit/b9ea510e42795d425d659914078b74f51c774869)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.2.0 ([#1258](https://github.com/tj-actions/changed-files/issues/1258))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([c648759](https://github.com/tj-actions/changed-files/commit/c648759d899fd6217a96579680bdae3ac01e6219)) - (tj-actions[bot])
|
||||
|
||||
# [36.2.0](https://github.com/tj-actions/changed-files/compare/v36.1.0...v36.2.0) - (2023-06-14)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Switch to use name status ([#1230](https://github.com/tj-actions/changed-files/issues/1230)) ([174a2a6](https://github.com/tj-actions/changed-files/commit/174a2a6360b54a2019877c254c4be78106efc94f)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1255](https://github.com/tj-actions/changed-files/issues/1255))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2c6893c](https://github.com/tj-actions/changed-files/commit/2c6893c21a91f8238df9e0ed2f3e4488efc0629f)) - (tj-actions[bot])
|
||||
- Update action.yml ([17ca5bb](https://github.com/tj-actions/changed-files/commit/17ca5bb3e554d4d9b631e09414186b64b6e64cd6)) - (Tonye Jack)
|
||||
- Updated README.md ([#1249](https://github.com/tj-actions/changed-files/issues/1249))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([a625ca3](https://github.com/tj-actions/changed-files/commit/a625ca325f498d75648b0ec941834edc16e71a40)) - (tj-actions[bot])
|
||||
- Updated README.md ([#1248](https://github.com/tj-actions/changed-files/issues/1248))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||
Co-authored-by: Tonye Jack <jtonye@ymail.com> ([752970e](https://github.com/tj-actions/changed-files/commit/752970edd01e2a1b9e1a9ef37207bd59a34c90f4)) - (tj-actions[bot])
|
||||
- Update action.yml ([7b64c76](https://github.com/tj-actions/changed-files/commit/7b64c76932d2ddd0a2be638832dc8f72eacec74c)) - (Tonye Jack)
|
||||
- Updated README.md ([#1246](https://github.com/tj-actions/changed-files/issues/1246))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([9333a5c](https://github.com/tj-actions/changed-files/commit/9333a5cf0c1a85e3dd5876284bb075ade076a9e0)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update peter-evans/create-pull-request action to v5.0.2 ([#1256](https://github.com/tj-actions/changed-files/issues/1256)) ([2d0b52f](https://github.com/tj-actions/changed-files/commit/2d0b52f4408b791c0c5c1eca405d8461b320dd01)) - (renovate[bot])
|
||||
- **deps:** Update typescript-eslint monorepo to v5.59.11 ([#1253](https://github.com/tj-actions/changed-files/issues/1253)) ([d0e3a7c](https://github.com/tj-actions/changed-files/commit/d0e3a7c3aa15c15ace59f95a9fda1bcadf9ab3e2)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([#1252](https://github.com/tj-actions/changed-files/issues/1252)) ([61845c2](https://github.com/tj-actions/changed-files/commit/61845c2b19ec2ad7e3d79a6955e192e66d41cb80)) - (renovate[bot])
|
||||
- **deps:** Update tj-actions/verify-changed-files action to v15 ([#1251](https://github.com/tj-actions/changed-files/issues/1251)) ([417f924](https://github.com/tj-actions/changed-files/commit/417f924dea3b9800ea861d576eee55162ab6607c)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([#1250](https://github.com/tj-actions/changed-files/issues/1250)) ([c51a48d](https://github.com/tj-actions/changed-files/commit/c51a48d4f6bf95820aa0f9e3f3e6516bd427ae7a)) - (renovate[bot])
|
||||
- Update README.md ([6d9ee62](https://github.com/tj-actions/changed-files/commit/6d9ee62035acb0c3942fba9757033c677246f2f4)) - (Tonye Jack)
|
||||
- Update README.md ([b27dcc2](https://github.com/tj-actions/changed-files/commit/b27dcc252ada558d34ecd368bd253994df77acb1)) - (Tonye Jack)
|
||||
- **deps:** Update dependency @types/uuid to v9.0.2 ([#1247](https://github.com/tj-actions/changed-files/issues/1247)) ([b60e479](https://github.com/tj-actions/changed-files/commit/b60e479ceab551d9a8f832d5a989eb3e492d4bf4)) - (renovate[bot])
|
||||
- Update README.md ([#1237](https://github.com/tj-actions/changed-files/issues/1237)) ([8ec721e](https://github.com/tj-actions/changed-files/commit/8ec721eb3b7d57b7afc0d63748bd7242292989b1)) - (tj-actions[bot])
|
||||
- Update README.md ([#1240](https://github.com/tj-actions/changed-files/issues/1240)) ([7d1d4d2](https://github.com/tj-actions/changed-files/commit/7d1d4d2cce628fd1797af3acb779dd1d26b61d31)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.1.0 ([#1245](https://github.com/tj-actions/changed-files/issues/1245))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([ab84931](https://github.com/tj-actions/changed-files/commit/ab8493166b33b74edc5101f3e814b63cd87f05ab)) - (tj-actions[bot])
|
||||
|
||||
# [36.1.0](https://github.com/tj-actions/changed-files/compare/v36.0.18...v36.1.0) - (2023-06-08)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Improve warning message ([#1241](https://github.com/tj-actions/changed-files/issues/1241)) ([f41e41f](https://github.com/tj-actions/changed-files/commit/f41e41fa3fdcbdf47c5f73526be7d81e413f832e)) - (Tonye Jack)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug with errors from fork prs ([#1239](https://github.com/tj-actions/changed-files/issues/1239)) ([e208eb4](https://github.com/tj-actions/changed-files/commit/e208eb429a6a5b3444af0a2099bdbbfcd705fae6)) - (Tonye Jack)
|
||||
- Bug with only_(changed|modified|deleted) outputs ([#1238](https://github.com/tj-actions/changed-files/issues/1238)) ([6dc4095](https://github.com/tj-actions/changed-files/commit/6dc409580193a9e2e52aa4a647684c2ea5a99ddb)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Update test.yml ([37e5be9](https://github.com/tj-actions/changed-files/commit/37e5be95e281cd60c1d89e92bb25242b37e9db3c)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- Fix bug with nx set shas ([#1244](https://github.com/tj-actions/changed-files/issues/1244)) ([fb20f4d](https://github.com/tj-actions/changed-files/commit/fb20f4d24890fadc539505b1746d260504b213d0)) - (Tonye Jack)
|
||||
- Update test ([#1243](https://github.com/tj-actions/changed-files/issues/1243)) ([b2a0ba4](https://github.com/tj-actions/changed-files/commit/b2a0ba40a4106c5de8de8ac8b0732f404d084f00)) - (Tonye Jack)
|
||||
- Update event name ([#1242](https://github.com/tj-actions/changed-files/issues/1242)) ([c467712](https://github.com/tj-actions/changed-files/commit/c467712045a1fb370c4f8a2ce40f93c718e7888e)) - (Tonye Jack)
|
||||
- Update test.yml ([f490eea](https://github.com/tj-actions/changed-files/commit/f490eeaa59c0a3957b24214e86c462a2e9a6c7fa)) - (tj-actions[bot])
|
||||
- Improve test coverage ([#1235](https://github.com/tj-actions/changed-files/issues/1235)) ([c784b6f](https://github.com/tj-actions/changed-files/commit/c784b6f1c4775e3db7ddc38d464ae017e41b1576)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.18 ([#1234](https://github.com/tj-actions/changed-files/issues/1234))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([a522bdb](https://github.com/tj-actions/changed-files/commit/a522bdb715e8ee0e5814bc94f576ebc24cebbfd3)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.18](https://github.com/tj-actions/changed-files/compare/v36.0.17...v36.0.18) - (2023-06-06)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add dir_names_exclude_current_dir input and cleaned up logic to retrieve the current sha ([#1229](https://github.com/tj-actions/changed-files/issues/1229)) ([353ea22](https://github.com/tj-actions/changed-files/commit/353ea22e6fc7b15ce3a30064d8cd19eef2a86b71)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1233](https://github.com/tj-actions/changed-files/issues/1233))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([07e0177](https://github.com/tj-actions/changed-files/commit/07e0177b72d3640efced741cae32f9861eee1367)) - (tj-actions[bot])
|
||||
- Updated README.md ([#1232](https://github.com/tj-actions/changed-files/issues/1232))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([fee9327](https://github.com/tj-actions/changed-files/commit/fee9327009ff80c0a0d442f2204944771f0552b1)) - (tj-actions[bot])
|
||||
- Update action.yml ([f991633](https://github.com/tj-actions/changed-files/commit/f991633730ca94b13263b3db2bfe3bb4406050e8)) - (Tonye Jack)
|
||||
- Updated README.md ([#1231](https://github.com/tj-actions/changed-files/issues/1231))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([1fc4377](https://github.com/tj-actions/changed-files/commit/1fc4377f0376e9e24eb836467b94dc0dbe92087a)) - (tj-actions[bot])
|
||||
- Updated README.md ([#1228](https://github.com/tj-actions/changed-files/issues/1228))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([cdf9afc](https://github.com/tj-actions/changed-files/commit/cdf9afcec863cb917421feea4e2d3fef708b2449)) - (tj-actions[bot])
|
||||
- Update README.md ([f58fe58](https://github.com/tj-actions/changed-files/commit/f58fe58af9008ac4c45e7caf949ff95791a9deef)) - (Tonye Jack)
|
||||
- Update action.yml ([9ab4230](https://github.com/tj-actions/changed-files/commit/9ab423063bd7d1ee892ecd5a0ce25f81f604e4f4)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update typescript-eslint monorepo to v5.59.9 ([#1227](https://github.com/tj-actions/changed-files/issues/1227)) ([b8dd3a1](https://github.com/tj-actions/changed-files/commit/b8dd3a1a069b5eb261603aa081023c3e9689d6a4)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.17 ([#1226](https://github.com/tj-actions/changed-files/issues/1226))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([6e4b6b7](https://github.com/tj-actions/changed-files/commit/6e4b6b77a3fd4d60bd02608dba69c7eae38a117f)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.17](https://github.com/tj-actions/changed-files/compare/v36.0.16...v36.0.17) - (2023-06-05)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- Update README.md ([#1225](https://github.com/tj-actions/changed-files/issues/1225)) ([b137868](https://github.com/tj-actions/changed-files/commit/b13786805affca18e536ed489687d3d8d1f05d21)) - (Tonye Jack)
|
||||
- **deps:** Lock file maintenance ([#1224](https://github.com/tj-actions/changed-files/issues/1224)) ([7c72320](https://github.com/tj-actions/changed-files/commit/7c7232040403e5ad44fb31057f9b7efe9dd43ace)) - (renovate[bot])
|
||||
- Update test.yml ([#1223](https://github.com/tj-actions/changed-files/issues/1223)) ([763a7bf](https://github.com/tj-actions/changed-files/commit/763a7bfbb5780f6798eb06361a5c91495c8b7488)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.16 ([#1222](https://github.com/tj-actions/changed-files/issues/1222))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([c789aec](https://github.com/tj-actions/changed-files/commit/c789aecfa677158f0ac6a33a87e38a2b4f530aea)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.16](https://github.com/tj-actions/changed-files/compare/v36.0.15...v36.0.16) - (2023-06-03)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Lock file maintenance ([#1221](https://github.com/tj-actions/changed-files/issues/1221)) ([1aae160](https://github.com/tj-actions/changed-files/commit/1aae16084af435f73c8cdfd742473028810c5f20)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint to v8.42.0 ([#1220](https://github.com/tj-actions/changed-files/issues/1220)) ([a593948](https://github.com/tj-actions/changed-files/commit/a593948c900d7f83d14a30cb162657a8d9894b0e)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.15 ([#1219](https://github.com/tj-actions/changed-files/issues/1219))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([96134b7](https://github.com/tj-actions/changed-files/commit/96134b7430da6261abf9182b7f2df2ae06eee300)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.15](https://github.com/tj-actions/changed-files/compare/v36.0.14...v36.0.15) - (2023-06-02)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug retrieving base sha for force push ([#1216](https://github.com/tj-actions/changed-files/issues/1216)) ([47db5bd](https://github.com/tj-actions/changed-files/commit/47db5bd435ab26939338ff899af621be52f44da4)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Update README.md ([5436326](https://github.com/tj-actions/changed-files/commit/5436326dcff90d144b503f5956174744e1e2f3dd)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update dependency typescript to v5.1.3 ([#1215](https://github.com/tj-actions/changed-files/issues/1215)) ([5d2fcdb](https://github.com/tj-actions/changed-files/commit/5d2fcdb4cbef720a52f49fd05d8c7edd18a64758)) - (renovate[bot])
|
||||
- **deps:** Update dependency eslint-plugin-github to v4.8.0 ([#1218](https://github.com/tj-actions/changed-files/issues/1218)) ([c0a8bcf](https://github.com/tj-actions/changed-files/commit/c0a8bcfa6aa8d8cb3617f30d7a97a9a94233f526)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([#1217](https://github.com/tj-actions/changed-files/issues/1217)) ([4bc117d](https://github.com/tj-actions/changed-files/commit/4bc117de0ccad2c57bf65627d45b5a397ad7aeab)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.14 ([#1214](https://github.com/tj-actions/changed-files/issues/1214))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([eeb5a25](https://github.com/tj-actions/changed-files/commit/eeb5a258f54ff87633389337e566ad43b7429c8d)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.14](https://github.com/tj-actions/changed-files/compare/v36.0.13...v36.0.14) - (2023-06-01)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug with retrieving the base sha when since last commit is enabled ([#1213](https://github.com/tj-actions/changed-files/issues/1213)) ([9ecc6e7](https://github.com/tj-actions/changed-files/commit/9ecc6e7fe2e26945b52485ccd9bc4b44000f5af1)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.13 ([#1212](https://github.com/tj-actions/changed-files/issues/1212))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||
Co-authored-by: Tonye Jack <jtonye@ymail.com> ([72cf889](https://github.com/tj-actions/changed-files/commit/72cf8893fc62273c86d15f761e8693ee99067553)) - (tj-actions[bot])
|
||||
- Upgraded to v36.0.12 ([#1210](https://github.com/tj-actions/changed-files/issues/1210))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
|
||||
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([28d6f29](https://github.com/tj-actions/changed-files/commit/28d6f2964c56cd2c00615dae99814ebcb3339c32)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.13](https://github.com/tj-actions/changed-files/compare/v36.0.12...v36.0.13) - (2023-06-01)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Error fetching history ([#1211](https://github.com/tj-actions/changed-files/issues/1211)) ([8c9ee56](https://github.com/tj-actions/changed-files/commit/8c9ee56d0180a538ad5b6b8a208e4db974bad9c0)) - (Tonye Jack)
|
||||
|
||||
# [36.0.12](https://github.com/tj-actions/changed-files/compare/v36.0.11...v36.0.12) - (2023-06-01)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug retrieving diff when persist credentials is false ([#1209](https://github.com/tj-actions/changed-files/issues/1209)) ([5978e5a](https://github.com/tj-actions/changed-files/commit/5978e5a2df95ef20cde627d4acb5edd1f87ba46a)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36.0.11 ([#1208](https://github.com/tj-actions/changed-files/issues/1208))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([ab45871](https://github.com/tj-actions/changed-files/commit/ab45871481bbe65bf9de161fdb13c95410d9b930)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.11](https://github.com/tj-actions/changed-files/compare/v36.0.10...v36.0.11) - (2023-05-31)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
388
README.md
388
README.md
@@ -19,12 +19,14 @@
|
||||
|
||||
## changed-files
|
||||
|
||||
Retrieve all changed files and directories relative to a target branch, preceeding commit or the last remote commit returning a **relative path** 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.
|
||||
|
||||
## Table of contents
|
||||
|
||||
* [Features](#features)
|
||||
* [Usage](#usage)
|
||||
* [On `pull_request`](#on-pull_request)
|
||||
* [On `push`](#on-push)
|
||||
* [Useful Acronyms](#useful-acronyms)
|
||||
* [Outputs](#outputs)
|
||||
* [Inputs](#inputs)
|
||||
@@ -39,28 +41,37 @@ Retrieve all changed files and directories relative to a target branch, preceedi
|
||||
|
||||
## Features
|
||||
|
||||
* Fast execution (0-10 seconds on average).
|
||||
* Easy to debug.
|
||||
* Scales to large repositories.
|
||||
* Provides fast execution, averaging 0-10 seconds.
|
||||
* Leverages either [Github's REST API](https://docs.github.com/en/rest/reference/repos#list-commits) or [Git's native diff](https://git-scm.com/docs/git-diff) to determine changed files.
|
||||
* Facilitates easy debugging.
|
||||
* Scales to handle large repositories.
|
||||
* Supports Git submodules.
|
||||
* Escaped JSON output which can be used to run matrix jobs based on changed files.
|
||||
* List changed directories.
|
||||
* Restrict the max depth of matching changed directories.
|
||||
* Write outputs to a `.txt` or `.json` file at a specified location for further processing.
|
||||
* Monorepos (Fetches a fixed number of commits).
|
||||
* Supports all platforms (Linux, MacOS, Windows).
|
||||
* [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) support
|
||||
* [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server) support.
|
||||
* [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) support.
|
||||
* List all files and directories that have changed:
|
||||
* Generates escaped JSON output for running matrix jobs based on changed files.
|
||||
* Lists changed directories.
|
||||
* Allows limiting the matching changed directories to a specified maximum depth.
|
||||
* Optionally excludes the current directory.
|
||||
* Writes outputs to a designated `.txt` or `.json` file for further processing.
|
||||
* Restores deleted files to their previous location or a newly specified location.
|
||||
* Supports Monorepos by fetching a fixed number of commits.
|
||||
* Compatible with all platforms (Linux, MacOS, Windows).
|
||||
* Supports [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners).
|
||||
* Supports [GitHub Enterprise Server](https://docs.github.com/en/enterprise-server@3.3/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server).
|
||||
* Supports [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners).
|
||||
* Lists all files and directories that have changed:
|
||||
* Between the current pull request branch and the last commit on the target branch.
|
||||
* Between the last commit and the current pushed change.
|
||||
* Between the last remote branch commit and the current HEAD.
|
||||
* Restrict change detection to a subset of files and directories:
|
||||
* Boolean output indicating that certain files have been changed.
|
||||
* Using [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
|
||||
* Globstar.
|
||||
* Brace expansion.
|
||||
* Restricts change detection to a subset of files and directories:
|
||||
* Provides boolean output indicating changes in specific files.
|
||||
* Uses [Glob pattern](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) matching.
|
||||
* Supports Globstar.
|
||||
* Supports brace expansion.
|
||||
* Supports negation.
|
||||
* Uses [YAML](https://yaml.org/) syntax for specifying patterns.
|
||||
* Supports [YAML anchors & aliases](https://www.educative.io/blog/advanced-yaml-syntax-cheatsheet#anchors).
|
||||
* Supports [YAML multi-line strings](https://learnxinyminutes.com/docs/yaml/).
|
||||
|
||||
And many more.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -68,27 +79,54 @@ Retrieve all changed files and directories relative to a target branch, preceedi
|
||||
>
|
||||
> * **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 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.
|
||||
> * All multiline inputs should not use double or single quotes since the value is already a string seperated by a newline character. See [Examples](#examples) for more information.
|
||||
> * 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.
|
||||
> * 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`.
|
||||
> * 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)
|
||||
|
||||
### On `pull_request`
|
||||
|
||||
```yaml
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
# Event `push`: Compare the preceeding 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.
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# -------------------------------------------------------------
|
||||
# Using GitHub's API
|
||||
# -------------------------------------------------------------
|
||||
# Event `pull_request`: Returns all changed pull request files.
|
||||
# --------------------------------------------------------------
|
||||
job1:
|
||||
# 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 directory" below.
|
||||
|
||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
||||
name: Test changed-files
|
||||
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
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
# Using local .git directory
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
# Event `pull_request`: Compare the last commit of main or last remote commit of the PR branch -> to the current commit of a PR branch.
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
job2:
|
||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
||||
name: Test changed-files
|
||||
steps:
|
||||
@@ -99,7 +137,7 @@ jobs:
|
||||
# Example 1
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
|
||||
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
|
||||
# with:
|
||||
@@ -114,31 +152,109 @@ jobs:
|
||||
# Example 2
|
||||
- name: Get changed files in the docs folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
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
|
||||
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
||||
run: |
|
||||
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 }}"
|
||||
|
||||
# Example 3
|
||||
- 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@v36
|
||||
with:
|
||||
files: |
|
||||
**.js
|
||||
static
|
||||
files_ignore: docs
|
||||
|
||||
- name: Run step if any .js file(s) or any file in the static folder change
|
||||
if: steps.changed-files-excluded.outputs.any_changed == 'true'
|
||||
# Example 3
|
||||
- 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/**
|
||||
- !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
|
||||
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
|
||||
run: |
|
||||
echo "One or more .js file(s) or any file in the static folder but not in the doc folder has changed."
|
||||
echo "List all the files that have changed: ${{ steps.changed-files-excluded.outputs.all_changed_files }}"
|
||||
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 }}"
|
||||
```
|
||||
|
||||
### On `push`
|
||||
|
||||
```yaml
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
# -------------------------------
|
||||
# Optionally run on other events
|
||||
# -------------------------------
|
||||
# schedule:
|
||||
# - cron: '0 0 * * *'
|
||||
#
|
||||
# release:
|
||||
# types: [published]
|
||||
#
|
||||
# push:
|
||||
# tags:
|
||||
# - '**'
|
||||
#
|
||||
# ...and many more
|
||||
|
||||
|
||||
jobs:
|
||||
# -------------------------------------------------------------
|
||||
# Using GitHub's API is not supported for push events
|
||||
# -------------------------------------------------------------
|
||||
#
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
# Using local .git directory
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
# Event `push`: Compare the preceding remote commit -> to the current commit of the main branch
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
job2:
|
||||
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.
|
||||
|
||||
# Example 1
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v37
|
||||
|
||||
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
|
||||
|
||||
- name: List all changed files
|
||||
run: |
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||
echo "$file was changed"
|
||||
done
|
||||
|
||||
# Example 2: See above
|
||||
...
|
||||
|
||||
# Example 3: See above
|
||||
...
|
||||
```
|
||||
|
||||
To access more examples, navigate to the [Examples](#examples) section.
|
||||
@@ -170,29 +286,44 @@ Support this project with a :star:
|
||||
|
||||
<!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section -->
|
||||
|
||||
| OUTPUT | TYPE | DESCRIPTION |
|
||||
|--------------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| added\_files | string | Returns only files that are <br>Added (A). |
|
||||
| all\_changed\_and\_modified\_files | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
|
||||
| all\_changed\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
|
||||
| all\_modified\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
|
||||
| all\_old\_new\_renamed\_files | string | Returns only files that are <br>Renamed and list their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true` <br>(R) |
|
||||
| any\_changed | string | Returns `true` when any of <br>the filenames provided using the <br>`files` input has changed. i.e. <br>*using a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| any\_deleted | string | Returns `true` when any of <br>the filenames provided using the <br>`files` input has been deleted. <br>(D) |
|
||||
| any\_modified | string | Returns `true` when any of <br>the filenames provided using the <br>`files` input has been modified. <br>i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
|
||||
| copied\_files | string | Returns only files that are <br>Copied (C). |
|
||||
| deleted\_files | string | Returns only files that are <br>Deleted (D). |
|
||||
| modified\_files | string | Returns only files that are <br>Modified (M). |
|
||||
| only\_changed | string | Returns `true` when only files <br>provided using the `files` input <br>has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| only\_deleted | string | Returns `true` when only files <br>provided using the `files` input <br>has been deleted. (D) |
|
||||
| only\_modified | string | Returns `true` when only files <br>provided using the `files` input <br>has been modified. (ACMRD). |
|
||||
| other\_changed\_files | string | Returns all other changed files <br>not listed in the files <br>input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| other\_deleted\_files | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* |
|
||||
| other\_modified\_files | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
|
||||
| renamed\_files | string | Returns only files that are <br>Renamed (R). |
|
||||
| type\_changed\_files | string | Returns only files that have <br>their file type changed (T). |
|
||||
| unknown\_files | string | Returns only files that are <br>Unknown (X). |
|
||||
| unmerged\_files | string | Returns only files that are <br>Unmerged (U). |
|
||||
| OUTPUT | TYPE | DESCRIPTION |
|
||||
|--------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| added\_files | string | Returns only files that are <br>Added (A). |
|
||||
| added\_files\_count | string | Returns the number of `added_files` |
|
||||
| all\_changed\_and\_modified\_files | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
|
||||
| all\_changed\_and\_modified\_files\_count | string | Returns the number of `all_changed_and_modified_files` |
|
||||
| all\_changed\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
|
||||
| all\_changed\_files\_count | string | Returns the number of `all_changed_files` |
|
||||
| all\_modified\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
|
||||
| all\_modified\_files\_count | string | Returns the number of `all_modified_files` |
|
||||
| all\_old\_new\_renamed\_files | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
|
||||
| all\_old\_new\_renamed\_files\_count | string | Returns the number of `all_old_new_renamed_files` |
|
||||
| any\_changed | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has changed. i.e. <br>*using a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| any\_deleted | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been deleted. <br>(D) |
|
||||
| any\_modified | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been modified. <br>i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
|
||||
| copied\_files | string | Returns only files that are <br>Copied (C). |
|
||||
| copied\_files\_count | string | Returns the number of `copied_files` |
|
||||
| deleted\_files | string | Returns only files that are <br>Deleted (D). |
|
||||
| deleted\_files\_count | string | Returns the number of `deleted_files` |
|
||||
| modified\_files | string | Returns only files that are <br>Modified (M). |
|
||||
| modified\_files\_count | string | Returns the number of `modified_files` |
|
||||
| only\_changed | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| only\_deleted | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been deleted. (D) |
|
||||
| only\_modified | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been modified. (ACMRD). |
|
||||
| other\_changed\_files | string | Returns all other changed files <br>not listed in the files <br>input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| other\_changed\_files\_count | string | Returns the number of `other_changed_files` |
|
||||
| other\_deleted\_files | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* |
|
||||
| other\_deleted\_files\_count | string | Returns the number of `other_deleted_files` |
|
||||
| other\_modified\_files | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
|
||||
| other\_modified\_files\_count | string | Returns the number of `other_modified_files` |
|
||||
| renamed\_files | string | Returns only files that are <br>Renamed (R). |
|
||||
| renamed\_files\_count | string | Returns the number of `renamed_files` |
|
||||
| type\_changed\_files | string | Returns only files that have <br>their file type changed (T). |
|
||||
| type\_changed\_files\_count | string | Returns the number of `type_changed_files` |
|
||||
| unknown\_files | string | Returns only files that are <br>Unknown (X). |
|
||||
| unknown\_files\_count | string | Returns the number of `unknown_files` |
|
||||
| unmerged\_files | string | Returns only files that are <br>Unmerged (U). |
|
||||
| unmerged\_files\_count | string | Returns the number of `unmerged_files` |
|
||||
|
||||
<!-- AUTO-DOC-OUTPUT:END -->
|
||||
|
||||
@@ -200,36 +331,47 @@ Support this project with a :star:
|
||||
|
||||
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
||||
|
||||
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|
||||
|-----------------------------------------|--------|----------|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| base\_sha | string | false | | Specify a different base commit <br>SHA used for comparing changes |
|
||||
| diff\_relative | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
|
||||
| dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the root of the <br>project. |
|
||||
| dir\_names\_exclude\_root | string | false | `"false"` | Exclude the root directory represented <br>by `.` from the output <br>when `dir_names`is set to `true`. |
|
||||
| dir\_names\_max\_depth | string | false | | Maximum depth of directories to <br>output. e.g `test/test1/test2` with max <br>depth of `2` returns `test/test1`. |
|
||||
| escape\_json | string | false | `"true"` | Escape JSON output. |
|
||||
| fetch\_depth | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
|
||||
| files | string | false | | File and directory patterns to <br>detect changes using only these <br>list of file(s) (Defaults to the entire repo) **NOTE:** <br>Multiline file/directory patterns should not <br>include quotes. |
|
||||
| files\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files` input. |
|
||||
| files\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input |
|
||||
| files\_ignore | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. |
|
||||
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore` input |
|
||||
| files\_ignore\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input |
|
||||
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore` input |
|
||||
| files\_separator | string | false | `"\n"` | Separator used to split the <br>`files` input |
|
||||
| include\_all\_old\_new\_renamed\_files | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this <br>can generate a large output <br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
|
||||
| json | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. |
|
||||
| old\_new\_files\_separator | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
|
||||
| old\_new\_separator | string | false | `","` | Split character for old and <br>new filename pairs. |
|
||||
| output\_dir | string | false | `".github/outputs"` | Directory to store output files. |
|
||||
| path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
|
||||
| quotepath | string | false | `"true"` | Use non ascii characters to <br>match files and output the <br>filenames completely verbatim by setting <br>this to `false` |
|
||||
| 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 <br>target branch for pull request <br>events and the previous remote <br>commit of the current branch <br>for push events. |
|
||||
| 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 files in <br>the `.github/outputs` folder by default. |
|
||||
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|
||||
|----------------------------------------------|--------|----------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| api\_url | string | false | `"${{ github.api_url }}"` | Github API URL. |
|
||||
| base\_sha | string | false | | Specify a different base commit <br>SHA used for comparing changes |
|
||||
| diff\_relative | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
|
||||
| dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. |
|
||||
| dir\_names\_exclude\_current\_dir | string | false | `"false"` | Exclude the current directory represented <br>by `.` from the output <br>when `dir_names` is set to <br>`true`. |
|
||||
| dir\_names\_max\_depth | string | false | | Limit the directory output to <br>a maximum depth e.g `test/test1/test2` <br>with max depth of `2` <br>returns `test/test1`. |
|
||||
| escape\_json | string | false | `"true"` | Escape JSON output. |
|
||||
| fetch\_depth | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
|
||||
| files | string | false | | File and directory patterns used <br>to detect changes (Defaults to the entire repo if unset) **NOTE:** <br>Multiline file/directory patterns should not <br>include quotes. |
|
||||
| files\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files` input. |
|
||||
| files\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input |
|
||||
| files\_ignore | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. |
|
||||
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore` input |
|
||||
| files\_ignore\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input |
|
||||
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore` input |
|
||||
| files\_ignore\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>ignore changes |
|
||||
| files\_ignore\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
|
||||
| files\_ignore\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_yaml_from_source_file` input |
|
||||
| files\_separator | string | false | `"\n"` | Separator used to split the <br>`files` input |
|
||||
| files\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>detect changes |
|
||||
| files\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
|
||||
| files\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` input |
|
||||
| include\_all\_old\_new\_renamed\_files | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this <br>can generate a large output <br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
|
||||
| json | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. |
|
||||
| old\_new\_files\_separator | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
|
||||
| old\_new\_separator | string | false | `","` | Split character for old and <br>new filename pairs. |
|
||||
| output\_dir | string | false | `".github/outputs"` | Directory to store output files. |
|
||||
| output\_renamed\_files\_as\_deleted\_and\_added | string | false | `"false"` | Output renamed files as deleted <br>and added files. |
|
||||
| path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
|
||||
| quotepath | string | false | `"true"` | Use non-ascii characters to match <br>files and output the filenames <br>completely verbatim by setting this <br>to `false` |
|
||||
| recover\_deleted\_files | string | false | `"false"` | Recover deleted files. |
|
||||
| recover\_deleted\_files\_to\_destination | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. |
|
||||
| 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. |
|
||||
| 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 -->
|
||||
|
||||
@@ -239,11 +381,11 @@ This GitHub Action follows the principles of [Semantic Versioning](https://semve
|
||||
|
||||
The format of the version string is as follows:
|
||||
|
||||
major: is a major release number that indicates significant changes or new features that may not be backward compatible.
|
||||
* major: indicates significant changes or new features that may not be backward compatible.
|
||||
|
||||
minor: is a minor release number that indicates minor changes or new features that are backward compatible.
|
||||
* minor: indicates minor changes or new features that are backward compatible.
|
||||
|
||||
patch : is a patch release number that indicates bug fixes or other small changes that are backward compatible.
|
||||
* patch: indicates bug fixes or other small changes that are backward compatible.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -254,7 +396,7 @@ patch : is a patch release number that indicates bug fixes or other small change
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
...
|
||||
```
|
||||
|
||||
@@ -267,7 +409,7 @@ patch : is a patch release number that indicates bug fixes or other small change
|
||||
...
|
||||
- name: Get all changed files and use a comma separator in the output
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
separator: ","
|
||||
...
|
||||
@@ -284,7 +426,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
|
||||
- name: List all added files
|
||||
run: |
|
||||
@@ -305,7 +447,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
|
||||
- name: Run a step if my-file.txt was modified
|
||||
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
|
||||
@@ -365,7 +507,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -388,7 +530,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -435,7 +577,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files using a source file or list of file(s) to populate to files input.
|
||||
id: changed-files-specific-source-file
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
files_from_source_file: test/changed-files-list.txt
|
||||
...
|
||||
@@ -452,7 +594,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files.
|
||||
id: changed-files-specific-source-file-and-specify-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -473,7 +615,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
sha: ${{ github.event.pull_request.head.sha }}
|
||||
...
|
||||
@@ -490,7 +632,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different base SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
||||
...
|
||||
@@ -522,11 +664,11 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
|
||||
- name: Get changed files in the .github folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
|
||||
files: .github/**
|
||||
@@ -556,7 +698,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with defaults in dir1
|
||||
id: changed-files-for-dir1
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
@@ -579,7 +721,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with quotepath disabled
|
||||
id: changed-files-quotepath
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
quotepath: "false"
|
||||
|
||||
@@ -618,7 +760,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run
|
||||
id: changed-files-base-sha-push
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||
...
|
||||
@@ -645,7 +787,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run on main
|
||||
id: changed-files-base-sha-pull-request
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
||||
...
|
||||
@@ -669,7 +811,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with dir_names
|
||||
id: changed-files-dir-names
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
dir_names: "true"
|
||||
...
|
||||
@@ -686,7 +828,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with json output
|
||||
id: changed-files-json
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
json: "true"
|
||||
...
|
||||
@@ -703,13 +845,13 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed-files since 2022-08-19
|
||||
id: changed-files-since
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
since: "2022-08-19"
|
||||
|
||||
- name: Get changed-files until 2022-08-20
|
||||
id: changed-files-until
|
||||
uses: tj-actions/changed-files@v36
|
||||
uses: tj-actions/changed-files@v37
|
||||
with:
|
||||
until: "2022-08-20"
|
||||
...
|
||||
@@ -735,6 +877,10 @@ 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)
|
||||
|
||||
* [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...
|
||||
|
||||
## Known Limitation
|
||||
|
||||
106
action.yml
106
action.yml
@@ -1,5 +1,5 @@
|
||||
name: Changed Files
|
||||
description: Get all Added, Copied, Modified, Deleted, Renamed, Type changed, Unmerged, Unknown files.
|
||||
description: Get all Added, Copied, Modified, Deleted, Renamed, Type changed, Unmerged, and Unknown files.
|
||||
author: tj-actions
|
||||
|
||||
inputs:
|
||||
@@ -28,13 +28,37 @@ inputs:
|
||||
default: "\n"
|
||||
required: false
|
||||
files:
|
||||
description: "File and directory patterns to detect changes using only these list of file(s) (Defaults to the entire repo) **NOTE:** Multiline file/directory patterns should not include quotes."
|
||||
description: "File and directory patterns used to detect changes (Defaults to the entire repo if unset) **NOTE:** Multiline file/directory patterns should not include quotes."
|
||||
required: false
|
||||
default: ""
|
||||
files_separator:
|
||||
description: "Separator used to split the `files` input"
|
||||
default: "\n"
|
||||
required: false
|
||||
files_yaml:
|
||||
description: "YAML used to define a set of file patterns to detect changes"
|
||||
required: false
|
||||
default: ""
|
||||
files_yaml_from_source_file:
|
||||
description: "Source file(s) used to populate the `files_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml)"
|
||||
required: false
|
||||
default: ""
|
||||
files_yaml_from_source_file_separator:
|
||||
description: 'Separator used to split the `files_yaml_from_source_file` input'
|
||||
default: "\n"
|
||||
required: false
|
||||
files_ignore_yaml:
|
||||
description: "YAML used to define a set of file patterns to ignore changes"
|
||||
required: false
|
||||
default: ""
|
||||
files_ignore_yaml_from_source_file:
|
||||
description: "Source file(s) used to populate the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml)"
|
||||
required: false
|
||||
default: ""
|
||||
files_ignore_yaml_from_source_file_separator:
|
||||
description: 'Separator used to split the `files_ignore_yaml_from_source_file` input'
|
||||
default: "\n"
|
||||
required: false
|
||||
files_ignore:
|
||||
description: "Ignore changes to these file(s) **NOTE:** Multiline file/directory patterns should not include quotes."
|
||||
required: false
|
||||
@@ -70,7 +94,7 @@ inputs:
|
||||
required: false
|
||||
default: "."
|
||||
quotepath:
|
||||
description: "Use non ascii characters to match files and output the filenames completely verbatim by setting this to `false`"
|
||||
description: "Use non-ascii characters to match files and output the filenames completely verbatim by setting this to `false`"
|
||||
default: "true"
|
||||
required: false
|
||||
diff_relative:
|
||||
@@ -79,13 +103,13 @@ inputs:
|
||||
default: "true"
|
||||
dir_names:
|
||||
default: "false"
|
||||
description: "Output unique changed directories instead of filenames. **NOTE:** This returns `.` for changed files located in the root of the project."
|
||||
description: "Output unique changed directories instead of filenames. **NOTE:** This returns `.` for changed files located in the current working directory which defaults to `$GITHUB_WORKSPACE`."
|
||||
required: false
|
||||
dir_names_max_depth:
|
||||
description: "Maximum depth of directories to output. e.g `test/test1/test2` with max depth of `2` returns `test/test1`."
|
||||
description: "Limit the directory output to a maximum depth e.g `test/test1/test2` with max depth of `2` returns `test/test1`."
|
||||
required: false
|
||||
dir_names_exclude_root:
|
||||
description: "Exclude the root directory represented by `.` from the output when `dir_names`is set to `true`."
|
||||
dir_names_exclude_current_dir:
|
||||
description: "Exclude the current directory represented by `.` from the output when `dir_names` is set to `true`."
|
||||
required: false
|
||||
default: "false"
|
||||
json:
|
||||
@@ -101,61 +125,111 @@ inputs:
|
||||
required: false
|
||||
default: "50"
|
||||
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
|
||||
default: "false"
|
||||
write_output_files:
|
||||
description: "Write outputs to files in the `.github/outputs` folder by default."
|
||||
description: "Write outputs to the `output_dir` defaults to `.github/outputs` folder. **NOTE:** This creates a `.txt` file by default and a `.json` file if `json` is set to `true`."
|
||||
required: false
|
||||
default: "false"
|
||||
output_dir:
|
||||
description: "Directory to store output files."
|
||||
required: false
|
||||
default: ".github/outputs"
|
||||
output_renamed_files_as_deleted_and_added:
|
||||
description: "Output renamed files as deleted and added files."
|
||||
required: false
|
||||
default: "false"
|
||||
recover_deleted_files:
|
||||
description: "Recover deleted files."
|
||||
required: false
|
||||
default: "false"
|
||||
recover_deleted_files_to_destination:
|
||||
description: "Recover deleted files to a new destination directory, defaults to the original location."
|
||||
required: false
|
||||
default: ""
|
||||
token:
|
||||
description: "Github token used to fetch changed files from Github's API."
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
api_url:
|
||||
description: "Github API URL."
|
||||
required: false
|
||||
default: ${{ github.api_url }}
|
||||
|
||||
outputs:
|
||||
added_files:
|
||||
description: "Returns only files that are Added (A)."
|
||||
added_files_count:
|
||||
description: "Returns the number of `added_files`"
|
||||
copied_files:
|
||||
description: "Returns only files that are Copied (C)."
|
||||
copied_files_count:
|
||||
description: "Returns the number of `copied_files`"
|
||||
deleted_files:
|
||||
description: "Returns only files that are Deleted (D)."
|
||||
deleted_files_count:
|
||||
description: "Returns the number of `deleted_files`"
|
||||
modified_files:
|
||||
description: "Returns only files that are Modified (M)."
|
||||
modified_files_count:
|
||||
description: "Returns the number of `modified_files`"
|
||||
renamed_files:
|
||||
description: "Returns only files that are Renamed (R)."
|
||||
renamed_files_count:
|
||||
description: "Returns the number of `renamed_files`"
|
||||
all_old_new_renamed_files:
|
||||
description: "Returns only files that are Renamed and list their old and new names. **NOTE:** This requires setting `include_all_old_new_renamed_files` to `true` (R)"
|
||||
description: "Returns only files that are Renamed and lists their old and new names. **NOTE:** This requires setting `include_all_old_new_renamed_files` to `true`. Also, keep in mind that this output is global and wouldn't be nested in outputs generated when the `*_yaml_*` input is used. (R)"
|
||||
all_old_new_renamed_files_count:
|
||||
description: "Returns the number of `all_old_new_renamed_files`"
|
||||
type_changed_files:
|
||||
description: "Returns only files that have their file type changed (T)."
|
||||
type_changed_files_count:
|
||||
description: "Returns the number of `type_changed_files`"
|
||||
unmerged_files:
|
||||
description: "Returns only files that are Unmerged (U)."
|
||||
unmerged_files_count:
|
||||
description: "Returns the number of `unmerged_files`"
|
||||
unknown_files:
|
||||
description: "Returns only files that are Unknown (X)."
|
||||
unknown_files_count:
|
||||
description: "Returns the number of `unknown_files`"
|
||||
all_changed_and_modified_files:
|
||||
description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*"
|
||||
all_changed_and_modified_files_count:
|
||||
description: "Returns the number of `all_changed_and_modified_files`"
|
||||
all_changed_files:
|
||||
description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*"
|
||||
all_changed_files_count:
|
||||
description: "Returns the number of `all_changed_files`"
|
||||
any_changed:
|
||||
description: "Returns `true` when any of the filenames provided using the `files` input has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
only_changed:
|
||||
description: "Returns `true` when only files provided using the `files` input has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
other_changed_files:
|
||||
description: "Returns all other changed files not listed in the files input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
other_changed_files_count:
|
||||
description: "Returns the number of `other_changed_files`"
|
||||
all_modified_files:
|
||||
description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*."
|
||||
all_modified_files_count:
|
||||
description: "Returns the number of `all_modified_files`"
|
||||
any_modified:
|
||||
description: "Returns `true` when any of the filenames provided using the `files` input has been modified. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
|
||||
only_modified:
|
||||
description: "Returns `true` when only files provided using the `files` input has been modified. (ACMRD)."
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)."
|
||||
other_modified_files:
|
||||
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
|
||||
other_modified_files_count:
|
||||
description: "Returns the number of `other_modified_files`"
|
||||
any_deleted:
|
||||
description: "Returns `true` when any of the filenames provided using the `files` input has been deleted. (D)"
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
|
||||
only_deleted:
|
||||
description: "Returns `true` when only files provided using the `files` input has been deleted. (D)"
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
|
||||
other_deleted_files:
|
||||
description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
|
||||
other_deleted_files_count:
|
||||
description: "Returns the number of `other_deleted_files`"
|
||||
|
||||
runs:
|
||||
using: 'node16'
|
||||
|
||||
34593
dist/index.js
generated
vendored
34593
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
630
dist/licenses.txt
generated
vendored
630
dist/licenses.txt
generated
vendored
@@ -22,6 +22,18 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/github
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/http-client
|
||||
MIT
|
||||
Actions Http Client for Node.js
|
||||
@@ -59,6 +71,393 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@octokit/auth-token
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/core
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/endpoint
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/graphql
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/plugin-paginate-rest
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/plugin-rest-endpoint-methods
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/request
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/request-error
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@vercel/ncc
|
||||
MIT
|
||||
Copyright 2018 ZEIT, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
before-after-hook
|
||||
Apache-2.0
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 Gregor Martynus and other contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
braces
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
@@ -84,6 +483,25 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
deprecation
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Gregor Martynus and contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
fill-range
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
@@ -134,6 +552,82 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
is-plain-object
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
lodash
|
||||
MIT
|
||||
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||
|
||||
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals. For exact contribution history, see the revision history
|
||||
available at https://github.com/lodash/lodash
|
||||
|
||||
The following license applies to all parts of this software except as
|
||||
documented below:
|
||||
|
||||
====
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
====
|
||||
|
||||
Copyright and related rights for sample code are waived via CC0. Sample
|
||||
code is defined as all source code displayed within the prose of the
|
||||
documentation.
|
||||
|
||||
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
====
|
||||
|
||||
Files located in the node_modules and vendor directories are externally
|
||||
maintained libraries used by this software which have their own
|
||||
licenses; we recommend you read them, as their terms may differ from the
|
||||
terms above.
|
||||
|
||||
|
||||
micromatch
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
@@ -159,6 +653,51 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
node-fetch
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 David Frank
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
||||
once
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
picomatch
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
@@ -209,6 +748,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
tr46
|
||||
MIT
|
||||
|
||||
tunnel
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
@@ -234,6 +776,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
universal-user-agent
|
||||
ISC
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
uuid
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
@@ -245,3 +798,80 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
webidl-conversions
|
||||
BSD-2-Clause
|
||||
# The BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2014, Domenic Denicola
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
whatwg-url
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015–2016 Sebastian Mayr
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
wrappy
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
yaml
|
||||
ISC
|
||||
Copyright Eemeli Aro <eemeli@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright notice
|
||||
and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
|
||||
37
package.json
37
package.json
@@ -32,25 +32,30 @@
|
||||
},
|
||||
"homepage": "https://github.com/tj-actions/glob#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "1.10.0",
|
||||
"@actions/exec": "1.1.1",
|
||||
"micromatch": "^4.0.5"
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.1.1",
|
||||
"lodash": "^4.17.21",
|
||||
"micromatch": "^4.0.5",
|
||||
"yaml": "^2.3.1",
|
||||
"@octokit/rest": "^19.0.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "29.5.2",
|
||||
"@types/jest": "^29.5.2",
|
||||
"@types/lodash": "^4.14.195",
|
||||
"@types/micromatch": "^4.0.2",
|
||||
"@types/node": "20.2.1",
|
||||
"@types/uuid": "9.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.59.8",
|
||||
"@typescript-eslint/parser": "5.59.8",
|
||||
"@vercel/ncc": "0.36.1",
|
||||
"eslint": "8.41.0",
|
||||
"eslint-plugin-github": "4.7.0",
|
||||
"eslint-plugin-jest": "27.2.1",
|
||||
"@types/node": "^20.3.2",
|
||||
"@types/uuid": "^9.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||
"@typescript-eslint/parser": "^5.60.1",
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"eslint": "^8.43.0",
|
||||
"eslint-plugin-github": "^4.8.0",
|
||||
"eslint-plugin-jest": "^27.2.2",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "29.5.0",
|
||||
"prettier": "2.8.8",
|
||||
"ts-jest": "29.1.0",
|
||||
"typescript": "5.0.4"
|
||||
"jest": "^29.5.0",
|
||||
"prettier": "^2.8.8",
|
||||
"ts-jest": "^29.1.0",
|
||||
"typescript": "^5.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import type {RestEndpointMethodTypes} from '@octokit/rest'
|
||||
import * as path from 'path'
|
||||
|
||||
import {DiffResult} from './commitSha'
|
||||
import {Env} from './env'
|
||||
import {Inputs} from './inputs'
|
||||
import {
|
||||
getDirnameMaxDepth,
|
||||
gitDiff,
|
||||
gitRenamedFiles,
|
||||
gitSubmoduleDiffSHA,
|
||||
jsonOutput
|
||||
jsonOutput,
|
||||
getAllChangedFiles
|
||||
} from './utils'
|
||||
import flatten from 'lodash/flatten'
|
||||
|
||||
export const getRenamedFiles = async ({
|
||||
inputs,
|
||||
@@ -22,7 +27,7 @@ export const getRenamedFiles = async ({
|
||||
hasSubmodule: boolean
|
||||
diffResult: DiffResult
|
||||
submodulePaths: string[]
|
||||
}): Promise<string> => {
|
||||
}): Promise<{paths: string; count: string}> => {
|
||||
const renamedFiles = await gitRenamedFiles({
|
||||
cwd: workingDirectory,
|
||||
sha1: diffResult.previousSha,
|
||||
@@ -62,36 +67,52 @@ export const getRenamedFiles = async ({
|
||||
}
|
||||
|
||||
if (inputs.json) {
|
||||
return jsonOutput({value: renamedFiles, shouldEscape: inputs.escapeJson})
|
||||
return {
|
||||
paths: jsonOutput({value: renamedFiles, shouldEscape: inputs.escapeJson}),
|
||||
count: renamedFiles.length.toString()
|
||||
}
|
||||
}
|
||||
|
||||
return renamedFiles.join(inputs.oldNewFilesSeparator)
|
||||
return {
|
||||
paths: renamedFiles.join(inputs.oldNewFilesSeparator),
|
||||
count: renamedFiles.length.toString()
|
||||
}
|
||||
}
|
||||
|
||||
export const getDiffFiles = async ({
|
||||
inputs,
|
||||
export enum ChangeTypeEnum {
|
||||
Added = 'A',
|
||||
Copied = 'C',
|
||||
Deleted = 'D',
|
||||
Modified = 'M',
|
||||
Renamed = 'R',
|
||||
TypeChanged = 'T',
|
||||
Unmerged = 'U',
|
||||
Unknown = 'X'
|
||||
}
|
||||
|
||||
export type ChangedFiles = {
|
||||
[key in ChangeTypeEnum]: string[]
|
||||
}
|
||||
|
||||
export const getAllDiffFiles = async ({
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter,
|
||||
filePatterns = [],
|
||||
submodulePaths
|
||||
submodulePaths,
|
||||
outputRenamedFilesAsDeletedAndAdded
|
||||
}: {
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
hasSubmodule: boolean
|
||||
diffResult: DiffResult
|
||||
diffFilter: string
|
||||
filePatterns?: string[]
|
||||
submodulePaths: string[]
|
||||
}): Promise<string> => {
|
||||
let files = await gitDiff({
|
||||
outputRenamedFilesAsDeletedAndAdded: boolean
|
||||
}): Promise<ChangedFiles> => {
|
||||
const files = await getAllChangedFiles({
|
||||
cwd: workingDirectory,
|
||||
sha1: diffResult.previousSha,
|
||||
sha2: diffResult.currentSha,
|
||||
diff: diffResult.diff,
|
||||
diffFilter,
|
||||
filePatterns
|
||||
outputRenamedFilesAsDeletedAndAdded
|
||||
})
|
||||
|
||||
if (hasSubmodule) {
|
||||
@@ -110,35 +131,186 @@ export const getDiffFiles = async ({
|
||||
)
|
||||
|
||||
if (submoduleShaResult.currentSha && submoduleShaResult.previousSha) {
|
||||
const submoduleFiles = await gitDiff({
|
||||
const submoduleFiles = await getAllChangedFiles({
|
||||
cwd: submoduleWorkingDirectory,
|
||||
sha1: submoduleShaResult.previousSha,
|
||||
sha2: submoduleShaResult.currentSha,
|
||||
diff: diffResult.diff,
|
||||
diffFilter,
|
||||
isSubmodule: true,
|
||||
filePatterns,
|
||||
parentDir: submodulePath
|
||||
parentDir: submodulePath,
|
||||
outputRenamedFilesAsDeletedAndAdded
|
||||
})
|
||||
files.push(...submoduleFiles)
|
||||
|
||||
for (const changeType of Object.keys(
|
||||
submoduleFiles
|
||||
) as ChangeTypeEnum[]) {
|
||||
if (!files[changeType]) {
|
||||
files[changeType] = []
|
||||
}
|
||||
files[changeType].push(...submoduleFiles[changeType])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inputs.dirNames) {
|
||||
files = files.map(file =>
|
||||
getDirnameMaxDepth({
|
||||
pathStr: file,
|
||||
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
|
||||
excludeRoot: inputs.dirNamesExcludeRoot
|
||||
})
|
||||
)
|
||||
files = [...new Set(files)]
|
||||
return files
|
||||
}
|
||||
|
||||
function* getChangeTypeFilesGenerator({
|
||||
inputs,
|
||||
changedFiles,
|
||||
changeTypes
|
||||
}: {
|
||||
inputs: Inputs
|
||||
changedFiles: ChangedFiles
|
||||
changeTypes: ChangeTypeEnum[]
|
||||
}): Generator<string> {
|
||||
for (const changeType of changeTypes) {
|
||||
const files = changedFiles[changeType] || []
|
||||
for (const file of files) {
|
||||
if (inputs.dirNames) {
|
||||
yield getDirnameMaxDepth({
|
||||
pathStr: file,
|
||||
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
|
||||
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
|
||||
})
|
||||
} else {
|
||||
yield file
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const getChangeTypeFiles = async ({
|
||||
inputs,
|
||||
changedFiles,
|
||||
changeTypes
|
||||
}: {
|
||||
inputs: Inputs
|
||||
changedFiles: ChangedFiles
|
||||
changeTypes: ChangeTypeEnum[]
|
||||
}): Promise<{paths: string; count: string}> => {
|
||||
const files = [
|
||||
...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes}))
|
||||
]
|
||||
|
||||
if (inputs.json) {
|
||||
return jsonOutput({value: files, shouldEscape: inputs.escapeJson})
|
||||
return {
|
||||
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
|
||||
count: files.length.toString()
|
||||
}
|
||||
}
|
||||
|
||||
return files.join(inputs.separator)
|
||||
return {
|
||||
paths: files.join(inputs.separator),
|
||||
count: files.length.toString()
|
||||
}
|
||||
}
|
||||
|
||||
function* getAllChangeTypeFilesGenerator({
|
||||
inputs,
|
||||
changedFiles
|
||||
}: {
|
||||
inputs: Inputs
|
||||
changedFiles: ChangedFiles
|
||||
}): Generator<string> {
|
||||
for (const file of flatten(Object.values(changedFiles))) {
|
||||
if (inputs.dirNames) {
|
||||
yield getDirnameMaxDepth({
|
||||
pathStr: file,
|
||||
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
|
||||
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
|
||||
})
|
||||
} else {
|
||||
yield file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const getAllChangeTypeFiles = async ({
|
||||
inputs,
|
||||
changedFiles
|
||||
}: {
|
||||
inputs: Inputs
|
||||
changedFiles: ChangedFiles
|
||||
}): Promise<{paths: string; count: string}> => {
|
||||
const files = [
|
||||
...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles}))
|
||||
]
|
||||
|
||||
if (inputs.json) {
|
||||
return {
|
||||
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
|
||||
count: files.length.toString()
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
paths: files.join(inputs.separator),
|
||||
count: files.length.toString()
|
||||
}
|
||||
}
|
||||
|
||||
export const getChangedFilesFromGithubAPI = async ({
|
||||
inputs,
|
||||
env
|
||||
}: {
|
||||
inputs: Inputs
|
||||
env: Env
|
||||
}): Promise<ChangedFiles> => {
|
||||
const octokit = github.getOctokit(inputs.token, {
|
||||
baseUrl: inputs.apiUrl
|
||||
})
|
||||
const changedFiles: ChangedFiles = {
|
||||
[ChangeTypeEnum.Added]: [],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
[ChangeTypeEnum.Modified]: [],
|
||||
[ChangeTypeEnum.Renamed]: [],
|
||||
[ChangeTypeEnum.TypeChanged]: [],
|
||||
[ChangeTypeEnum.Unmerged]: [],
|
||||
[ChangeTypeEnum.Unknown]: []
|
||||
}
|
||||
|
||||
core.info('Getting changed files from GitHub API...')
|
||||
|
||||
const options = octokit.rest.pulls.listFiles.endpoint.merge({
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
pull_number: env.GITHUB_EVENT_PULL_REQUEST_NUMBER,
|
||||
per_page: 100
|
||||
})
|
||||
|
||||
const paginatedResponse = await octokit.paginate<
|
||||
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
|
||||
>(options)
|
||||
|
||||
core.info(`Found ${paginatedResponse.length} changed files from GitHub API`)
|
||||
const statusMap: Record<string, ChangeTypeEnum> = {
|
||||
added: ChangeTypeEnum.Added,
|
||||
removed: ChangeTypeEnum.Deleted,
|
||||
modified: ChangeTypeEnum.Modified,
|
||||
renamed: ChangeTypeEnum.Renamed,
|
||||
copied: ChangeTypeEnum.Copied,
|
||||
changed: ChangeTypeEnum.TypeChanged,
|
||||
unchanged: ChangeTypeEnum.Unmerged
|
||||
}
|
||||
|
||||
for await (const item of paginatedResponse) {
|
||||
const changeType: ChangeTypeEnum =
|
||||
statusMap[item.status] || ChangeTypeEnum.Unknown
|
||||
|
||||
if (changeType === ChangeTypeEnum.Renamed) {
|
||||
if (inputs.outputRenamedFilesAsDeletedAndAdded) {
|
||||
changedFiles[ChangeTypeEnum.Deleted].push(item.filename)
|
||||
changedFiles[ChangeTypeEnum.Added].push(item.filename)
|
||||
} else {
|
||||
changedFiles[ChangeTypeEnum.Renamed].push(item.filename)
|
||||
}
|
||||
} else {
|
||||
changedFiles[changeType].push(item.filename)
|
||||
}
|
||||
}
|
||||
|
||||
return changedFiles
|
||||
}
|
||||
|
||||
389
src/changedFilesOutput.ts
Normal file
389
src/changedFilesOutput.ts
Normal file
@@ -0,0 +1,389 @@
|
||||
import * as core from '@actions/core'
|
||||
import {
|
||||
ChangedFiles,
|
||||
ChangeTypeEnum,
|
||||
getAllChangeTypeFiles,
|
||||
getChangeTypeFiles
|
||||
} from './changedFiles'
|
||||
import {DiffResult} from './commitSha'
|
||||
import {Inputs} from './inputs'
|
||||
import {getFilteredChangedFiles, recoverDeletedFiles, setOutput} from './utils'
|
||||
|
||||
const getOutputKey = (key: string, outputPrefix: string): string => {
|
||||
return outputPrefix ? `${outputPrefix}_${key}` : key
|
||||
}
|
||||
|
||||
export const setChangedFilesOutput = async ({
|
||||
allDiffFiles,
|
||||
inputs,
|
||||
workingDirectory,
|
||||
diffResult,
|
||||
filePatterns = [],
|
||||
outputPrefix = ''
|
||||
}: {
|
||||
allDiffFiles: ChangedFiles
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
diffResult?: DiffResult
|
||||
filePatterns?: string[]
|
||||
outputPrefix?: string
|
||||
}): 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({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Added]
|
||||
})
|
||||
core.debug(`Added files: ${addedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('added_files', outputPrefix),
|
||||
value: addedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
await setOutput({
|
||||
key: getOutputKey('added_files_count', outputPrefix),
|
||||
value: addedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const copiedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Copied]
|
||||
})
|
||||
core.debug(`Copied files: ${copiedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('copied_files', outputPrefix),
|
||||
value: copiedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('copied_files_count', outputPrefix),
|
||||
value: copiedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const modifiedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Modified]
|
||||
})
|
||||
core.debug(`Modified files: ${modifiedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('modified_files', outputPrefix),
|
||||
value: modifiedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('modified_files_count', outputPrefix),
|
||||
value: modifiedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const renamedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Renamed]
|
||||
})
|
||||
core.debug(`Renamed files: ${renamedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('renamed_files', outputPrefix),
|
||||
value: renamedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('renamed_files_count', outputPrefix),
|
||||
value: renamedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const typeChangedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.TypeChanged]
|
||||
})
|
||||
core.debug(`Type changed files: ${typeChangedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('type_changed_files', outputPrefix),
|
||||
value: typeChangedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('type_changed_files_count', outputPrefix),
|
||||
value: typeChangedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const unmergedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Unmerged]
|
||||
})
|
||||
core.debug(`Unmerged files: ${unmergedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('unmerged_files', outputPrefix),
|
||||
value: unmergedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('unmerged_files_count', outputPrefix),
|
||||
value: unmergedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const unknownFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Unknown]
|
||||
})
|
||||
core.debug(`Unknown files: ${unknownFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('unknown_files', outputPrefix),
|
||||
value: unknownFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('unknown_files_count', outputPrefix),
|
||||
value: unknownFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allChangedAndModifiedFiles = await getAllChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles
|
||||
})
|
||||
core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('all_changed_and_modified_files', outputPrefix),
|
||||
value: allChangedAndModifiedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
|
||||
value: allChangedAndModifiedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allChangedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [
|
||||
ChangeTypeEnum.Added,
|
||||
ChangeTypeEnum.Copied,
|
||||
ChangeTypeEnum.Modified,
|
||||
ChangeTypeEnum.Renamed
|
||||
]
|
||||
})
|
||||
core.debug(`All changed files: ${allChangedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('all_changed_files', outputPrefix),
|
||||
value: allChangedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('all_changed_files_count', outputPrefix),
|
||||
value: allChangedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('any_changed', outputPrefix),
|
||||
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allOtherChangedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allDiffFiles,
|
||||
changeTypes: [
|
||||
ChangeTypeEnum.Added,
|
||||
ChangeTypeEnum.Copied,
|
||||
ChangeTypeEnum.Modified,
|
||||
ChangeTypeEnum.Renamed
|
||||
]
|
||||
})
|
||||
core.debug(`All other changed files: ${allOtherChangedFiles}`)
|
||||
|
||||
const otherChangedFiles = allOtherChangedFiles.paths
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
(filePath: string) =>
|
||||
!allChangedFiles.paths.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyChanged =
|
||||
otherChangedFiles.length === 0 &&
|
||||
allChangedFiles.paths.length > 0 &&
|
||||
filePatterns.length > 0
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('only_changed', outputPrefix),
|
||||
value: onlyChanged,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('other_changed_files', outputPrefix),
|
||||
value: otherChangedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('other_changed_files_count', outputPrefix),
|
||||
value: otherChangedFiles.length.toString(),
|
||||
inputs
|
||||
})
|
||||
|
||||
const allModifiedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [
|
||||
ChangeTypeEnum.Added,
|
||||
ChangeTypeEnum.Copied,
|
||||
ChangeTypeEnum.Modified,
|
||||
ChangeTypeEnum.Renamed,
|
||||
ChangeTypeEnum.Deleted
|
||||
]
|
||||
})
|
||||
core.debug(`All modified files: ${allModifiedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('all_modified_files', outputPrefix),
|
||||
value: allModifiedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('all_modified_files_count', outputPrefix),
|
||||
value: allModifiedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('any_modified', outputPrefix),
|
||||
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allOtherModifiedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allDiffFiles,
|
||||
changeTypes: [
|
||||
ChangeTypeEnum.Added,
|
||||
ChangeTypeEnum.Copied,
|
||||
ChangeTypeEnum.Modified,
|
||||
ChangeTypeEnum.Renamed,
|
||||
ChangeTypeEnum.Deleted
|
||||
]
|
||||
})
|
||||
|
||||
const otherModifiedFiles = allOtherModifiedFiles.paths
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
(filePath: string) =>
|
||||
!allModifiedFiles.paths.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyModified =
|
||||
otherModifiedFiles.length === 0 &&
|
||||
allModifiedFiles.paths.length > 0 &&
|
||||
filePatterns.length > 0
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('only_modified', outputPrefix),
|
||||
value: onlyModified,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('other_modified_files', outputPrefix),
|
||||
value: otherModifiedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('other_modified_files_count', outputPrefix),
|
||||
value: otherModifiedFiles.length.toString(),
|
||||
inputs
|
||||
})
|
||||
|
||||
const deletedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allFilteredDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Deleted]
|
||||
})
|
||||
core.debug(`Deleted files: ${deletedFiles}`)
|
||||
await setOutput({
|
||||
key: getOutputKey('deleted_files', outputPrefix),
|
||||
value: deletedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('deleted_files_count', outputPrefix),
|
||||
value: deletedFiles.count,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('any_deleted', outputPrefix),
|
||||
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allOtherDeletedFiles = await getChangeTypeFiles({
|
||||
inputs,
|
||||
changedFiles: allDiffFiles,
|
||||
changeTypes: [ChangeTypeEnum.Deleted]
|
||||
})
|
||||
|
||||
const otherDeletedFiles = allOtherDeletedFiles.paths
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyDeleted =
|
||||
otherDeletedFiles.length === 0 &&
|
||||
deletedFiles.paths.length > 0 &&
|
||||
filePatterns.length > 0
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('only_deleted', outputPrefix),
|
||||
value: onlyDeleted,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('other_deleted_files', outputPrefix),
|
||||
value: otherDeletedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('other_deleted_files_count', outputPrefix),
|
||||
value: otherDeletedFiles.length.toString(),
|
||||
inputs
|
||||
})
|
||||
}
|
||||
106
src/commitSha.ts
106
src/commitSha.ts
@@ -15,9 +15,11 @@ import {
|
||||
} from './utils'
|
||||
|
||||
const getCurrentSHA = async ({
|
||||
env,
|
||||
inputs,
|
||||
workingDirectory
|
||||
}: {
|
||||
env: Env
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
}): Promise<string> => {
|
||||
@@ -47,7 +49,18 @@ const getCurrentSHA = async ({
|
||||
}
|
||||
} else {
|
||||
if (!currentSha) {
|
||||
currentSha = await getHeadSha({cwd: workingDirectory})
|
||||
if (
|
||||
env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA &&
|
||||
(await verifyCommitSha({
|
||||
sha: env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA,
|
||||
cwd: workingDirectory,
|
||||
showAsErrorMessage: false
|
||||
})) === 0
|
||||
) {
|
||||
currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
|
||||
} else {
|
||||
currentSha = await getHeadSha({cwd: workingDirectory})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +85,7 @@ export const getSHAForPushEvent = async (
|
||||
workingDirectory: string,
|
||||
isShallow: boolean,
|
||||
hasSubmodule: boolean,
|
||||
gitExtraArgs: string[],
|
||||
gitFetchExtraArgs: string[],
|
||||
isTag: boolean
|
||||
): Promise<DiffResult> => {
|
||||
let targetBranch = env.GITHUB_REF_NAME
|
||||
@@ -89,7 +102,7 @@ export const getSHAForPushEvent = async (
|
||||
await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
@@ -101,7 +114,7 @@ export const getSHAForPushEvent = async (
|
||||
await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
@@ -115,7 +128,7 @@ export const getSHAForPushEvent = async (
|
||||
await gitFetchSubmodules({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`
|
||||
@@ -124,7 +137,7 @@ export const getSHAForPushEvent = async (
|
||||
}
|
||||
}
|
||||
|
||||
const currentSha = await getCurrentSHA({inputs, workingDirectory})
|
||||
const currentSha = await getCurrentSHA({env, inputs, workingDirectory})
|
||||
let previousSha = inputs.baseSha
|
||||
const diff = '..'
|
||||
|
||||
@@ -250,7 +263,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
workingDirectory: string,
|
||||
isShallow: boolean,
|
||||
hasSubmodule: boolean,
|
||||
gitExtraArgs: string[]
|
||||
gitFetchExtraArgs: string[]
|
||||
): Promise<DiffResult> => {
|
||||
let targetBranch = env.GITHUB_EVENT_PULL_REQUEST_BASE_REF
|
||||
const currentBranch = env.GITHUB_EVENT_PULL_REQUEST_HEAD_REF
|
||||
@@ -264,7 +277,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
let prFetchExitCode = await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
'origin',
|
||||
@@ -276,7 +289,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
prFetchExitCode = await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
@@ -297,7 +310,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
@@ -310,7 +323,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
await gitFetchSubmodules({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`
|
||||
@@ -321,7 +334,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
core.info('Completed fetching more history.')
|
||||
}
|
||||
|
||||
const currentSha = await getCurrentSHA({inputs, workingDirectory})
|
||||
const currentSha = await getCurrentSHA({env, inputs, workingDirectory})
|
||||
let previousSha = inputs.baseSha
|
||||
let diff = '...'
|
||||
|
||||
@@ -336,7 +349,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
throw new Error('Similar commit hashes detected.')
|
||||
}
|
||||
|
||||
await verifyCommitSha({sha: currentSha, cwd: workingDirectory})
|
||||
await verifyCommitSha({sha: previousSha, cwd: workingDirectory})
|
||||
core.debug(`Previous SHA: ${previousSha}`)
|
||||
|
||||
return {
|
||||
@@ -359,21 +372,25 @@ export const getSHAForPullRequestEvent = async (
|
||||
if (inputs.sinceLastRemoteCommit) {
|
||||
previousSha = env.GITHUB_EVENT_BEFORE
|
||||
|
||||
if (!previousSha) {
|
||||
previousSha = await getRemoteBranchHeadSha({
|
||||
cwd: workingDirectory,
|
||||
branch: currentBranch
|
||||
})
|
||||
}
|
||||
|
||||
if (
|
||||
(await verifyCommitSha({
|
||||
sha: previousSha,
|
||||
cwd: workingDirectory,
|
||||
showAsErrorMessage: false
|
||||
})) !== 0
|
||||
!previousSha ||
|
||||
(previousSha &&
|
||||
(await verifyCommitSha({sha: previousSha, cwd: workingDirectory})) !==
|
||||
0)
|
||||
) {
|
||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||
core.warning(
|
||||
'Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.'
|
||||
)
|
||||
previousSha = await getParentSha({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
|
||||
if (!previousSha) {
|
||||
core.warning(
|
||||
'Unable to locate the previous commit in the local history. Falling back to the pull request base sha.'
|
||||
)
|
||||
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||
}
|
||||
}
|
||||
} else {
|
||||
previousSha = await getRemoteBranchHeadSha({
|
||||
@@ -387,14 +404,14 @@ export const getSHAForPullRequestEvent = async (
|
||||
|
||||
if (isShallow) {
|
||||
if (
|
||||
await canDiffCommits({
|
||||
!(await canDiffCommits({
|
||||
cwd: workingDirectory,
|
||||
sha1: previousSha,
|
||||
sha2: currentSha,
|
||||
diff
|
||||
})
|
||||
}))
|
||||
) {
|
||||
core.debug(
|
||||
core.info(
|
||||
'Merge base is not in the local history, fetching remote target branch...'
|
||||
)
|
||||
|
||||
@@ -402,7 +419,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
...gitExtraArgs,
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
@@ -422,10 +439,10 @@ export const getSHAForPullRequestEvent = async (
|
||||
break
|
||||
}
|
||||
|
||||
core.debug(
|
||||
core.info(
|
||||
'Merge base is not in the local history, fetching remote target branch again...'
|
||||
)
|
||||
core.debug(`Attempt ${i}/10`)
|
||||
core.info(`Attempt ${i}/10`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -467,9 +484,28 @@ export const getSHAForPullRequestEvent = async (
|
||||
core.error(
|
||||
`Similar commit hashes detected: previous sha: ${previousSha} is equivalent to the current sha: ${currentSha}.`
|
||||
)
|
||||
core.error(
|
||||
`Please verify that both commits are valid, and increase the fetch_depth to a number higher than ${inputs.fetchDepth}.`
|
||||
)
|
||||
// This occurs if a PR is created from a forked repository and the event is pull_request_target.
|
||||
// - name: Checkout to branch
|
||||
// uses: actions/checkout@v3
|
||||
// Without setting the repository to use the same repository as the pull request will cause the previousSha
|
||||
// to be the same as the currentSha since the currentSha cannot be found in the local history.
|
||||
// The solution is to use:
|
||||
// - name: Checkout to branch
|
||||
// uses: actions/checkout@v3
|
||||
// with:
|
||||
// repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
if (env.GITHUB_EVENT_NAME === 'pull_request_target') {
|
||||
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.'
|
||||
)
|
||||
core.warning(
|
||||
'This can be done by setting actions/checkout `repository` to ${{ github.event.pull_request.head.repo.full_name }}'
|
||||
)
|
||||
} else {
|
||||
core.error(
|
||||
`Please verify that both commits are valid, and increase the fetch_depth to a number higher than ${inputs.fetchDepth}.`
|
||||
)
|
||||
}
|
||||
throw new Error('Similar commit hashes detected.')
|
||||
}
|
||||
|
||||
|
||||
32
src/env.ts
32
src/env.ts
@@ -2,25 +2,32 @@ import {promises as fs} from 'fs'
|
||||
import * as core from '@actions/core'
|
||||
|
||||
export type Env = {
|
||||
GITHUB_EVENT_PULL_REQUEST_HEAD_REF: string
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_REF: string
|
||||
GITHUB_EVENT_BEFORE: string
|
||||
GITHUB_REF_NAME: string
|
||||
GITHUB_REF: 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_WORKSPACE: string
|
||||
GITHUB_EVENT_FORCED: 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
|
||||
@@ -33,8 +40,10 @@ type GithubEvent = {
|
||||
}
|
||||
before?: string
|
||||
base_ref?: string
|
||||
head_repo?: {
|
||||
fork: string
|
||||
head?: {
|
||||
repo?: {
|
||||
fork: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,12 +64,17 @@ export const getEnv = async (): Promise<Env> => {
|
||||
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_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: 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 || ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,16 @@ export type Inputs = {
|
||||
filesSeparator: string
|
||||
filesFromSourceFile: string
|
||||
filesFromSourceFileSeparator: string
|
||||
filesYaml: string
|
||||
filesYamlFromSourceFile: string
|
||||
filesYamlFromSourceFileSeparator: string
|
||||
filesIgnore: string
|
||||
filesIgnoreSeparator: string
|
||||
filesIgnoreFromSourceFile: string
|
||||
filesIgnoreFromSourceFileSeparator: string
|
||||
filesIgnoreYaml: string
|
||||
filesIgnoreYamlFromSourceFile: string
|
||||
filesIgnoreYamlFromSourceFileSeparator: string
|
||||
separator: string
|
||||
includeAllOldNewRenamedFiles: boolean
|
||||
oldNewSeparator: string
|
||||
@@ -22,13 +28,18 @@ export type Inputs = {
|
||||
diffRelative: boolean
|
||||
dirNames: boolean
|
||||
dirNamesMaxDepth?: number
|
||||
dirNamesExcludeRoot: boolean
|
||||
dirNamesExcludeCurrentDir: boolean
|
||||
json: boolean
|
||||
escapeJson: boolean
|
||||
fetchDepth?: number
|
||||
sinceLastRemoteCommit: boolean
|
||||
writeOutputFiles: boolean
|
||||
outputDir: string
|
||||
outputRenamedFilesAsDeletedAndAdded: boolean
|
||||
recoverDeletedFiles: boolean
|
||||
recoverDeletedFilesToDestination: string
|
||||
token: string
|
||||
apiUrl: string
|
||||
}
|
||||
|
||||
export const getInputs = (): Inputs => {
|
||||
@@ -52,6 +63,17 @@ export const getInputs = (): Inputs => {
|
||||
trimWhitespace: false
|
||||
}
|
||||
)
|
||||
const filesYaml = core.getInput('files_yaml', {required: false})
|
||||
const filesYamlFromSourceFile = core.getInput('files_yaml_from_source_file', {
|
||||
required: false
|
||||
})
|
||||
const filesYamlFromSourceFileSeparator = core.getInput(
|
||||
'files_yaml_from_source_file_separator',
|
||||
{
|
||||
required: false,
|
||||
trimWhitespace: false
|
||||
}
|
||||
)
|
||||
const filesIgnoreFromSourceFile = core.getInput(
|
||||
'files_ignore_from_source_file',
|
||||
{required: false}
|
||||
@@ -63,6 +85,18 @@ export const getInputs = (): Inputs => {
|
||||
trimWhitespace: false
|
||||
}
|
||||
)
|
||||
const filesIgnoreYaml = core.getInput('files_ignore_yaml', {required: false})
|
||||
const filesIgnoreYamlFromSourceFile = core.getInput(
|
||||
'files_ignore_yaml_from_source_file',
|
||||
{required: false}
|
||||
)
|
||||
const filesIgnoreYamlFromSourceFileSeparator = core.getInput(
|
||||
'files_ignore_yaml_from_source_file_separator',
|
||||
{
|
||||
required: false,
|
||||
trimWhitespace: false
|
||||
}
|
||||
)
|
||||
const separator = core.getInput('separator', {
|
||||
required: true,
|
||||
trimWhitespace: false
|
||||
@@ -90,9 +124,12 @@ export const getInputs = (): Inputs => {
|
||||
const dirNamesMaxDepth = core.getInput('dir_names_max_depth', {
|
||||
required: false
|
||||
})
|
||||
const dirNamesExcludeRoot = core.getBooleanInput('dir_names_exclude_root', {
|
||||
required: false
|
||||
})
|
||||
const dirNamesExcludeCurrentDir = core.getBooleanInput(
|
||||
'dir_names_exclude_current_dir',
|
||||
{
|
||||
required: false
|
||||
}
|
||||
)
|
||||
const json = core.getBooleanInput('json', {required: false})
|
||||
const escapeJson = core.getBooleanInput('escape_json', {required: false})
|
||||
const fetchDepth = core.getInput('fetch_depth', {required: false})
|
||||
@@ -104,20 +141,37 @@ export const getInputs = (): Inputs => {
|
||||
required: false
|
||||
})
|
||||
const outputDir = core.getInput('output_dir', {required: false})
|
||||
const outputRenamedFilesAsDeletedAndAdded = core.getBooleanInput(
|
||||
'output_renamed_files_as_deleted_and_added',
|
||||
{required: false}
|
||||
)
|
||||
const recoverDeletedFiles = core.getBooleanInput('recover_deleted_files', {
|
||||
required: false
|
||||
})
|
||||
const recoverDeletedFilesToDestination = core.getInput(
|
||||
'recover_deleted_files_to_destination',
|
||||
{required: false}
|
||||
)
|
||||
const token = core.getInput('token', {required: false})
|
||||
const apiUrl = core.getInput('api_url', {required: false})
|
||||
|
||||
const inputs: Inputs = {
|
||||
files,
|
||||
filesSeparator,
|
||||
filesFromSourceFile,
|
||||
filesFromSourceFileSeparator,
|
||||
filesYaml,
|
||||
filesYamlFromSourceFile,
|
||||
filesYamlFromSourceFileSeparator,
|
||||
filesIgnore,
|
||||
filesIgnoreSeparator,
|
||||
filesIgnoreFromSourceFile,
|
||||
filesIgnoreFromSourceFileSeparator,
|
||||
filesIgnoreYaml,
|
||||
filesIgnoreYamlFromSourceFile,
|
||||
filesIgnoreYamlFromSourceFileSeparator,
|
||||
separator,
|
||||
includeAllOldNewRenamedFiles,
|
||||
oldNewSeparator,
|
||||
oldNewFilesSeparator,
|
||||
// Not Supported via REST API
|
||||
sha,
|
||||
baseSha,
|
||||
since,
|
||||
@@ -125,13 +179,22 @@ export const getInputs = (): Inputs => {
|
||||
path,
|
||||
quotePath,
|
||||
diffRelative,
|
||||
sinceLastRemoteCommit,
|
||||
recoverDeletedFiles,
|
||||
recoverDeletedFilesToDestination,
|
||||
includeAllOldNewRenamedFiles,
|
||||
oldNewSeparator,
|
||||
oldNewFilesSeparator,
|
||||
// End Not Supported via REST API
|
||||
dirNames,
|
||||
dirNamesExcludeRoot,
|
||||
dirNamesExcludeCurrentDir,
|
||||
json,
|
||||
escapeJson,
|
||||
sinceLastRemoteCommit,
|
||||
writeOutputFiles,
|
||||
outputDir
|
||||
outputDir,
|
||||
outputRenamedFilesAsDeletedAndAdded,
|
||||
token,
|
||||
apiUrl
|
||||
}
|
||||
|
||||
if (fetchDepth) {
|
||||
|
||||
515
src/main.ts
515
src/main.ts
@@ -1,16 +1,23 @@
|
||||
import * as core from '@actions/core'
|
||||
import path from 'path'
|
||||
import {getDiffFiles, getRenamedFiles} from './changedFiles'
|
||||
import {
|
||||
getAllDiffFiles,
|
||||
getChangedFilesFromGithubAPI,
|
||||
getRenamedFiles
|
||||
} from './changedFiles'
|
||||
import {setChangedFilesOutput} from './changedFilesOutput'
|
||||
import {
|
||||
DiffResult,
|
||||
getSHAForPullRequestEvent,
|
||||
getSHAForPushEvent,
|
||||
DiffResult
|
||||
getSHAForPushEvent
|
||||
} from './commitSha'
|
||||
import {getEnv} from './env'
|
||||
import {getInputs} from './inputs'
|
||||
import {Env, getEnv} from './env'
|
||||
import {getInputs, Inputs} from './inputs'
|
||||
import {
|
||||
getFilePatterns,
|
||||
getSubmodulePath,
|
||||
getYamlFilePatterns,
|
||||
hasLocalGitDirectory,
|
||||
isRepoShallow,
|
||||
setOutput,
|
||||
submoduleExists,
|
||||
@@ -18,14 +25,15 @@ import {
|
||||
verifyMinimumGitVersion
|
||||
} from './utils'
|
||||
|
||||
export async function run(): Promise<void> {
|
||||
core.startGroup('changed-files')
|
||||
|
||||
const env = await getEnv()
|
||||
core.debug(`Env: ${JSON.stringify(env, null, 2)}`)
|
||||
const inputs = getInputs()
|
||||
core.debug(`Inputs: ${JSON.stringify(inputs, null, 2)}`)
|
||||
|
||||
const getChangedFilesFromLocalGit = async ({
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory
|
||||
}: {
|
||||
inputs: Inputs
|
||||
env: Env
|
||||
workingDirectory: string
|
||||
}): Promise<void> => {
|
||||
await verifyMinimumGitVersion()
|
||||
|
||||
let quotePathValue = 'on'
|
||||
@@ -46,14 +54,12 @@ export async function run(): Promise<void> {
|
||||
})
|
||||
}
|
||||
|
||||
const workingDirectory = path.resolve(
|
||||
env.GITHUB_WORKSPACE || process.cwd(),
|
||||
inputs.path
|
||||
)
|
||||
const isShallow = await isRepoShallow({cwd: workingDirectory})
|
||||
const hasSubmodule = await submoduleExists({cwd: workingDirectory})
|
||||
let gitExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
|
||||
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
|
||||
const isTag = env.GITHUB_REF?.startsWith('refs/tags/')
|
||||
const outputRenamedFilesAsDeletedAndAdded =
|
||||
inputs.outputRenamedFilesAsDeletedAndAdded
|
||||
let submodulePaths: string[] = []
|
||||
|
||||
if (hasSubmodule) {
|
||||
@@ -61,31 +67,35 @@ export async function run(): Promise<void> {
|
||||
}
|
||||
|
||||
if (isTag) {
|
||||
gitExtraArgs = ['--prune', '--no-recurse-submodules']
|
||||
gitFetchExtraArgs = ['--prune', '--no-recurse-submodules']
|
||||
}
|
||||
|
||||
let diffResult: DiffResult
|
||||
|
||||
if (!env.GITHUB_EVENT_PULL_REQUEST_BASE_REF) {
|
||||
core.info('Running on a push event...')
|
||||
core.info(`Running on a ${env.GITHUB_EVENT_NAME || 'push'} event...`)
|
||||
diffResult = await getSHAForPushEvent(
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitExtraArgs,
|
||||
gitFetchExtraArgs,
|
||||
isTag
|
||||
)
|
||||
} else {
|
||||
core.info('Running on a pull request event...')
|
||||
core.info(
|
||||
`Running on a ${env.GITHUB_EVENT_NAME || 'pull_request'} (${
|
||||
env.GITHUB_EVENT_ACTION
|
||||
}) event...`
|
||||
)
|
||||
diffResult = await getSHAForPullRequestEvent(
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitExtraArgs
|
||||
gitFetchExtraArgs
|
||||
)
|
||||
}
|
||||
|
||||
@@ -99,296 +109,72 @@ export async function run(): Promise<void> {
|
||||
`Retrieving changes between ${diffResult.previousSha} (${diffResult.targetBranch}) → ${diffResult.currentSha} (${diffResult.currentBranch})`
|
||||
)
|
||||
|
||||
const allDiffFiles = await getAllDiffFiles({
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
submodulePaths,
|
||||
outputRenamedFilesAsDeletedAndAdded
|
||||
})
|
||||
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`)
|
||||
core.info('All Done!')
|
||||
core.endGroup()
|
||||
|
||||
const filePatterns = await getFilePatterns({
|
||||
inputs,
|
||||
workingDirectory
|
||||
})
|
||||
core.debug(`File patterns: ${filePatterns}`)
|
||||
|
||||
const addedFiles = await getDiffFiles({
|
||||
if (filePatterns.length > 0) {
|
||||
core.startGroup('changed-files-patterns')
|
||||
await setChangedFilesOutput({
|
||||
allDiffFiles,
|
||||
filePatterns,
|
||||
inputs,
|
||||
workingDirectory,
|
||||
diffResult
|
||||
})
|
||||
core.info('All Done!')
|
||||
core.endGroup()
|
||||
}
|
||||
|
||||
const yamlFilePatterns = await getYamlFilePatterns({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'A',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Added files: ${addedFiles}`)
|
||||
await setOutput({
|
||||
key: 'added_files',
|
||||
value: addedFiles,
|
||||
inputs
|
||||
workingDirectory
|
||||
})
|
||||
core.debug(`Yaml file patterns: ${JSON.stringify(yamlFilePatterns)}`)
|
||||
|
||||
const copiedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'C',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Copied files: ${copiedFiles}`)
|
||||
await setOutput({
|
||||
key: 'copied_files',
|
||||
value: copiedFiles,
|
||||
inputs
|
||||
})
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
const modifiedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'M',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Modified files: ${modifiedFiles}`)
|
||||
await setOutput({
|
||||
key: 'modified_files',
|
||||
value: modifiedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
const renamedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'R',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Renamed files: ${renamedFiles}`)
|
||||
await setOutput({
|
||||
key: 'renamed_files',
|
||||
value: renamedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
const typeChangedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'T',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Type changed files: ${typeChangedFiles}`)
|
||||
await setOutput({
|
||||
key: 'type_changed_files',
|
||||
value: typeChangedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
const unmergedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'U',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Unmerged files: ${unmergedFiles}`)
|
||||
await setOutput({
|
||||
key: 'unmerged_files',
|
||||
value: unmergedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
const unknownFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'X',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Unknown files: ${unknownFiles}`)
|
||||
await setOutput({
|
||||
key: 'unknown_files',
|
||||
value: unknownFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allChangedAndModifiedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'ACDMRTUX',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`)
|
||||
await setOutput({
|
||||
key: 'all_changed_and_modified_files',
|
||||
value: allChangedAndModifiedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allChangedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'ACMR',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`All changed files: ${allChangedFiles}`)
|
||||
await setOutput({
|
||||
key: 'all_changed_files',
|
||||
value: allChangedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: 'any_changed',
|
||||
value: allChangedFiles.length > 0 && filePatterns.length > 0,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allOtherChangedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'ACMR',
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`All other changed files: ${allOtherChangedFiles}`)
|
||||
|
||||
const otherChangedFiles = allOtherChangedFiles
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
filePath => !allChangedFiles.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyChanged =
|
||||
otherChangedFiles.length === 0 && allChangedFiles.length > 0
|
||||
|
||||
await setOutput({
|
||||
key: 'only_changed',
|
||||
value: onlyChanged,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: 'other_changed_files',
|
||||
value: otherChangedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
const allModifiedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'ACMRD',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`All modified files: ${allModifiedFiles}`)
|
||||
await setOutput({
|
||||
key: 'all_modified_files',
|
||||
value: allModifiedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: 'any_modified',
|
||||
value: allModifiedFiles.length > 0 && filePatterns.length > 0,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allOtherModifiedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'ACMRD',
|
||||
submodulePaths
|
||||
})
|
||||
|
||||
const otherModifiedFiles = allOtherModifiedFiles
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
filePath => !allModifiedFiles.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyModified =
|
||||
otherModifiedFiles.length === 0 && allModifiedFiles.length > 0
|
||||
|
||||
await setOutput({
|
||||
key: 'only_modified',
|
||||
value: onlyModified,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: 'other_modified_files',
|
||||
value: otherModifiedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
|
||||
const deletedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'D',
|
||||
filePatterns,
|
||||
submodulePaths
|
||||
})
|
||||
core.debug(`Deleted files: ${deletedFiles}`)
|
||||
await setOutput({
|
||||
key: 'deleted_files',
|
||||
value: deletedFiles,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: 'any_deleted',
|
||||
value: deletedFiles.length > 0 && filePatterns.length > 0,
|
||||
inputs
|
||||
})
|
||||
|
||||
const allOtherDeletedFiles = await getDiffFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
hasSubmodule,
|
||||
diffResult,
|
||||
diffFilter: 'D',
|
||||
submodulePaths
|
||||
})
|
||||
|
||||
const otherDeletedFiles = allOtherDeletedFiles
|
||||
.split(inputs.separator)
|
||||
.filter(
|
||||
filePath => !deletedFiles.split(inputs.separator).includes(filePath)
|
||||
)
|
||||
|
||||
const onlyDeleted = otherDeletedFiles.length === 0 && deletedFiles.length > 0
|
||||
|
||||
await setOutput({
|
||||
key: 'only_deleted',
|
||||
value: onlyDeleted,
|
||||
inputs
|
||||
})
|
||||
|
||||
await setOutput({
|
||||
key: 'other_deleted_files',
|
||||
value: otherDeletedFiles.join(inputs.separator),
|
||||
inputs
|
||||
})
|
||||
if (filePatterns.length === 0 && Object.keys(yamlFilePatterns).length === 0) {
|
||||
core.startGroup('changed-files-all')
|
||||
await setChangedFilesOutput({
|
||||
allDiffFiles,
|
||||
inputs,
|
||||
workingDirectory,
|
||||
diffResult
|
||||
})
|
||||
core.info('All Done!')
|
||||
core.endGroup()
|
||||
}
|
||||
|
||||
if (inputs.includeAllOldNewRenamedFiles) {
|
||||
core.startGroup('changed-files-all-old-new-renamed-files')
|
||||
const allOldNewRenamedFiles = await getRenamedFiles({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
@@ -399,14 +185,135 @@ export async function run(): Promise<void> {
|
||||
core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`)
|
||||
await setOutput({
|
||||
key: 'all_old_new_renamed_files',
|
||||
value: allOldNewRenamedFiles,
|
||||
value: allOldNewRenamedFiles.paths,
|
||||
inputs
|
||||
})
|
||||
await setOutput({
|
||||
key: 'all_old_new_renamed_files_count',
|
||||
value: allOldNewRenamedFiles.count,
|
||||
inputs
|
||||
})
|
||||
core.info('All Done!')
|
||||
core.endGroup()
|
||||
}
|
||||
}
|
||||
|
||||
const getChangedFilesFromRESTAPI = async ({
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory
|
||||
}: {
|
||||
inputs: Inputs
|
||||
env: Env
|
||||
workingDirectory: string
|
||||
}): Promise<void> => {
|
||||
const allDiffFiles = await getChangedFilesFromGithubAPI({
|
||||
inputs,
|
||||
env
|
||||
})
|
||||
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`)
|
||||
core.info('All Done!')
|
||||
|
||||
core.endGroup()
|
||||
const filePatterns = await getFilePatterns({
|
||||
inputs,
|
||||
workingDirectory
|
||||
})
|
||||
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> {
|
||||
core.startGroup('changed-files')
|
||||
|
||||
const env = await getEnv()
|
||||
core.debug(`Env: ${JSON.stringify(env, null, 2)}`)
|
||||
const inputs = getInputs()
|
||||
core.debug(`Inputs: ${JSON.stringify(inputs, null, 2)}`)
|
||||
const workingDirectory = path.resolve(
|
||||
env.GITHUB_WORKSPACE || process.cwd(),
|
||||
inputs.path
|
||||
)
|
||||
const hasGitDirectory = await hasLocalGitDirectory({workingDirectory})
|
||||
|
||||
if (
|
||||
inputs.token &&
|
||||
env.GITHUB_EVENT_PULL_REQUEST_NUMBER &&
|
||||
!hasGitDirectory
|
||||
) {
|
||||
core.info("Using GitHub's REST API to get changed files")
|
||||
const unsupportedInputs: (keyof Inputs)[] = [
|
||||
'sha',
|
||||
'baseSha',
|
||||
'since',
|
||||
'until',
|
||||
'sinceLastRemoteCommit',
|
||||
'recoverDeletedFiles',
|
||||
'recoverDeletedFilesToDestination',
|
||||
'includeAllOldNewRenamedFiles'
|
||||
]
|
||||
|
||||
for (const input of unsupportedInputs) {
|
||||
if (inputs[input]) {
|
||||
core.warning(
|
||||
`Input "${input}" is not supported when using GitHub's REST API to get changed files`
|
||||
)
|
||||
}
|
||||
}
|
||||
await getChangedFilesFromRESTAPI({inputs, env, workingDirectory})
|
||||
} else {
|
||||
if (!hasGitDirectory) {
|
||||
core.setFailed(
|
||||
"Can't find local .git directory. Please run actions/checkout before this action"
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
core.info('Using local .git directory')
|
||||
await getChangedFilesFromLocalGit({inputs, env, workingDirectory})
|
||||
}
|
||||
}
|
||||
|
||||
/* istanbul ignore if */
|
||||
|
||||
440
src/utils.ts
440
src/utils.ts
@@ -2,9 +2,13 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as exec from '@actions/exec'
|
||||
import {createReadStream, promises as fs} from 'fs'
|
||||
import {readFile} from 'fs/promises'
|
||||
import {flattenDeep} from 'lodash'
|
||||
import mm from 'micromatch'
|
||||
import * as path from 'path'
|
||||
import {createInterface} from 'readline'
|
||||
import {parseDocument} from 'yaml'
|
||||
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
|
||||
|
||||
import {Inputs} from './inputs'
|
||||
|
||||
@@ -93,7 +97,7 @@ export const verifyMinimumGitVersion = async (): Promise<void> => {
|
||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||
'git',
|
||||
['--version'],
|
||||
{silent: process.env.RUNNER_DEBUG !== '1'}
|
||||
{silent: !core.isDebug()}
|
||||
)
|
||||
|
||||
if (exitCode !== 0) {
|
||||
@@ -156,7 +160,7 @@ const getFilesFromSourceFile = async ({
|
||||
filePaths: string[]
|
||||
excludedFiles?: boolean
|
||||
}): Promise<string[]> => {
|
||||
const lines = []
|
||||
const lines: string[] = []
|
||||
for (const filePath of filePaths) {
|
||||
for await (const line of lineOfFileGenerator({filePath, excludedFiles})) {
|
||||
lines.push(line)
|
||||
@@ -177,7 +181,7 @@ export const updateGitGlobalConfig = async ({
|
||||
['config', '--global', name, value],
|
||||
{
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -193,7 +197,7 @@ export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
|
||||
['rev-parse', '--is-shallow-repository'],
|
||||
{
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -205,17 +209,18 @@ export const submoduleExists = async ({
|
||||
}: {
|
||||
cwd: string
|
||||
}): Promise<boolean> => {
|
||||
const {stdout, exitCode} = await exec.getExecOutput(
|
||||
const {stdout, exitCode, stderr} = await exec.getExecOutput(
|
||||
'git',
|
||||
['submodule', 'status'],
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
if (exitCode !== 0) {
|
||||
core.warning(stderr || "Couldn't list submodules")
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -232,7 +237,7 @@ export const gitFetch = async ({
|
||||
const {exitCode} = await exec.getExecOutput('git', ['fetch', '-q', ...args], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
})
|
||||
|
||||
return exitCode
|
||||
@@ -251,7 +256,7 @@ export const gitFetchSubmodules = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -276,7 +281,7 @@ export const getSubmodulePath = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -288,7 +293,7 @@ export const getSubmodulePath = async ({
|
||||
return stdout
|
||||
.trim()
|
||||
.split('\n')
|
||||
.map(line => normalizePath(line.split(' ')[1]))
|
||||
.map((line: string) => normalizePath(line.trim().split(' ')[1]))
|
||||
}
|
||||
|
||||
export const gitSubmoduleDiffSHA = async ({
|
||||
@@ -309,7 +314,7 @@ export const gitSubmoduleDiffSHA = async ({
|
||||
['diff', parentSha1, parentSha2, '--', submodulePath],
|
||||
{
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -362,7 +367,7 @@ export const gitRenamedFiles = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -389,7 +394,7 @@ export const gitRenamedFiles = async ({
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(Boolean)
|
||||
.map(line => {
|
||||
.map((line: string) => {
|
||||
core.debug(`Renamed file: ${line}`)
|
||||
const [, oldPath, newPath] = line.split('\t')
|
||||
if (isSubmodule) {
|
||||
@@ -403,40 +408,48 @@ export const gitRenamedFiles = async ({
|
||||
})
|
||||
}
|
||||
|
||||
export const gitDiff = async ({
|
||||
export const getAllChangedFiles = async ({
|
||||
cwd,
|
||||
sha1,
|
||||
sha2,
|
||||
diff,
|
||||
diffFilter,
|
||||
filePatterns = [],
|
||||
isSubmodule = false,
|
||||
parentDir = ''
|
||||
parentDir = '',
|
||||
outputRenamedFilesAsDeletedAndAdded = false
|
||||
}: {
|
||||
cwd: string
|
||||
sha1: string
|
||||
sha2: string
|
||||
diffFilter: string
|
||||
diff: string
|
||||
filePatterns?: string[]
|
||||
isSubmodule?: boolean
|
||||
parentDir?: string
|
||||
}): Promise<string[]> => {
|
||||
outputRenamedFilesAsDeletedAndAdded?: boolean
|
||||
}): Promise<ChangedFiles> => {
|
||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||
'git',
|
||||
[
|
||||
'diff',
|
||||
'--name-only',
|
||||
'--name-status',
|
||||
'--ignore-submodules=all',
|
||||
`--diff-filter=${diffFilter}`,
|
||||
`--diff-filter=ACDMRTUX`,
|
||||
`${sha1}${diff}${sha2}`
|
||||
],
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
const changedFiles: ChangedFiles = {
|
||||
[ChangeTypeEnum.Added]: [],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
[ChangeTypeEnum.Modified]: [],
|
||||
[ChangeTypeEnum.Renamed]: [],
|
||||
[ChangeTypeEnum.TypeChanged]: [],
|
||||
[ChangeTypeEnum.Unmerged]: [],
|
||||
[ChangeTypeEnum.Unknown]: []
|
||||
}
|
||||
|
||||
if (exitCode !== 0) {
|
||||
if (isSubmodule) {
|
||||
@@ -453,28 +466,67 @@ export const gitDiff = async ({
|
||||
)
|
||||
}
|
||||
|
||||
return []
|
||||
return changedFiles
|
||||
}
|
||||
|
||||
const files = stdout
|
||||
.split('\n')
|
||||
.filter(Boolean)
|
||||
.map(p => {
|
||||
if (isSubmodule) {
|
||||
return normalizePath(path.join(parentDir, p))
|
||||
const lines = stdout.split('\n').filter(Boolean)
|
||||
|
||||
for (const line of lines) {
|
||||
const [changeType, filePath, newPath = ''] = line.split('\t')
|
||||
const normalizedFilePath = isSubmodule
|
||||
? normalizePath(path.join(parentDir, filePath))
|
||||
: normalizePath(filePath)
|
||||
const normalizedNewPath = isSubmodule
|
||||
? normalizePath(path.join(parentDir, newPath))
|
||||
: normalizePath(newPath)
|
||||
|
||||
if (changeType.startsWith('R')) {
|
||||
if (outputRenamedFilesAsDeletedAndAdded) {
|
||||
changedFiles[ChangeTypeEnum.Deleted].push(normalizedFilePath)
|
||||
changedFiles[ChangeTypeEnum.Added].push(normalizedNewPath)
|
||||
} else {
|
||||
changedFiles[ChangeTypeEnum.Renamed].push(normalizedNewPath)
|
||||
}
|
||||
return normalizePath(p)
|
||||
})
|
||||
} else {
|
||||
changedFiles[changeType as ChangeTypeEnum].push(normalizedFilePath)
|
||||
}
|
||||
}
|
||||
return changedFiles
|
||||
}
|
||||
|
||||
if (filePatterns.length === 0) {
|
||||
return files
|
||||
export const getFilteredChangedFiles = async ({
|
||||
allDiffFiles,
|
||||
filePatterns
|
||||
}: {
|
||||
allDiffFiles: ChangedFiles
|
||||
filePatterns: string[]
|
||||
}): Promise<ChangedFiles> => {
|
||||
const changedFiles: ChangedFiles = {
|
||||
[ChangeTypeEnum.Added]: [],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
[ChangeTypeEnum.Modified]: [],
|
||||
[ChangeTypeEnum.Renamed]: [],
|
||||
[ChangeTypeEnum.TypeChanged]: [],
|
||||
[ChangeTypeEnum.Unmerged]: [],
|
||||
[ChangeTypeEnum.Unknown]: []
|
||||
}
|
||||
const hasFilePatterns = filePatterns.length > 0
|
||||
|
||||
for (const changeType of Object.keys(allDiffFiles)) {
|
||||
const files = allDiffFiles[changeType as ChangeTypeEnum]
|
||||
if (hasFilePatterns) {
|
||||
changedFiles[changeType as ChangeTypeEnum] = mm(files, filePatterns, {
|
||||
dot: true,
|
||||
windows: IS_WINDOWS,
|
||||
noext: true
|
||||
})
|
||||
} else {
|
||||
changedFiles[changeType as ChangeTypeEnum] = files
|
||||
}
|
||||
}
|
||||
|
||||
return mm(files, filePatterns, {
|
||||
dot: true,
|
||||
windows: IS_WINDOWS,
|
||||
noext: true
|
||||
})
|
||||
return changedFiles
|
||||
}
|
||||
|
||||
export const gitLog = async ({
|
||||
@@ -486,7 +538,7 @@ export const gitLog = async ({
|
||||
}): Promise<string> => {
|
||||
const {stdout} = await exec.getExecOutput('git', ['log', ...args], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
})
|
||||
|
||||
return stdout.trim()
|
||||
@@ -495,12 +547,30 @@ export const gitLog = async ({
|
||||
export const getHeadSha = async ({cwd}: {cwd: string}): Promise<string> => {
|
||||
const {stdout} = await exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
})
|
||||
|
||||
return stdout.trim()
|
||||
}
|
||||
|
||||
export const isInsideWorkTree = async ({
|
||||
cwd
|
||||
}: {
|
||||
cwd: string
|
||||
}): Promise<boolean> => {
|
||||
const {stdout} = await exec.getExecOutput(
|
||||
'git',
|
||||
['rev-parse', '--is-inside-work-tree'],
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
return stdout.trim() === 'true'
|
||||
}
|
||||
|
||||
export const getRemoteBranchHeadSha = async ({
|
||||
cwd,
|
||||
branch
|
||||
@@ -513,7 +583,7 @@ export const getRemoteBranchHeadSha = async ({
|
||||
['rev-parse', `origin/${branch}`],
|
||||
{
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -527,7 +597,7 @@ export const getParentSha = async ({cwd}: {cwd: string}): Promise<string> => {
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -553,7 +623,7 @@ export const verifyCommitSha = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -583,7 +653,7 @@ export const getPreviousGitTag = async ({
|
||||
['tag', '--sort=-version:refname'],
|
||||
{
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -601,7 +671,7 @@ export const getPreviousGitTag = async ({
|
||||
['rev-parse', previousTag],
|
||||
{
|
||||
cwd,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -627,7 +697,7 @@ export const canDiffCommits = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.RUNNER_DEBUG !== '1'
|
||||
silent: !core.isDebug()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -642,11 +712,11 @@ export const canDiffCommits = async ({
|
||||
export const getDirnameMaxDepth = ({
|
||||
pathStr,
|
||||
dirNamesMaxDepth,
|
||||
excludeRoot
|
||||
excludeCurrentDir
|
||||
}: {
|
||||
pathStr: string
|
||||
dirNamesMaxDepth?: number
|
||||
excludeRoot?: boolean
|
||||
excludeCurrentDir?: boolean
|
||||
}): string => {
|
||||
const pathArr = dirname(pathStr).split(path.sep)
|
||||
const maxDepth = Math.min(dirNamesMaxDepth || pathArr.length, pathArr.length)
|
||||
@@ -656,7 +726,7 @@ export const getDirnameMaxDepth = ({
|
||||
output = path.join(output, pathArr[i])
|
||||
}
|
||||
|
||||
if (excludeRoot && output === '.') {
|
||||
if (excludeCurrentDir && output === '.') {
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -760,10 +830,10 @@ export const getFilePatterns = async ({
|
||||
if (pattern.endsWith('/')) {
|
||||
return `${pattern}**`
|
||||
} else {
|
||||
const pathParts = pattern.split('/')
|
||||
const pathParts = pattern.split(path.sep)
|
||||
const lastPart = pathParts[pathParts.length - 1]
|
||||
if (!lastPart.includes('.')) {
|
||||
return `${pattern}/**`
|
||||
return `${pattern}${path.sep}**`
|
||||
} else {
|
||||
return pattern
|
||||
}
|
||||
@@ -771,6 +841,193 @@ export const getFilePatterns = async ({
|
||||
})
|
||||
}
|
||||
|
||||
// Example YAML input:
|
||||
// filesYaml: |
|
||||
// frontend:
|
||||
// - frontend/**
|
||||
// backend:
|
||||
// - backend/**
|
||||
// test: test/**
|
||||
// shared: &shared
|
||||
// - common/**
|
||||
// lib:
|
||||
// - *shared
|
||||
// - lib/**
|
||||
// Return an Object:
|
||||
// {
|
||||
// frontend: ['frontend/**'],
|
||||
// backend: ['backend/**'],
|
||||
// test: ['test/**'],
|
||||
// shared: ['common/**'],
|
||||
// lib: ['common/**', 'lib/**']
|
||||
// }
|
||||
|
||||
type YamlObject = {
|
||||
[key: string]: string | string[] | [string[], string]
|
||||
}
|
||||
|
||||
const getYamlFilePatternsFromContents = async ({
|
||||
content = '',
|
||||
filePath = '',
|
||||
excludedFiles = false
|
||||
}: {
|
||||
content?: string
|
||||
filePath?: string
|
||||
excludedFiles?: boolean
|
||||
}): Promise<Record<string, string[]>> => {
|
||||
const filePatterns: Record<string, string[]> = {}
|
||||
let source = ''
|
||||
|
||||
if (filePath) {
|
||||
if (!(await exists(filePath))) {
|
||||
core.error(`File does not exist: ${filePath}`)
|
||||
throw new Error(`File does not exist: ${filePath}`)
|
||||
}
|
||||
|
||||
source = await readFile(filePath, 'utf8')
|
||||
} else {
|
||||
source = content
|
||||
}
|
||||
|
||||
const doc = parseDocument(source, {merge: true, schema: 'failsafe'})
|
||||
|
||||
if (doc.errors.length > 0) {
|
||||
if (filePath) {
|
||||
core.warning(`YAML errors in ${filePath}: ${doc.errors}`)
|
||||
} else {
|
||||
core.warning(`YAML errors: ${doc.errors}`)
|
||||
}
|
||||
}
|
||||
|
||||
if (doc.warnings.length > 0) {
|
||||
if (filePath) {
|
||||
core.warning(`YAML warnings in ${filePath}: ${doc.warnings}`)
|
||||
} else {
|
||||
core.warning(`YAML warnings: ${doc.warnings}`)
|
||||
}
|
||||
}
|
||||
|
||||
const yamlObject = doc.toJS() as YamlObject
|
||||
|
||||
for (const key in yamlObject) {
|
||||
let value = yamlObject[key]
|
||||
|
||||
if (typeof value === 'string' && value.includes('\n')) {
|
||||
value = value.split('\n')
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
value = value.trim()
|
||||
|
||||
if (value) {
|
||||
filePatterns[key] = [
|
||||
excludedFiles && !value.startsWith('!') ? `!${value}` : value
|
||||
]
|
||||
}
|
||||
} else if (Array.isArray(value)) {
|
||||
filePatterns[key] = flattenDeep(value)
|
||||
.filter(v => v.trim() !== '')
|
||||
.map(v => {
|
||||
if (excludedFiles && !v.startsWith('!')) {
|
||||
v = `!${v}`
|
||||
}
|
||||
return v
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return filePatterns
|
||||
}
|
||||
|
||||
export const getYamlFilePatterns = async ({
|
||||
inputs,
|
||||
workingDirectory
|
||||
}: {
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
}): Promise<Record<string, string[]>> => {
|
||||
let filePatterns: Record<string, string[]> = {}
|
||||
if (inputs.filesYaml) {
|
||||
filePatterns = {
|
||||
...(await getYamlFilePatternsFromContents({content: inputs.filesYaml}))
|
||||
}
|
||||
}
|
||||
|
||||
if (inputs.filesYamlFromSourceFile) {
|
||||
const inputFilesYamlFromSourceFile = inputs.filesYamlFromSourceFile
|
||||
.split(inputs.filesYamlFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.map(p => path.join(workingDirectory, p))
|
||||
|
||||
core.debug(`files yaml from source file: ${inputFilesYamlFromSourceFile}`)
|
||||
|
||||
for (const filePath of inputFilesYamlFromSourceFile) {
|
||||
const newFilePatterns = await getYamlFilePatternsFromContents({filePath})
|
||||
for (const key in newFilePatterns) {
|
||||
if (key in filePatterns) {
|
||||
core.warning(
|
||||
`files_yaml_from_source_file: Duplicated key ${key} detected in ${filePath}, the ${filePatterns[key]} will be overwritten by ${newFilePatterns[key]}.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
filePatterns = {
|
||||
...filePatterns,
|
||||
...newFilePatterns
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inputs.filesIgnoreYaml) {
|
||||
const newIgnoreFilePatterns = await getYamlFilePatternsFromContents({
|
||||
content: inputs.filesIgnoreYaml,
|
||||
excludedFiles: true
|
||||
})
|
||||
|
||||
for (const key in newIgnoreFilePatterns) {
|
||||
if (key in filePatterns) {
|
||||
core.warning(
|
||||
`files_ignore_yaml: Duplicated key ${key} detected, the ${filePatterns[key]} will be overwritten by ${newIgnoreFilePatterns[key]}.`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inputs.filesIgnoreYamlFromSourceFile) {
|
||||
const inputFilesIgnoreYamlFromSourceFile =
|
||||
inputs.filesIgnoreYamlFromSourceFile
|
||||
.split(inputs.filesIgnoreYamlFromSourceFileSeparator)
|
||||
.filter(p => p !== '')
|
||||
.map(p => path.join(workingDirectory, p))
|
||||
|
||||
core.debug(
|
||||
`files ignore yaml from source file: ${inputFilesIgnoreYamlFromSourceFile}`
|
||||
)
|
||||
|
||||
for (const filePath of inputFilesIgnoreYamlFromSourceFile) {
|
||||
const newIgnoreFilePatterns = await getYamlFilePatternsFromContents({
|
||||
filePath,
|
||||
excludedFiles: true
|
||||
})
|
||||
|
||||
for (const key in newIgnoreFilePatterns) {
|
||||
if (key in filePatterns) {
|
||||
core.warning(
|
||||
`files_ignore_yaml_from_source_file: Duplicated key ${key} detected in ${filePath}, the ${filePatterns[key]} will be overwritten by ${newIgnoreFilePatterns[key]}.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
filePatterns = {
|
||||
...filePatterns,
|
||||
...newIgnoreFilePatterns
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return filePatterns
|
||||
}
|
||||
|
||||
export const setOutput = async ({
|
||||
key,
|
||||
value,
|
||||
@@ -784,7 +1041,7 @@ export const setOutput = async ({
|
||||
core.setOutput(key, cleanedValue)
|
||||
|
||||
if (inputs.writeOutputFiles) {
|
||||
const outputDir = inputs.outputDir || '.github/outputs'
|
||||
const outputDir = inputs.outputDir
|
||||
const extension = inputs.json ? 'json' : 'txt'
|
||||
const outputFilePath = path.join(outputDir, `${key}.${extension}`)
|
||||
|
||||
@@ -794,3 +1051,80 @@ export const setOutput = async ({
|
||||
await fs.writeFile(outputFilePath, cleanedValue.replace(/\\"/g, '"'))
|
||||
}
|
||||
}
|
||||
|
||||
const getDeletedFileContents = async ({
|
||||
cwd,
|
||||
filePath,
|
||||
sha
|
||||
}: {
|
||||
cwd: string
|
||||
filePath: string
|
||||
sha: string
|
||||
}): Promise<string> => {
|
||||
const {stdout, exitCode, stderr} = await exec.getExecOutput(
|
||||
'git',
|
||||
['show', `${sha}:${filePath}`],
|
||||
{
|
||||
cwd,
|
||||
silent: !core.isDebug(),
|
||||
ignoreReturnCode: true
|
||||
}
|
||||
)
|
||||
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(
|
||||
`Error getting file content from git history "${filePath}": ${stderr}`
|
||||
)
|
||||
}
|
||||
|
||||
return stdout
|
||||
}
|
||||
|
||||
export const recoverDeletedFiles = async ({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
deletedFiles,
|
||||
sha
|
||||
}: {
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
deletedFiles: string[]
|
||||
sha: string
|
||||
}): Promise<void> => {
|
||||
if (inputs.recoverDeletedFiles) {
|
||||
for (const deletedFile of deletedFiles) {
|
||||
let target = path.join(workingDirectory, deletedFile)
|
||||
|
||||
if (inputs.recoverDeletedFilesToDestination) {
|
||||
target = path.join(
|
||||
workingDirectory,
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const hasLocalGitDirectory = async ({
|
||||
workingDirectory
|
||||
}: {
|
||||
workingDirectory: string
|
||||
}): Promise<boolean> => {
|
||||
const insideWorkTree = await isInsideWorkTree({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
|
||||
return insideWorkTree
|
||||
}
|
||||
|
||||
16
test/changed-files.yml
Normal file
16
test/changed-files.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
test:
|
||||
- test/**.txt
|
||||
src:
|
||||
- src/*.ts
|
||||
- '!src/__tests__/**'
|
||||
dist:
|
||||
- dist/**
|
||||
shared: &shared
|
||||
- .github/**
|
||||
common:
|
||||
- *shared
|
||||
- .gitignore
|
||||
multiline: |
|
||||
test/**
|
||||
src/*.ts
|
||||
.github/**
|
||||
Submodule test/demo updated: 83ccca9b63...e168fac86c
@@ -1 +1 @@
|
||||
This is a test file with non ascii character in the filename.
|
||||
This is a test file with non ASCII character in the filename.
|
||||
|
||||
Reference in New Issue
Block a user