Compare commits

...

72 Commits
v38 ... v39

Author SHA1 Message Date
Tonye Jack
48566bbcc2 upgrade: nodejs to v20 (#1535) 2023-09-04 15:29:37 -06:00
renovate[bot]
d68a6666be chore(deps): lock file maintenance 2023-09-04 21:10:22 +00:00
tj-actions[bot]
07660d51a9 Upgraded to v38.2.2 (#1533)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-09-04 20:54:35 +00:00
Tonye Jack
632c84dcca Update README.md 2023-09-04 14:42:58 -06:00
renovate[bot]
1aee3621b1 chore(deps): lock file maintenance 2023-09-04 20:19:43 +00:00
Tonye Jack
8d335b7b7d fix: bug with outputs when json is set to true (#1531)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-04 20:03:32 +00:00
renovate[bot]
fd460fa3ba chore(deps): update typescript-eslint monorepo to v6.6.0 2023-09-04 18:30:15 +00:00
renovate[bot]
5b84ed26a3 chore(deps): update actions/checkout action to v4 (#1527)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-04 13:21:19 +00:00
renovate[bot]
e03c026bf4 chore(deps): lock file maintenance 2023-09-04 02:06:29 +00:00
renovate[bot]
5704310356 chore(deps): update dependency @types/node to v20.5.9 2023-09-02 23:52:01 +00:00
renovate[bot]
c922361eb2 chore(deps): update dependency @types/node to v20.5.8 2023-09-01 21:02:17 +00:00
tj-actions[bot]
48576e6584 Upgraded to v38.2.1 (#1523)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-09-01 20:46:15 +00:00
renovate[bot]
79d644d1a2 chore(deps): lock file maintenance 2023-09-01 20:30:38 +00:00
Tonye Jack
2f7246cb26 chore: update warning message (#1521)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-09-01 14:07:33 -06:00
Tonye Jack
8476756ae3 fix: bug matching patterns (#1520)
Co-authored-by: GitHub Action <action@github.com>
2023-09-01 19:49:08 +00:00
dependabot[bot]
d90c240f2a chore(deps): bump test/demo from 8bbc726 to 5dfac2e (#1518)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 07:30:11 -06:00
renovate[bot]
3be651e99d chore(deps): lock file maintenance 2023-09-01 05:09:43 +00:00
Tonye Jack
4fac98a656 Deleted .github/ISSUE_TEMPLATE/feature_request.yaml 2023-08-31 19:07:44 -06:00
Tonye Jack
bed56b29b8 Deleted .github/ISSUE_TEMPLATE/bug_report.yaml 2023-08-31 19:06:17 -06:00
Tonye Jack
2338e28eef Update bug_report.yaml 2023-08-31 18:14:10 -06:00
Tonye Jack
d4eb53db66 Update bug_report.yaml 2023-08-31 18:12:04 -06:00
Tonye Jack
8f777bbc0d Update bug_report.yaml 2023-08-31 18:10:16 -06:00
Tonye Jack
7d256b941a Update bug_report.yaml 2023-08-31 18:08:46 -06:00
Tonye Jack
c3ceccf9bc Delete FUNDING.yml 2023-08-30 19:50:24 -06:00
renovate[bot]
c89928824f chore(deps): lock file maintenance 2023-08-31 01:09:07 +00:00
tj-actions[bot]
047f654646 Upgraded to v38.2.0 (#1515)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 21:48:14 +00:00
renovate[bot]
0fc9663aa7 chore(deps): update dependency @types/uuid to v9.0.3 (#1512)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-30 15:10:05 -06:00
tj-actions[bot]
50f623482f Updated README.md (#1514)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 15:09:09 -06:00
Tonye Jack
2e0f79f8b6 Update README.md 2023-08-30 15:02:51 -06:00
tj-actions[bot]
308cb3daf9 Updated README.md (#1513)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 14:56:35 -06:00
Tonye Jack
f1b3c2fa8b feat: add support for failing on error (#1511)
Co-authored-by: GitHub Action <action@github.com>
2023-08-30 14:51:36 -06:00
tj-actions[bot]
2f6d66af9d Updated README.md (#1510)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-30 17:41:36 +00:00
Tonye Jack
ef21b84507 Update README.md 2023-08-30 11:27:45 -06:00
Tonye Jack
c9dd6721cf Update README.md 2023-08-30 11:23:44 -06:00
renovate[bot]
428519788b chore(deps): update dependency prettier to v3.0.3 2023-08-29 16:09:38 +00:00
renovate[bot]
522df62704 chore(deps): update dependency eslint-plugin-github to v4.10.0 2023-08-29 00:54:55 +00:00
renovate[bot]
d35b677f4b chore(deps): update typescript-eslint monorepo to v6.5.0 2023-08-28 18:57:32 +00:00
GitHub Action
b1c183b83c Added missing changes and modified dist assets. 2023-08-28 15:44:10 +00:00
renovate[bot]
7555f14f91 fix(deps): update dependency yaml to v2.3.2 2023-08-28 15:44:10 +00:00
renovate[bot]
bc2a793022 chore(deps): lock file maintenance 2023-08-28 00:52:59 +00:00
tj-actions[bot]
a40e52b504 Upgraded to v38.1.3 (#1503)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-26 20:51:29 +00:00
renovate[bot]
c860b5c47f chore(deps): update tj-actions/release-tagger action to v4 (#1502)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-26 14:32:03 -06:00
Tonye Jack
2f8b80270f chore: update warning message (#1500)
Co-authored-by: GitHub Action <action@github.com>
2023-08-26 14:08:40 -06:00
renovate[bot]
d01e38ae60 chore(deps): lock file maintenance 2023-08-26 03:38:30 +00:00
Tonye Jack
eed6844f8b chore: update submodule (#1498) 2023-08-25 21:18:46 -06:00
Tonye Jack
f6e73eb5b6 chore: update warning message (#1497)
Co-authored-by: GitHub Action <action@github.com>
2023-08-25 21:00:53 -06:00
tj-actions[bot]
3034ed7851 Upgraded to v38.1.1 (#1495)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-25 21:07:25 +00:00
renovate[bot]
34c9fcc96a chore(deps): update dependency eslint to v8.48.0 2023-08-25 20:53:32 +00:00
tj-actions[bot]
b7f1b7347f Updated README.md (#1493)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-25 14:29:10 -06:00
Tonye Jack
fc4a224c47 Update README.md 2023-08-25 14:28:36 -06:00
dependabot[bot]
b86b5055c6 chore(deps): bump test/demo from f0065d7 to 8bbc726 (#1492)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-25 04:27:14 +00:00
GitHub Action
c0d418d2f4 Added missing changes and modified dist assets. 2023-08-24 23:26:13 +00:00
renovate[bot]
2cd89433de chore(deps): lock file maintenance 2023-08-24 23:26:13 +00:00
renovate[bot]
6cb2857ef0 chore(deps): update dependency @types/node to v20.5.6 2023-08-24 22:44:39 +00:00
renovate[bot]
716bc48e21 chore(deps): update dependency typescript to v5.2.2 2023-08-24 19:32:03 +00:00
renovate[bot]
6afd248b18 chore(deps): update dependency jest to v29.6.4 2023-08-24 16:22:35 +00:00
Tonye Jack
8e62bee92f Updated .github/FUNDING.yml 2023-08-23 21:50:47 -06:00
Tonye Jack
02ce009f42 Updated .github/FUNDING.yml 2023-08-23 21:48:07 -06:00
tj-actions[bot]
88a8df65a2 Updated README.md (#1486)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-24 03:14:01 +00:00
tj-actions[bot]
5c42e98b8f Updated README.md (#1485)
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-23 20:59:02 -06:00
renovate[bot]
fd5abe1ac5 chore(deps): update tj-actions/auto-doc action to v3 (#1484)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-24 02:53:09 +00:00
tj-actions[bot]
088d89c918 Updated README.md (#1483)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-24 02:33:06 +00:00
Tonye Jack
8299ae07ec Update update-readme.yml 2023-08-23 20:15:29 -06:00
Tonye Jack
fd8ad0b934 Update update-readme.yml 2023-08-23 20:13:54 -06:00
tj-actions[bot]
2fc6aa80df Upgraded to v38.1.0 (#1482)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-23 23:06:36 +00:00
dependabot[bot]
1c26215f3f chore(deps): bump test/demo from e168fac to f0065d7 (#1481)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-23 22:40:11 +00:00
dependabot[bot]
7b1e1540e2 chore(deps-dev): bump @types/node from 20.5.3 to 20.5.4 (#1480)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-23 21:46:49 +00:00
Tonye Jack
02010edac3 chore: move submodule update to dependabot and remove unused workflow (#1478) 2023-08-23 15:09:57 -06:00
tj-actions[bot]
e4e76943d6 Updated README.md (#1477)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-23 15:05:35 -06:00
Tonye Jack
569361586a feat: add support for fetching additional history for submodules (#1476)
Co-authored-by: GitHub Action <action@github.com>
2023-08-23 15:04:44 -06:00
renovate[bot]
785218258b chore(deps): lock file maintenance 2023-08-23 05:18:13 +00:00
tj-actions[bot]
0b45bc64c2 Upgraded to v38 (#1474)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-08-22 22:59:10 -06:00
27 changed files with 1665 additions and 1222 deletions

12
.github/FUNDING.yml vendored
View File

@@ -1,12 +0,0 @@
# These are supported funding model platforms
github: jackton1
patreon: # Replace with a single Patreon username
open_collective: tj-actions
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: []

View File

@@ -1,98 +0,0 @@
name: 🐞 Bug
description: Create a report to help us improve
title: "[BUG] <title>"
labels: [bug, needs triage]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: checkboxes
attributes:
label: Does this issue exist in the latest version?
description: Please view all releases to confirm that this issue hasn't already been fixed.
options:
- label: I'm using the latest release
required: true
- type: textarea
id: what-happened
attributes:
label: Describe the bug?
description: A clear and concise description of what the bug is
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: To Reproduce
description: Steps to reproduce the behavior?
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: true
- type: dropdown
id: os
attributes:
label: What OS are you seeing the problem on?
multiple: true
options:
- all
- ubuntu-latest or ubuntu-20.04
- ubuntu-18.04
- macos-latest or macos-10.15
- macos-11
- windows-latest or windows-2019
- windows-2016
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior?
description: A clear and concise description of what you expected to happen.
placeholder: Tell us what you expected!
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output which is obtained after enabling debug logging. This will be automatically formatted into code, so no need for backticks.
placeholder: |
1. Re-running the workflow with debug logging enabled.
2. Copy or download the log archive.
3. Paste the contents here or upload the file in a subsequent comment.
render: shell
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? or References?
Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](../blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true

View File

@@ -1,59 +0,0 @@
name: Feature request
description: Suggest an idea for this project
title: "[Feature] <title>"
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: checkboxes
attributes:
label: Is this feature missing in the latest version?
description: Please upgrade to the latest version to verify that this feature is still missing.
options:
- label: I'm using the latest release
required: true
- type: textarea
id: what-happened
attributes:
label: Is your feature request related to a problem? Please describe.
description: |
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: requests
attributes:
label: Describe the solution you'd like?
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Describe alternatives you've considered?
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: |
Links? or References?
Add any other context or screenshots about the feature request here.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](../blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true

View File

@@ -15,3 +15,10 @@ updates:
open-pull-requests-limit: 10 open-pull-requests-limit: 10
labels: labels:
- "merge when passing" - "merge when passing"
- package-ecosystem: gitsubmodule
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "merge when passing"

View File

@@ -29,7 +29,7 @@ jobs:
steps: steps:
# Checkout the repository to the GitHub Actions runner # Checkout the repository to the GitHub Actions runner
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI - name: Run Codacy Analysis CLI

View File

@@ -38,7 +38,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL

View File

@@ -16,7 +16,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0

View File

@@ -14,7 +14,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }} matrix: ${{ steps.set-matrix.outputs.matrix }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Get changed files - name: Get changed files
@@ -38,7 +38,7 @@ jobs:
fail-fast: false fail-fast: false
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Test - name: Test
run: | run: |
echo ${{ matrix.files }} echo ${{ matrix.files }}

View File

@@ -1,29 +0,0 @@
on:
workflow_dispatch:
jobs:
sync:
name: Submodule Sync
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Git Sumbodule Update
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.2
with:
title: "Updated submodule"
labels: "merge when passing"
branch: "chore/update-submodule"
commit-message: "Updated submodule"
body: "Updated submodule"
token: ${{ secrets.PAT_TOKEN }}

View File

@@ -8,11 +8,11 @@ jobs:
update-version: update-version:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Run release-tagger - name: Run release-tagger
uses: tj-actions/release-tagger@v3 uses: tj-actions/release-tagger@v4
- name: Sync release version. - name: Sync release version.
uses: tj-actions/sync-release-version@v13 uses: tj-actions/sync-release-version@v13
id: sync-release-version id: sync-release-version
@@ -21,6 +21,13 @@ jobs:
only_major: true only_major: true
paths: | paths: |
README.md README.md
- name: Sync release package version.
uses: tj-actions/sync-release-version@v13
id: sync-release-package-version
with:
pattern: '"version": "'
paths: |
package.json
- name: Run git-cliff - name: Run git-cliff
uses: tj-actions/git-cliff@v1 uses: tj-actions/git-cliff@v1
- name: Create Pull Request - name: Create Pull Request

View File

@@ -37,7 +37,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: shellcheck - name: shellcheck
uses: reviewdog/action-shellcheck@v1.18 uses: reviewdog/action-shellcheck@v1.18
@@ -46,17 +46,17 @@ jobs:
outputs: outputs:
files_changed: ${{ steps.changed_files.outputs.files_changed }} files_changed: ${{ steps.changed_files.outputs.files_changed }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
persist-credentials: false persist-credentials: false
fetch-depth: 0 fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Use Node.js 16.x - name: Use Node.js 20.x
uses: actions/setup-node@v3.8.1 uses: actions/setup-node@v3.8.1
with: with:
cache: 'yarn' cache: 'yarn'
node-version: '16.x' node-version: '20.x'
- name: Create coverage directory and clover.xml - name: Create coverage directory and clover.xml
run: | run: |
@@ -82,7 +82,6 @@ jobs:
- name: Verify Changed files - name: Verify Changed files
uses: tj-actions/verify-changed-files@v16 uses: tj-actions/verify-changed-files@v16
id: changed_files id: changed_files
if: github.event_name == 'pull_request'
with: with:
files: | files: |
src src
@@ -124,7 +123,7 @@ jobs:
if: needs.build.outputs.files_changed != 'true' if: needs.build.outputs.files_changed != 'true'
steps: steps:
- name: Checkout into dir1 - name: Checkout into dir1
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true submodules: true
@@ -164,7 +163,7 @@ jobs:
path: dir2/dist path: dir2/dist
- name: Checkout into dir2 - name: Checkout into dir2
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true submodules: true
@@ -199,7 +198,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 fetch-depth: 0
@@ -257,7 +256,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 fetch-depth: 0
@@ -295,7 +294,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 fetch-depth: 0
@@ -333,7 +332,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
@@ -365,7 +364,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
@@ -397,7 +396,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
fetch-depth: ${{ matrix.fetch-depth }} fetch-depth: ${{ matrix.fetch-depth }}
persist-credentials: false persist-credentials: false
@@ -426,7 +425,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
@@ -480,7 +479,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Download build assets - name: Download build assets
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
@@ -535,7 +534,7 @@ jobs:
pull-requests: read pull-requests: read
steps: steps:
- name: Checkout into dir1 - name: Checkout into dir1
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true submodules: true
@@ -571,7 +570,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive submodules: recursive
@@ -614,7 +613,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive submodules: recursive
@@ -666,7 +665,7 @@ jobs:
steps: steps:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive submodules: recursive
@@ -821,7 +820,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
submodules: true submodules: true
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
@@ -1030,7 +1029,8 @@ jobs:
if: | if: |
( (
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test/test rename-1.txt') || !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test/test rename-1.txt') ||
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') ||
steps.changed-files-dir-names-specific-include-files.outputs.any_changed == 'false'
) && runner.os != 'Windows' ) && runner.os != 'Windows'
run: | run: |
echo "Invalid output: Expected to include (test/test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})" echo "Invalid output: Expected to include (test/test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
@@ -1041,13 +1041,41 @@ jobs:
if: | if: |
( (
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test\\test rename-1.txt') || !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test\\test rename-1.txt') ||
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') ||
steps.changed-files-dir-names-specific-include-files.outputs.any_changed == 'false'
) && runner.os == 'Windows' ) && runner.os == 'Windows'
run: | run: |
echo "Invalid output: Expected to include (test\\test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})" echo "Invalid output: Expected to include (test\\test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
exit 1 exit 1
shell: shell:
bash bash
- name: Run changed-files with dir_names for specific files and an unmatched path
id: changed-files-dir-names-specific-unmatched-path
uses: ./
with:
base_sha: d1c0ee4
sha: 4d04215
fetch_depth: 60000
dir_names: true
files: unknown/**
json: true
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-dir-names-specific-unmatched-path.outputs) }}'
shell:
bash
- name: Check dir_names output
if: |
(
steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files != '[]' ||
steps.changed-files-dir-names-specific-unmatched-path.outputs.any_changed == 'true' ||
steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files_count != '0'
)
run: |
echo "Invalid output: Expected empty array and any_changed to be false got (${{ steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files }}) and (${{ steps.changed-files-dir-names-specific-unmatched-path.outputs.any_changed }})"
exit 1
shell:
bash
- name: Run changed-files with forward slash separator - name: Run changed-files with forward slash separator
id: changed-files-forward-slash id: changed-files-forward-slash
uses: ./ uses: ./

View File

@@ -9,12 +9,12 @@ jobs:
sync-assets: sync-assets:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Run auto-doc - name: Run auto-doc
uses: tj-actions/auto-doc@v2 uses: tj-actions/auto-doc@v3
- name: Run remark - name: Run remark
uses: tj-actions/remark@v3 uses: tj-actions/remark@v3

2
.nvmrc
View File

@@ -1 +1 @@
16 20

View File

@@ -1,5 +1,233 @@
# Changelog # Changelog
# [38.2.2](https://github.com/tj-actions/changed-files/compare/v38.2.1...v38.2.2) - (2023-09-04)
## <!-- 1 -->🐛 Bug Fixes
- Bug with outputs when json is set to true ([#1531](https://github.com/tj-actions/changed-files/issues/1531)) ([8d335b7](https://github.com/tj-actions/changed-files/commit/8d335b7b7dd078ea984daff751cca794ed2e3f55)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Lock file maintenance ([1aee362](https://github.com/tj-actions/changed-files/commit/1aee3621b1c10305ee778298fcf32324684e5448)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.6.0 ([fd460fa](https://github.com/tj-actions/changed-files/commit/fd460fa3ba5a11b8fde158a65d59d764c344878e)) - (renovate[bot])
- **deps:** Update actions/checkout action to v4 ([#1527](https://github.com/tj-actions/changed-files/issues/1527)) ([5b84ed2](https://github.com/tj-actions/changed-files/commit/5b84ed26a3cc4c8a3f72c23739e361226a1c3773)) - (renovate[bot])
- **deps:** Lock file maintenance ([e03c026](https://github.com/tj-actions/changed-files/commit/e03c026bf43272cfd653bdebb67d53eefa7e381c)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.9 ([5704310](https://github.com/tj-actions/changed-files/commit/5704310356f399321c158190d53b4862c1adcdcd)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.8 ([c922361](https://github.com/tj-actions/changed-files/commit/c922361eb2e5315d71b2b0ce26a3ce1919ae0725)) - (renovate[bot])
- **deps:** Lock file maintenance ([79d644d](https://github.com/tj-actions/changed-files/commit/79d644d1a2bc9ca4316052da1b06e73cde530d09)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.2.1 ([#1523](https://github.com/tj-actions/changed-files/issues/1523))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([48576e6](https://github.com/tj-actions/changed-files/commit/48576e65843bb9b05d25cac69fe8b1c142a9485a)) - (tj-actions[bot])
# [38.2.1](https://github.com/tj-actions/changed-files/compare/v38.2.0...v38.2.1) - (2023-09-01)
## <!-- 1 -->🐛 Bug Fixes
- Bug matching patterns ([#1520](https://github.com/tj-actions/changed-files/issues/1520)) ([8476756](https://github.com/tj-actions/changed-files/commit/8476756ae3363aa4c10685f8804636de76aee77c)) - (Tonye Jack)
## <!-- 17 --> Remove
- Deleted .github/ISSUE_TEMPLATE/feature_request.yaml ([4fac98a](https://github.com/tj-actions/changed-files/commit/4fac98a65655335ee89759e4c87d265b0114e15c)) - (Tonye Jack)
- Deleted .github/ISSUE_TEMPLATE/bug_report.yaml ([bed56b2](https://github.com/tj-actions/changed-files/commit/bed56b29b814ce968175396abd67152a01b3a722)) - (Tonye Jack)
- Delete FUNDING.yml ([c3ceccf](https://github.com/tj-actions/changed-files/commit/c3ceccf9bce227317f59ed99512b300e0aa6c2ae)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update bug_report.yaml ([2338e28](https://github.com/tj-actions/changed-files/commit/2338e28eefcb81d8c25c7e6ca50543f53f60446b)) - (Tonye Jack)
- Update bug_report.yaml ([d4eb53d](https://github.com/tj-actions/changed-files/commit/d4eb53db66ce407e266022c530dec9703cdffd3d)) - (Tonye Jack)
- Update bug_report.yaml ([8f777bb](https://github.com/tj-actions/changed-files/commit/8f777bbc0dbc0dfc6994d2c93114bfb970d95e61)) - (Tonye Jack)
- Update bug_report.yaml ([7d256b9](https://github.com/tj-actions/changed-files/commit/7d256b941a1ffb4dea0a5f3b7a3a34b6fe962e4c)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update warning message ([#1521](https://github.com/tj-actions/changed-files/issues/1521)) ([2f7246c](https://github.com/tj-actions/changed-files/commit/2f7246cb26e8bb6709b6cbfc1fec7febfe82e96a)) - (Tonye Jack)
- **deps:** Bump test/demo from `8bbc726` to `5dfac2e` ([#1518](https://github.com/tj-actions/changed-files/issues/1518)) ([d90c240](https://github.com/tj-actions/changed-files/commit/d90c240f2ad4ec04d8f0f48e5ac290ad96ebe850)) - (dependabot[bot])
- **deps:** Lock file maintenance ([3be651e](https://github.com/tj-actions/changed-files/commit/3be651e99d3d4eae395694f6c6f3b9d18457f6c8)) - (renovate[bot])
- **deps:** Lock file maintenance ([c899288](https://github.com/tj-actions/changed-files/commit/c89928824ff66dd05ee32708cd6228b6d65c9405)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.2.0 ([#1515](https://github.com/tj-actions/changed-files/issues/1515))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([047f654](https://github.com/tj-actions/changed-files/commit/047f65464639f7d9b9efefea74419be4c0b50b5f)) - (tj-actions[bot])
# [38.2.0](https://github.com/tj-actions/changed-files/compare/v38.1.3...v38.2.0) - (2023-08-30)
## <!-- 0 -->🚀 Features
- Add support for failing on error ([#1511](https://github.com/tj-actions/changed-files/issues/1511)) ([f1b3c2f](https://github.com/tj-actions/changed-files/commit/f1b3c2fa8b5692e972e331fdd79882d38273972c)) - (Tonye Jack)
## <!-- 1 -->🐛 Bug Fixes
- **deps:** Update dependency yaml to v2.3.2 ([7555f14](https://github.com/tj-actions/changed-files/commit/7555f14f918691d9063483ad675c79b69b47adcd)) - (renovate[bot])
## <!-- 16 --> Add
- Added missing changes and modified dist assets.
([b1c183b](https://github.com/tj-actions/changed-files/commit/b1c183b83c74c3f32fb9bb133284a41b10553736)) - (GitHub Action)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1514](https://github.com/tj-actions/changed-files/issues/1514))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([50f6234](https://github.com/tj-actions/changed-files/commit/50f623482f13ff783ea3495d9c9a106d8f17d2ff)) - (tj-actions[bot])
- Update README.md ([2e0f79f](https://github.com/tj-actions/changed-files/commit/2e0f79f8b6a541bee4a978276043a311172d0dc2)) - (Tonye Jack)
- Updated README.md ([#1513](https://github.com/tj-actions/changed-files/issues/1513))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([308cb3d](https://github.com/tj-actions/changed-files/commit/308cb3daf981b614d1eb8f01ba365f9d478fb50d)) - (tj-actions[bot])
- Updated README.md ([#1510](https://github.com/tj-actions/changed-files/issues/1510))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2f6d66a](https://github.com/tj-actions/changed-files/commit/2f6d66af9db64309ccb993e5969f61d180c9d5ff)) - (tj-actions[bot])
- Update README.md ([ef21b84](https://github.com/tj-actions/changed-files/commit/ef21b845077a6a12523c59bee84fab2847a3c6ed)) - (Tonye Jack)
- Update README.md ([c9dd672](https://github.com/tj-actions/changed-files/commit/c9dd6721cf288da7c7c5d06f78cb27e66d7d8279)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update dependency @types/uuid to v9.0.3 ([#1512](https://github.com/tj-actions/changed-files/issues/1512)) ([0fc9663](https://github.com/tj-actions/changed-files/commit/0fc9663aa70243d87319dbd32fd926344d18d38f)) - (renovate[bot])
- **deps:** Update dependency prettier to v3.0.3 ([4285197](https://github.com/tj-actions/changed-files/commit/428519788bc9daeb52f4031e6be46b6a8b42d57a)) - (renovate[bot])
- **deps:** Update dependency eslint-plugin-github to v4.10.0 ([522df62](https://github.com/tj-actions/changed-files/commit/522df62704d7d3a82510f5b1af9bcac3e8c95a60)) - (renovate[bot])
- **deps:** Update typescript-eslint monorepo to v6.5.0 ([d35b677](https://github.com/tj-actions/changed-files/commit/d35b677f4bef732191226506c4e785f7dfea2cd0)) - (renovate[bot])
- **deps:** Lock file maintenance ([bc2a793](https://github.com/tj-actions/changed-files/commit/bc2a7930225604ad9877b568ec5bb044d0b1f59c)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.1.3 ([#1503](https://github.com/tj-actions/changed-files/issues/1503))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([a40e52b](https://github.com/tj-actions/changed-files/commit/a40e52b504ccee766d2304f1b5ff1aeba55a832e)) - (tj-actions[bot])
# [38.1.3](https://github.com/tj-actions/changed-files/compare/v38.1.2...v38.1.3) - (2023-08-26)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update tj-actions/release-tagger action to v4 ([#1502](https://github.com/tj-actions/changed-files/issues/1502)) ([c860b5c](https://github.com/tj-actions/changed-files/commit/c860b5c47fa71f461da850094ef2f6e3d6514e44)) - (renovate[bot])
# [38.1.2](https://github.com/tj-actions/changed-files/compare/v38.1.1...v38.1.2) - (2023-08-26)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update warning message ([#1500](https://github.com/tj-actions/changed-files/issues/1500)) ([2f8b802](https://github.com/tj-actions/changed-files/commit/2f8b80270f04e421b28efb2abaccef4fce4815b6)) - (Tonye Jack)
- **deps:** Lock file maintenance ([d01e38a](https://github.com/tj-actions/changed-files/commit/d01e38ae60f5527562be5c2d2bee11d666a25759)) - (renovate[bot])
- Update submodule ([#1498](https://github.com/tj-actions/changed-files/issues/1498)) ([eed6844](https://github.com/tj-actions/changed-files/commit/eed6844f8b8930b86537b173c0c545d73fdf2177)) - (Tonye Jack)
- Update warning message ([#1497](https://github.com/tj-actions/changed-files/issues/1497)) ([f6e73eb](https://github.com/tj-actions/changed-files/commit/f6e73eb5b610c261657b2de25ec64c4252069608)) - (Tonye Jack)
- **deps:** Update dependency eslint to v8.48.0 ([34c9fcc](https://github.com/tj-actions/changed-files/commit/34c9fcc96ac0a5d0be0519ed91e3f625c9b8ad09)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.1.1 ([#1495](https://github.com/tj-actions/changed-files/issues/1495))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([3034ed7](https://github.com/tj-actions/changed-files/commit/3034ed7851a1bae2de6ae8f20e9c9890917b859a)) - (tj-actions[bot])
# [38.1.1](https://github.com/tj-actions/changed-files/compare/v38.1.0...v38.1.1) - (2023-08-25)
## <!-- 16 --> Add
- Added missing changes and modified dist assets.
([c0d418d](https://github.com/tj-actions/changed-files/commit/c0d418d2f41e21e92203a1022c4606ef77aa6bc2)) - (GitHub Action)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1493](https://github.com/tj-actions/changed-files/issues/1493))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([b7f1b73](https://github.com/tj-actions/changed-files/commit/b7f1b7347fea1df67230801b66081fe3cba7dc69)) - (tj-actions[bot])
- Update README.md ([fc4a224](https://github.com/tj-actions/changed-files/commit/fc4a224c47dadefa07dc096ed0ff953c0bd17144)) - (Tonye Jack)
- Updated .github/FUNDING.yml ([8e62bee](https://github.com/tj-actions/changed-files/commit/8e62bee92f800ef13879d41004367f912f016c85)) - (Tonye Jack)
- Updated .github/FUNDING.yml ([02ce009](https://github.com/tj-actions/changed-files/commit/02ce009f4243cd05f1381c43c6a1d48f68a3b485)) - (Tonye Jack)
- Updated README.md ([#1486](https://github.com/tj-actions/changed-files/issues/1486))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([88a8df6](https://github.com/tj-actions/changed-files/commit/88a8df65a2f24314ca8833c27ec427ffe6809039)) - (tj-actions[bot])
- Updated README.md ([#1485](https://github.com/tj-actions/changed-files/issues/1485))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([5c42e98](https://github.com/tj-actions/changed-files/commit/5c42e98b8fe904db676293fa7156514c905af8c4)) - (tj-actions[bot])
- Updated README.md ([#1483](https://github.com/tj-actions/changed-files/issues/1483))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([088d89c](https://github.com/tj-actions/changed-files/commit/088d89c918a1e7d236520ec4e7daea1d959d41e5)) - (tj-actions[bot])
- Update update-readme.yml ([8299ae0](https://github.com/tj-actions/changed-files/commit/8299ae07ec237ebe1c58a4cc49b9c1e064d927fa)) - (Tonye Jack)
- Update update-readme.yml ([fd8ad0b](https://github.com/tj-actions/changed-files/commit/fd8ad0b93433d4d8c80427eb93ae5e78b8a1ce7c)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Bump test/demo from `f0065d7` to `8bbc726` ([#1492](https://github.com/tj-actions/changed-files/issues/1492)) ([b86b505](https://github.com/tj-actions/changed-files/commit/b86b5055c618b14573c5d8f6d7198309ea0828ac)) - (dependabot[bot])
- **deps:** Lock file maintenance ([2cd8943](https://github.com/tj-actions/changed-files/commit/2cd89433debfbbf5e77c95d38dac646ff3a76ebc)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.6 ([6cb2857](https://github.com/tj-actions/changed-files/commit/6cb2857ef0a3296d70201f34aa4ca530deb48e38)) - (renovate[bot])
- **deps:** Update dependency typescript to v5.2.2 ([716bc48](https://github.com/tj-actions/changed-files/commit/716bc48e21c1367a2c750432fff2cc1dd8fe4ead)) - (renovate[bot])
- **deps:** Update dependency jest to v29.6.4 ([6afd248](https://github.com/tj-actions/changed-files/commit/6afd248b1827a2f7943482875140b770f36cc4e8)) - (renovate[bot])
- **deps:** Update tj-actions/auto-doc action to v3 ([#1484](https://github.com/tj-actions/changed-files/issues/1484)) ([fd5abe1](https://github.com/tj-actions/changed-files/commit/fd5abe1ac5fb8d024051c757ad9bf1fc6b767e6c)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38.1.0 ([#1482](https://github.com/tj-actions/changed-files/issues/1482))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([2fc6aa8](https://github.com/tj-actions/changed-files/commit/2fc6aa80df596875e0f74f1df939e72b7627e867)) - (tj-actions[bot])
# [38.1.0](https://github.com/tj-actions/changed-files/compare/v38.0.0...v38.1.0) - (2023-08-23)
## <!-- 0 -->🚀 Features
- Add support for fetching additional history for submodules ([#1476](https://github.com/tj-actions/changed-files/issues/1476)) ([5693615](https://github.com/tj-actions/changed-files/commit/569361586a6cff9491312916c5e703a443417e81)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1477](https://github.com/tj-actions/changed-files/issues/1477))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([e4e7694](https://github.com/tj-actions/changed-files/commit/e4e76943d643113dcf1458aecb541063cbdc63fd)) - (tj-actions[bot])
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Bump test/demo from `e168fac` to `f0065d7` ([#1481](https://github.com/tj-actions/changed-files/issues/1481)) ([1c26215](https://github.com/tj-actions/changed-files/commit/1c26215f3fbd51eba03bc199e5cbabdfc3584ce3)) - (dependabot[bot])
- **deps-dev:** Bump @types/node from 20.5.3 to 20.5.4 ([#1480](https://github.com/tj-actions/changed-files/issues/1480)) ([7b1e154](https://github.com/tj-actions/changed-files/commit/7b1e1540e27d3397053816b2bcf36f17cfc6cf2f)) - (dependabot[bot])
- Move submodule update to dependabot and remove unused workflow ([#1478](https://github.com/tj-actions/changed-files/issues/1478)) ([02010ed](https://github.com/tj-actions/changed-files/commit/02010edac36d80b90e96e94e505a9e34a67f7b89)) - (Tonye Jack)
- **deps:** Lock file maintenance ([7852182](https://github.com/tj-actions/changed-files/commit/785218258b790e5191c8655f483824c7e8c226da)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v38 ([#1474](https://github.com/tj-actions/changed-files/issues/1474))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([0b45bc6](https://github.com/tj-actions/changed-files/commit/0b45bc64c29a84aea65c944b5a06b6c75844dfaa)) - (tj-actions[bot])
# [38.0.0](https://github.com/tj-actions/changed-files/compare/v37.6.1...v38.0.0) - (2023-08-23)
## <!-- 0 -->🚀 Features
- Add support for including matching changed files when dir_names is set to true ([#1464](https://github.com/tj-actions/changed-files/issues/1464)) ([8789204](https://github.com/tj-actions/changed-files/commit/8789204f9747de46e322edc26ccef589722b5d12)) - (Tonye Jack)
## <!-- 1 -->🐛 Bug Fixes
- Error getting diff for submodules ([#1473](https://github.com/tj-actions/changed-files/issues/1473)) ([17f3fec](https://github.com/tj-actions/changed-files/commit/17f3fec1edef0c3916d59cbcee1585fcd457e456)) - (Tonye Jack)
- Bug with locating the previous tag ([#1470](https://github.com/tj-actions/changed-files/issues/1470)) ([fc63326](https://github.com/tj-actions/changed-files/commit/fc633265449c7430ee5634b1c673247b313ef8cf)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Updated README.md ([#1466](https://github.com/tj-actions/changed-files/issues/1466))
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([e8f1278](https://github.com/tj-actions/changed-files/commit/e8f12786b4779b5208c8e0593863215f52c804e0)) - (tj-actions[bot])
- Update README.md ([f8b4039](https://github.com/tj-actions/changed-files/commit/f8b4039d9628a18c5e26b11a098230dd037e299e)) - (Tonye Jack)
- Update README.md ([0e8eddf](https://github.com/tj-actions/changed-files/commit/0e8eddfd8c525e4d8522d7de71af8ad5e4290b90)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- Update test ([#1469](https://github.com/tj-actions/changed-files/issues/1469)) ([52dbf3e](https://github.com/tj-actions/changed-files/commit/52dbf3e3cf799a1324a9c148c64948abbf8c3fa6)) - (Tonye Jack)
- **deps:** Update dependency @types/jest to v29.5.4 ([#1472](https://github.com/tj-actions/changed-files/issues/1472)) ([0a814e4](https://github.com/tj-actions/changed-files/commit/0a814e4372753d6beb4a9ec8f4166aea312f679a)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.3 ([#1467](https://github.com/tj-actions/changed-files/issues/1467)) ([18bacaa](https://github.com/tj-actions/changed-files/commit/18bacaab15227e761b04fb4097648318590be71a)) - (renovate[bot])
- Update .eslintrc.json ([#1465](https://github.com/tj-actions/changed-files/issues/1465)) ([819fb64](https://github.com/tj-actions/changed-files/commit/819fb645201f8693c48ca1158b4069d0c7cec64d)) - (Tonye Jack)
- **deps:** Update typescript-eslint monorepo to v6.4.1 ([#1463](https://github.com/tj-actions/changed-files/issues/1463)) ([31003b4](https://github.com/tj-actions/changed-files/commit/31003b45e6faa01151aeb2508de21d895b9024d8)) - (renovate[bot])
- **deps:** Update dependency jest to v29.6.3 ([#1462](https://github.com/tj-actions/changed-files/issues/1462)) ([1f04b16](https://github.com/tj-actions/changed-files/commit/1f04b16682ff06e18be316b672337f43ebd8f768)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1461](https://github.com/tj-actions/changed-files/issues/1461)) ([0a8b04e](https://github.com/tj-actions/changed-files/commit/0a8b04e3e345eae4a8aa28fb46959c1509197ee5)) - (renovate[bot])
- **deps:** Update dependency @types/node to v20.5.1 ([#1460](https://github.com/tj-actions/changed-files/issues/1460)) ([6da496e](https://github.com/tj-actions/changed-files/commit/6da496e2f92930ffc11735db0b53e4e2027e9e26)) - (renovate[bot])
- **deps:** Update actions/setup-node action to v3.8.1 ([#1459](https://github.com/tj-actions/changed-files/issues/1459)) ([68d38a3](https://github.com/tj-actions/changed-files/commit/68d38a3f163ab827c733c45c9f23d607401a34ce)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v37.6.1 ([#1458](https://github.com/tj-actions/changed-files/issues/1458))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([3645cf9](https://github.com/tj-actions/changed-files/commit/3645cf9fc374b6e501b12888142f2aabc6b3cbf9)) - (tj-actions[bot])
# [37.6.1](https://github.com/tj-actions/changed-files/compare/v37.6.0...v37.6.1) - (2023-08-15) # [37.6.1](https://github.com/tj-actions/changed-files/compare/v37.6.0...v37.6.1) - (2023-08-15)
## <!-- 26 -->🔄 Update ## <!-- 26 -->🔄 Update

303
README.md
View File

@@ -19,25 +19,27 @@ Effortlessly track all changed files and directories relative to a target branch
## Table of contents ## Table of contents
* [Features](#features) * [Features 🚀](#features-)
* [Usage](#usage) * [Usage 💻](#usage-)
* [On `pull_request`](#on-pull_request) * [On `pull_request` 🔀](#on-pull_request-)
* [Using local .git history](#using-local-git-history) * [Using local .git history 📁](#using-local-git-history-)
* [Using Github's API](#using-githubs-api) * [Using Github's API :octocat:](#using-githubs-api-octocat)
* [On `push`](#on-push) * [On `push` ⬆️](#on-push-)
* [Useful Acronyms](#useful-acronyms) * [Useful Acronyms 🧮](#useful-acronyms-)
* [Outputs](#outputs) * [Outputs 📤](#outputs-)
* [Inputs](#inputs) * [Inputs ⚙️](#inputs-)
* [Versioning](#versioning) * [Versioning 🏷️](#versioning-)
* [Examples](#examples) * [Examples 📄](#examples-)
* [Real-world usage](#real-world-usage) * [Real-world usage 🌐](#real-world-usage-)
* [Known Limitation](#known-limitation) * [Open source projects 📦](#open-source-projects-)
* [Migration guide](#migration-guide) * [Scalability Example 📈](#scalability-example-)
* [Credits](#credits) * [Known Limitation ⚠️](#known-limitation-)
* [Report Bugs](#report-bugs) * [Migration guide 🔄](#migration-guide-)
* [Credits 👏](#credits-)
* [Report Bugs 🐛](#report-bugs-)
* [Contributors ✨](#contributors-) * [Contributors ✨](#contributors-)
## Features ## Features 🚀
* Fast execution, averaging 0-10 seconds. * Fast execution, averaging 0-10 seconds.
* Leverages either [Github's REST API](https://docs.github.com/en/rest/reference/repos#list-commits) or [Git's native diff](https://git-scm.com/docs/git-diff) to determine changed files. * Leverages either [Github's REST API](https://docs.github.com/en/rest/reference/repos#list-commits) or [Git's native diff](https://git-scm.com/docs/git-diff) to determine changed files.
@@ -72,7 +74,7 @@ Effortlessly track all changed files and directories relative to a target branch
And many more... And many more...
## Usage ## Usage 💻
> **Warning** > **Warning**
> >
@@ -84,9 +86,9 @@ And many more...
Visit the [discussions for more information](https://github.com/tj-actions/changed-files/discussions) or [create a new discussion](https://github.com/tj-actions/changed-files/discussions/new/choose) for usage-related questions. Visit the [discussions for more information](https://github.com/tj-actions/changed-files/discussions) or [create a new discussion](https://github.com/tj-actions/changed-files/discussions/new/choose) for usage-related questions.
### On `pull_request` ### On `pull_request` 🔀
#### Using local .git history #### Using local .git history 📁
```yaml ```yaml
name: CI name: CI
@@ -104,14 +106,14 @@ jobs:
runs-on: ubuntu-latest # windows-latest || macos-latest runs-on: ubuntu-latest # windows-latest || macos-latest
name: Test changed-files name: Test changed-files
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
# Example 1 # Example 1
- name: Get all test, doc and src files that have changed - name: Get all test, doc and src files that have changed
id: changed-files-yaml id: changed-files-yaml
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
files_yaml: | files_yaml: |
doc: doc:
@@ -141,7 +143,7 @@ jobs:
# Example 2 # Example 2
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g # To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with: # with:
@@ -156,7 +158,7 @@ jobs:
# Example 3 # Example 3
- name: Get changed files in the docs folder - name: Get changed files in the docs folder
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs` files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
files_ignore: docs/static.js files_ignore: docs/static.js
@@ -168,7 +170,7 @@ jobs:
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}" echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
``` ```
#### Using Github's API #### Using Github's API :octocat:
```yaml ```yaml
name: CI name: CI
@@ -196,7 +198,7 @@ jobs:
steps: steps:
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
- name: List all changed files - name: List all changed files
run: | run: |
@@ -205,7 +207,7 @@ jobs:
done done
``` ```
### On `push` ### On `push` ⬆️
```yaml ```yaml
name: CI name: CI
@@ -249,14 +251,14 @@ jobs:
runs-on: ubuntu-latest # windows-latest || macos-latest runs-on: ubuntu-latest # windows-latest || macos-latest
name: Test changed-files name: Test changed-files
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
# Example 1 # Example 1
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit. # NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
@@ -285,7 +287,7 @@ Support this project with a :star:
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
## Useful Acronyms ## Useful Acronyms 🧮
| Acronym | Meaning | | Acronym | Meaning |
|:---------:|:------------:| |:---------:|:------------:|
@@ -302,107 +304,110 @@ Support this project with a :star:
> >
> * When using `files_yaml*` inputs ensure all outputs are prefixed by the key `test_{...}` e.g. `test_added_files`, `test_any_changed` > * When using `files_yaml*` inputs ensure all outputs are prefixed by the key `test_{...}` e.g. `test_added_files`, `test_any_changed`
## Outputs ## Outputs 📤
<!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section --> <!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section -->
| OUTPUT | TYPE | DESCRIPTION | | OUTPUT | TYPE | DESCRIPTION |
|--------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| added\_files | string | Returns only files that are <br>Added (A). | | <a name="output_added_files"></a>[added\_files](#output_added_files) | string | Returns only files that are <br>Added (A). |
| added\_files\_count | string | Returns the number of `added_files` | | <a name="output_added_files_count"></a>[added\_files\_count](#output_added_files_count) | string | Returns the number of `added_files` |
| all\_changed\_and\_modified\_files | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* | | <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
| all\_changed\_and\_modified\_files\_count | string | Returns the number of `all_changed_and_modified_files` | | <a name="output_all_changed_and_modified_files_count"></a>[all\_changed\_and\_modified\_files\_count](#output_all_changed_and_modified_files_count) | string | Returns the number of `all_changed_and_modified_files` |
| all\_changed\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* | | <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
| all\_changed\_files\_count | string | Returns the number of `all_changed_files` | | <a name="output_all_changed_files_count"></a>[all\_changed\_files\_count](#output_all_changed_files_count) | string | Returns the number of `all_changed_files` |
| all\_modified\_files | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. | | <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
| all\_modified\_files\_count | string | Returns the number of `all_modified_files` | | <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` |
| all\_old\_new\_renamed\_files | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) | | <a name="output_all_old_new_renamed_files"></a>[all\_old\_new\_renamed\_files](#output_all_old_new_renamed_files) | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
| all\_old\_new\_renamed\_files\_count | string | Returns the number of `all_old_new_renamed_files` | | <a name="output_all_old_new_renamed_files_count"></a>[all\_old\_new\_renamed\_files\_count](#output_all_old_new_renamed_files_count) | string | Returns the number of `all_old_new_renamed_files` |
| 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)*. | | <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has changed. i.e. <br>*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) | | <a name="output_any_deleted"></a>[any\_deleted](#output_any_deleted) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been deleted. <br>(D) |
| 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)*. | | <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been modified. <br>i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
| copied\_files | string | Returns only files that are <br>Copied (C). | | <a name="output_copied_files"></a>[copied\_files](#output_copied_files) | string | Returns only files that are <br>Copied (C). |
| copied\_files\_count | string | Returns the number of `copied_files` | | <a name="output_copied_files_count"></a>[copied\_files\_count](#output_copied_files_count) | string | Returns the number of `copied_files` |
| deleted\_files | string | Returns only files that are <br>Deleted (D). | | <a name="output_deleted_files"></a>[deleted\_files](#output_deleted_files) | string | Returns only files that are <br>Deleted (D). |
| deleted\_files\_count | string | Returns the number of `deleted_files` | | <a name="output_deleted_files_count"></a>[deleted\_files\_count](#output_deleted_files_count) | string | Returns the number of `deleted_files` |
| modified\_files | string | Returns only files that are <br>Modified (M). | | <a name="output_modified_files"></a>[modified\_files](#output_modified_files) | string | Returns only files that are <br>Modified (M). |
| modified\_files\_count | string | Returns the number of `modified_files` | | <a name="output_modified_files_count"></a>[modified\_files\_count](#output_modified_files_count) | string | Returns the number of `modified_files` |
| 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)*. | | <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has changed. i.e. *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) | | <a name="output_only_deleted"></a>[only\_deleted](#output_only_deleted) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been deleted. (D) |
| only\_modified | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been modified. (ACMRD). | | <a name="output_only_modified"></a>[only\_modified](#output_only_modified) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>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)*. | | <a name="output_other_changed_files"></a>[other\_changed\_files](#output_other_changed_files) | string | Returns all other changed files <br>not listed in the files <br>input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*. |
| other\_changed\_files\_count | string | Returns the number of `other_changed_files` | | <a name="output_other_changed_files_count"></a>[other\_changed\_files\_count](#output_other_changed_files_count) | string | Returns the number of `other_changed_files` |
| other\_deleted\_files | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* | | <a name="output_other_deleted_files"></a>[other\_deleted\_files](#output_other_deleted_files) | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* |
| other\_deleted\_files\_count | string | Returns the number of `other_deleted_files` | | <a name="output_other_deleted_files_count"></a>[other\_deleted\_files\_count](#output_other_deleted_files_count) | string | Returns the number of `other_deleted_files` |
| other\_modified\_files | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* | | <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
| other\_modified\_files\_count | string | Returns the number of `other_modified_files` | | <a name="output_other_modified_files_count"></a>[other\_modified\_files\_count](#output_other_modified_files_count) | string | Returns the number of `other_modified_files` |
| renamed\_files | string | Returns only files that are <br>Renamed (R). | | <a name="output_renamed_files"></a>[renamed\_files](#output_renamed_files) | string | Returns only files that are <br>Renamed (R). |
| renamed\_files\_count | string | Returns the number of `renamed_files` | | <a name="output_renamed_files_count"></a>[renamed\_files\_count](#output_renamed_files_count) | string | Returns the number of `renamed_files` |
| type\_changed\_files | string | Returns only files that have <br>their file type changed (T). | | <a name="output_type_changed_files"></a>[type\_changed\_files](#output_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` | | <a name="output_type_changed_files_count"></a>[type\_changed\_files\_count](#output_type_changed_files_count) | string | Returns the number of `type_changed_files` |
| unknown\_files | string | Returns only files that are <br>Unknown (X). | | <a name="output_unknown_files"></a>[unknown\_files](#output_unknown_files) | string | Returns only files that are <br>Unknown (X). |
| unknown\_files\_count | string | Returns the number of `unknown_files` | | <a name="output_unknown_files_count"></a>[unknown\_files\_count](#output_unknown_files_count) | string | Returns the number of `unknown_files` |
| unmerged\_files | string | Returns only files that are <br>Unmerged (U). | | <a name="output_unmerged_files"></a>[unmerged\_files](#output_unmerged_files) | string | Returns only files that are <br>Unmerged (U). |
| unmerged\_files\_count | string | Returns the number of `unmerged_files` | | <a name="output_unmerged_files_count"></a>[unmerged\_files\_count](#output_unmerged_files_count) | string | Returns the number of `unmerged_files` |
<!-- AUTO-DOC-OUTPUT:END --> <!-- AUTO-DOC-OUTPUT:END -->
## Inputs ## Inputs ⚙️
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section --> <!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION | | INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|----------------------------------------------|--------|----------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| api\_url | string | false | `"${{ github.api_url }}"` | Github API URL. | | <a name="input_api_url"></a>[api\_url](#input_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 | | <a name="input_base_sha"></a>[base\_sha](#input_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. | | <a name="input_diff_relative"></a>[diff\_relative](#input_diff_relative) | string | false | `"true"` | Exclude changes outside the current <br>directory and show path names <br>relative to it. **NOTE:** This <br>requires you to specify the <br>top level directory via the <br>`path` input. |
| dir\_names | string | false | `"false"` | Output unique changed directories instead <br>of filenames. **NOTE:** This returns <br>`.` for changed files located <br>in the current working directory <br>which defaults to `$GITHUB_WORKSPACE`. | | <a name="input_dir_names"></a>[dir\_names](#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`. | | <a name="input_dir_names_exclude_current_dir"></a>[dir\_names\_exclude\_current\_dir](#input_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\_include\_files | string | false | | Include files in the output <br>when `dir_names` is set to <br>`true`. **NOTE:** This returns only <br>the matching files and also <br>the directory names. | | <a name="input_dir_names_include_files"></a>[dir\_names\_include\_files](#input_dir_names_include_files) | string | false | | Include files in the output <br>when `dir_names` is set to <br>`true`. **NOTE:** This returns only <br>the matching files and also <br>the directory names. |
| dir\_names\_include\_files\_separator | string | false | `"\n"` | Separator used to split the <br>`dir_names_include_files` input | | <a name="input_dir_names_include_files_separator"></a>[dir\_names\_include\_files\_separator](#input_dir_names_include_files_separator) | string | false | `"\n"` | Separator used to split the <br>`dir_names_include_files` input |
| 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`. | | <a name="input_dir_names_max_depth"></a>[dir\_names\_max\_depth](#input_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. | | <a name="input_escape_json"></a>[escape\_json](#input_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. | | <a name="input_fail_on_initial_diff_error"></a>[fail\_on\_initial\_diff\_error](#input_fail_on_initial_diff_error) | string | false | `"false"` | Fail when the initial diff <br>fails. |
| 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. | | <a name="input_fail_on_submodule_diff_error"></a>[fail\_on\_submodule\_diff\_error](#input_fail_on_submodule_diff_error) | string | false | `"false"` | Fail when the submodule diff <br>fails. |
| files\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files` input. | | <a name="input_fetch_additional_submodule_history"></a>[fetch\_additional\_submodule\_history](#input_fetch_additional_submodule_history) | string | false | `"false"` | Fetch additional history for submodules. |
| files\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input | | <a name="input_fetch_depth"></a>[fetch\_depth](#input_fetch_depth) | string | false | `"50"` | Depth of additional branch history <br>fetched. **NOTE**: This can be <br>adjusted to resolve errors with <br>insufficient history. |
| files\_ignore | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. | | <a name="input_files"></a>[files](#input_files) | string | false | | File and directory patterns used <br>to detect changes (Defaults to the entire repo if unset) **NOTE:** <br>Multiline file/directory patterns should not <br>include quotes. |
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore` input | | <a name="input_files_from_source_file"></a>[files\_from\_source\_file](#input_files_from_source_file) | string | false | | Source file(s) used to populate <br>the `files` input. |
| files\_ignore\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input | | <a name="input_files_from_source_file_separator"></a>[files\_from\_source\_file\_separator](#input_files_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_from_source_file` input |
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore` input | | <a name="input_files_ignore"></a>[files\_ignore](#input_files_ignore) | string | false | | Ignore changes to these file(s) <br>**NOTE:** Multiline file/directory patterns should <br>not include quotes. |
| files\_ignore\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>ignore changes | | <a name="input_files_ignore_from_source_file"></a>[files\_ignore\_from\_source\_file](#input_files_ignore_from_source_file) | string | false | | Source file(s) used to populate <br>the `files_ignore` input |
| files\_ignore\_yaml\_from\_source\_file | string | false | | Source file(s) used to populate <br>the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) | | <a name="input_files_ignore_from_source_file_separator"></a>[files\_ignore\_from\_source\_file\_separator](#input_files_ignore_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_ignore_from_source_file` input |
| files\_ignore\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_ignore_yaml_from_source_file` input | | <a name="input_files_ignore_separator"></a>[files\_ignore\_separator](#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 | | <a name="input_files_ignore_yaml"></a>[files\_ignore\_yaml](#input_files_ignore_yaml) | string | false | | YAML used to define a <br>set of file patterns to <br>ignore changes |
| files\_yaml | string | false | | YAML used to define a <br>set of file patterns to <br>detect changes | | <a name="input_files_ignore_yaml_from_source_file"></a>[files\_ignore\_yaml\_from\_source\_file](#input_files_ignore_yaml_from_source_file) | string | false | | Source file(s) used to populate <br>the `files_ignore_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
| files\_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) | | <a name="input_files_ignore_yaml_from_source_file_separator"></a>[files\_ignore\_yaml\_from\_source\_file\_separator](#input_files_ignore_yaml_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_ignore_yaml_from_source_file` input |
| files\_yaml\_from\_source\_file\_separator | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` input | | <a name="input_files_separator"></a>[files\_separator](#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). | | <a name="input_files_yaml"></a>[files\_yaml](#input_files_yaml) | string | false | | YAML used to define a <br>set of file patterns to <br>detect changes |
| json | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. | | <a name="input_files_yaml_from_source_file"></a>[files\_yaml\_from\_source\_file](#input_files_yaml_from_source_file) | string | false | | Source file(s) used to populate <br>the `files_yaml` input. [Example](https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml) |
| old\_new\_files\_separator | string | false | `" "` | Split character for old and <br>new renamed filename pairs. | | <a name="input_files_yaml_from_source_file_separator"></a>[files\_yaml\_from\_source\_file\_separator](#input_files_yaml_from_source_file_separator) | string | false | `"\n"` | Separator used to split the <br>`files_yaml_from_source_file` input |
| old\_new\_separator | string | false | `","` | Split character for old and <br>new filename pairs. | | <a name="input_include_all_old_new_renamed_files"></a>[include\_all\_old\_new\_renamed\_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). |
| output\_dir | string | false | `".github/outputs"` | Directory to store output files. | | <a name="input_json"></a>[json](#input_json) | string | false | `"false"` | Output list of changed files <br>in a JSON formatted string <br>which can be used for <br>matrix jobs. |
| output\_renamed\_files\_as\_deleted\_and\_added | string | false | `"false"` | Output renamed files as deleted <br>and added files. | | <a name="input_old_new_files_separator"></a>[old\_new\_files\_separator](#input_old_new_files_separator) | string | false | `" "` | Split character for old and <br>new renamed filename pairs. |
| path | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. | | <a name="input_old_new_separator"></a>[old\_new\_separator](#input_old_new_separator) | string | false | `","` | Split character for old and <br>new filename pairs. |
| 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` | | <a name="input_output_dir"></a>[output\_dir](#input_output_dir) | string | false | `".github/outputs"` | Directory to store output files. |
| recover\_deleted\_files | string | false | `"false"` | Recover deleted files. | | <a name="input_output_renamed_files_as_deleted_and_added"></a>[output\_renamed\_files\_as\_deleted\_and\_added](#input_output_renamed_files_as_deleted_and_added) | string | false | `"false"` | Output renamed files as deleted <br>and added files. |
| recover\_deleted\_files\_to\_destination | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. | | <a name="input_path"></a>[path](#input_path) | string | false | `"."` | Specify a relative path under <br>`$GITHUB_WORKSPACE` to locate the repository. |
| recover\_files | string | false | | File and directory patterns used <br>to recover deleted files, defaults <br>to the patterns provided via <br>the `files`, `files_from_source_file`, `files_ignore` and <br>`files_ignore_from_source_file` inputs or all deleted <br>files if no patterns are <br>provided. | | <a name="input_quotepath"></a>[quotepath](#input_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\_files\_ignore | string | false | | File and directory patterns to <br>ignore when recovering deleted files. | | <a name="input_recover_deleted_files"></a>[recover\_deleted\_files](#input_recover_deleted_files) | string | false | `"false"` | Recover deleted files. |
| recover\_files\_ignore\_separator | string | false | `"\n"` | Separator used to split the <br>`recover_files_ignore` input | | <a name="input_recover_deleted_files_to_destination"></a>[recover\_deleted\_files\_to\_destination](#input_recover_deleted_files_to_destination) | string | false | | Recover deleted files to a <br>new destination directory, defaults to <br>the original location. |
| recover\_files\_separator | string | false | `"\n"` | Separator used to split the <br>`recover_files` input | | <a name="input_recover_files"></a>[recover\_files](#input_recover_files) | string | false | | File and directory patterns used <br>to recover deleted files, defaults <br>to the patterns provided via <br>the `files`, `files_from_source_file`, `files_ignore` and <br>`files_ignore_from_source_file` inputs or all deleted <br>files if no patterns are <br>provided. |
| separator | string | false | `" "` | Split character for output strings | | <a name="input_recover_files_ignore"></a>[recover\_files\_ignore](#input_recover_files_ignore) | string | false | | File and directory patterns to <br>ignore when recovering deleted files. |
| sha | string | false | | Specify a different commit SHA <br>used for comparing changes | | <a name="input_recover_files_ignore_separator"></a>[recover\_files\_ignore\_separator](#input_recover_files_ignore_separator) | string | false | `"\n"` | Separator used to split the <br>`recover_files_ignore` input |
| since | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. | | <a name="input_recover_files_separator"></a>[recover\_files\_separator](#input_recover_files_separator) | string | false | `"\n"` | Separator used to split the <br>`recover_files` input |
| 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. | | <a name="input_separator"></a>[separator](#input_separator) | string | false | `" "` | Split character for output strings |
| skip\_initial\_fetch | string | false | `"false"` | Skip the initial fetch to <br>improve performance for shallow repositories. <br>**NOTE**: This could lead to <br>errors with missing history and <br>the intended use is limited <br>to when you've fetched the <br>history necessary to perform the <br>diff. | | <a name="input_sha"></a>[sha](#input_sha) | string | false | | Specify a different commit SHA <br>used for comparing changes |
| token | string | false | `"${{ github.token }}"` | Github token used to fetch <br>changed files from Github's API. | | <a name="input_since"></a>[since](#input_since) | string | false | | Get changed files for commits <br>whose timestamp is older than <br>the given time. |
| until | string | false | | Get changed files for commits <br>whose timestamp is earlier than <br>the given time. | | <a name="input_since_last_remote_commit"></a>[since\_last\_remote\_commit](#input_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. |
| 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`. | | <a name="input_skip_initial_fetch"></a>[skip\_initial\_fetch](#input_skip_initial_fetch) | string | false | `"false"` | Skip the initial fetch to <br>improve performance for shallow repositories. <br>**NOTE**: This could lead to <br>errors with missing history and <br>the intended use is limited <br>to when you've fetched the <br>history necessary to perform the <br>diff. |
| <a name="input_token"></a>[token](#input_token) | string | false | `"${{ github.token }}"` | Github token used to fetch <br>changed files from Github's API. |
| <a name="input_until"></a>[until](#input_until) | string | false | | Get changed files for commits <br>whose timestamp is earlier than <br>the given time. |
| <a name="input_write_output_files"></a>[write\_output\_files](#input_write_output_files) | string | false | `"false"` | Write outputs to the `output_dir` <br>defaults to `.github/outputs` folder. **NOTE:** <br>This creates a `.txt` file <br>by default and a `.json` <br>file if `json` is set <br>to `true`. |
<!-- AUTO-DOC-INPUT:END --> <!-- AUTO-DOC-INPUT:END -->
## Versioning ## Versioning 🏷️
This GitHub Action follows the principles of [Semantic Versioning](https://semver.org) for versioning releases. This GitHub Action follows the principles of [Semantic Versioning](https://semver.org) for versioning releases.
@@ -414,7 +419,7 @@ The format of the version string is as follows:
* patch: indicates bug fixes or other small changes that are backward compatible. * patch: indicates bug fixes or other small changes that are backward compatible.
## Examples ## Examples 📄
<details> <details>
<summary>Get all changed files in the current branch</summary> <summary>Get all changed files in the current branch</summary>
@@ -423,7 +428,7 @@ The format of the version string is as follows:
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
... ...
``` ```
@@ -436,7 +441,7 @@ The format of the version string is as follows:
... ...
- name: Get all changed files and use a comma separator in the output - name: Get all changed files and use a comma separator in the output
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
separator: "," separator: ","
... ...
@@ -453,7 +458,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
- name: List all added files - name: List all added files
run: | run: |
@@ -474,7 +479,7 @@ See [outputs](#outputs) for a list of all available outputs.
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
- name: Run a step if my-file.txt was modified - name: Run a step if my-file.txt was modified
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt') if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
@@ -534,7 +539,7 @@ See [outputs](#outputs) for a list of all available outputs.
... ...
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -557,7 +562,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files - name: Get changed files
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
files: | files: |
my-file.txt my-file.txt
@@ -604,7 +609,7 @@ See [outputs](#outputs) for a list of all available outputs.
... ...
- name: Get changed files using a source file or list of file(s) to populate to files input. - name: Get changed files using a source file or list of file(s) to populate to files input.
id: changed-files-specific-source-file id: changed-files-specific-source-file
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
files_from_source_file: test/changed-files-list.txt files_from_source_file: test/changed-files-list.txt
... ...
@@ -621,7 +626,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files. - name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files.
id: changed-files-specific-source-file-and-specify-files id: changed-files-specific-source-file-and-specify-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
files_from_source_file: | files_from_source_file: |
test/changed-files-list.txt test/changed-files-list.txt
@@ -642,7 +647,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files using a different SHA - name: Get changed files using a different SHA
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
sha: ${{ github.event.pull_request.head.sha }} sha: ${{ github.event.pull_request.head.sha }}
... ...
@@ -659,7 +664,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed files using a different base SHA - name: Get changed files using a different base SHA
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
base_sha: ${{ github.event.pull_request.base.sha }} base_sha: ${{ github.event.pull_request.base.sha }}
... ...
@@ -685,17 +690,17 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Get changed files - name: Get changed files
id: changed-files id: changed-files
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
- name: Get changed files in the .github folder - name: Get changed files in the .github folder
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
base_sha: ${{ steps.get-base-sha.outputs.base_sha }} base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
files: .github/** files: .github/**
@@ -718,14 +723,14 @@ See [inputs](#inputs) for more information.
```yaml ```yaml
... ...
- name: Checkout into dir1 - name: Checkout into dir1
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
path: dir1 path: dir1
- name: Run changed-files with defaults in dir1 - name: Run changed-files with defaults in dir1
id: changed-files-for-dir1 id: changed-files-for-dir1
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
path: dir1 path: dir1
@@ -748,7 +753,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Run changed-files with quotepath disabled - name: Run changed-files with quotepath disabled
id: changed-files-quotepath id: changed-files-quotepath
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
quotepath: "false" quotepath: "false"
@@ -787,7 +792,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with the commit of the last successful test workflow run - name: Run changed-files with the commit of the last successful test workflow run
id: changed-files-base-sha-push id: changed-files-base-sha-push
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }} base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
... ...
@@ -814,7 +819,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with the commit of the last successful test workflow run on the main branch - name: Run changed-files with the commit of the last successful test workflow run on the main branch
id: changed-files-base-sha-pull-request id: changed-files-base-sha-pull-request
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }} base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
... ...
@@ -840,7 +845,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Run changed-files with dir_names - name: Run changed-files with dir_names
id: changed-files-dir-names id: changed-files-dir-names
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
dir_names: "true" dir_names: "true"
... ...
@@ -857,7 +862,7 @@ See [inputs](#inputs) for more information.
... ...
- name: Run changed-files with JSON output - name: Run changed-files with JSON output
id: changed-files-json id: changed-files-json
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
json: "true" json: "true"
... ...
@@ -874,13 +879,13 @@ See [inputs](#inputs) for more information.
... ...
- name: Get changed-files since 2022-08-19 - name: Get changed-files since 2022-08-19
id: changed-files-since id: changed-files-since
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
since: "2022-08-19" since: "2022-08-19"
- name: Get changed-files until 2022-08-20 - name: Get changed-files until 2022-08-20
id: changed-files-until id: changed-files-until
uses: tj-actions/changed-files@v37 uses: tj-actions/changed-files@v38
with: with:
until: "2022-08-20" until: "2022-08-20"
... ...
@@ -890,7 +895,9 @@ See [inputs](#inputs) for more information.
</details> </details>
## Real-world usage ## Real-world usage 🌐
### Open source projects 📦
* [vitejs/vite: uses tj-actions/changed-files to automate testing](https://github.com/vitejs/vite/blob/8da04227d6f818a8ad9efc0056101968037c2e36/.github/workflows/ci.yml#L61) * [vitejs/vite: uses tj-actions/changed-files to automate testing](https://github.com/vitejs/vite/blob/8da04227d6f818a8ad9efc0056101968037c2e36/.github/workflows/ci.yml#L61)
@@ -908,11 +915,15 @@ See [inputs](#inputs) for more information.
* [nhost: uses tj-actions/changed-files to automate testing based on changes detected](https://github.com/nhost/nhost/blob/main/.github/workflows/ci.yaml#L44-L48) * [nhost: uses tj-actions/changed-files to automate testing based on changes detected](https://github.com/nhost/nhost/blob/main/.github/workflows/ci.yaml#L44-L48)
![image](https://github.com/tj-actions/changed-files/assets/17484350/23767413-4c51-42fb-ab1c-39ef72c44904) * [qmk\_firmware uses tj-actions/changed-files to run linters](https://github.com/qmk/qmk_firmware/blob/7a737235ffd49c32d2c5561e8fe53fd96baa7f96/.github/workflows/lint.yml#L30)
And many more... And many more...
## Known Limitation ### Scalability Example 📈
![image](https://github.com/tj-actions/changed-files/assets/17484350/23767413-4c51-42fb-ab1c-39ef72c44904)
## Known Limitation ⚠️
> **Warning** > **Warning**
> >
@@ -921,7 +932,7 @@ And many more...
> >
> ![Screen Shot 2021-10-23 at 9 37 34 AM](https://user-images.githubusercontent.com/17484350/138558767-b13c90bf-a1ae-4e86-9520-70a6a4624f41.png) > ![Screen Shot 2021-10-23 at 9 37 34 AM](https://user-images.githubusercontent.com/17484350/138558767-b13c90bf-a1ae-4e86-9520-70a6a4624f41.png)
## Migration guide ## Migration guide 🔄
With the switch from using grep's Extended regex to match files to the natively supported workflow glob pattern matching syntax introduced in [v13](https://github.com/tj-actions/changed-files/releases/tag/v13) you'll need to modify patterns used to match `files`. With the switch from using grep's Extended regex to match files to the natively supported workflow glob pattern matching syntax introduced in [v13](https://github.com/tj-actions/changed-files/releases/tag/v13) you'll need to modify patterns used to match `files`.
@@ -941,7 +952,7 @@ With the switch from using grep's Extended regex to match files to the natively
* Free software: [MIT license](LICENSE) * Free software: [MIT license](LICENSE)
## Credits ## Credits 👏
This package was created with [cookiecutter-action](https://github.com/tj-actions/cookiecutter-action). This package was created with [cookiecutter-action](https://github.com/tj-actions/cookiecutter-action).
@@ -952,7 +963,7 @@ This package was created with [cookiecutter-action](https://github.com/tj-action
* [tj-actions/demo3](https://github.com/tj-actions/demo3) * [tj-actions/demo3](https://github.com/tj-actions/demo3)
* [tj-actions/release-tagger](https://github.com/tj-actions/release-tagger) * [tj-actions/release-tagger](https://github.com/tj-actions/release-tagger)
## Report Bugs ## Report Bugs 🐛
Report bugs at https://github.com/tj-actions/changed-files/issues. Report bugs at https://github.com/tj-actions/changed-files/issues.

View File

@@ -136,6 +136,10 @@ inputs:
description: "Skip the initial fetch to improve performance for shallow repositories. **NOTE**: This could lead to errors with missing history and the intended use is limited to when you've fetched the history necessary to perform the diff." description: "Skip the initial fetch to improve performance for shallow repositories. **NOTE**: This could lead to errors with missing history and the intended use is limited to when you've fetched the history necessary to perform the diff."
required: false required: false
default: "false" default: "false"
fetch_additional_submodule_history:
description: "Fetch additional history for submodules."
required: false
default: "false"
since_last_remote_commit: since_last_remote_commit:
description: "Use the last commit on the remote branch as the `base_sha`. Defaults to the last non-merge commit on the target branch for pull request events and the previous remote commit of the current branch for push events." description: "Use the last commit on the remote branch as the `base_sha`. Defaults to the last non-merge commit on the target branch for pull request events and the previous remote commit of the current branch for push events."
required: false required: false
@@ -184,6 +188,14 @@ inputs:
description: "Github API URL." description: "Github API URL."
required: false required: false
default: ${{ github.api_url }} default: ${{ github.api_url }}
fail_on_initial_diff_error:
description: "Fail when the initial diff fails."
required: false
default: "false"
fail_on_submodule_diff_error:
description: "Fail when the submodule diff fails."
required: false
default: "false"
outputs: outputs:
added_files: added_files:
@@ -260,7 +272,7 @@ outputs:
description: "Returns the number of `other_deleted_files`" description: "Returns the number of `other_deleted_files`"
runs: runs:
using: 'node16' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'
branding: branding:

316
dist/index.js generated vendored
View File

@@ -82,6 +82,11 @@ const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, s
sha2: submoduleShaResult.currentSha, sha2: submoduleShaResult.currentSha,
diff diff
}))) { }))) {
let message = `Unable to use three dot diff for: ${submodulePath} submodule. Falling back to two dot diff. You can set 'fetch_additional_submodule_history: true' to fetch additional submodule history in order to use three dot diff`;
if (inputs.fetchSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`;
}
core.info(message);
diff = '..'; diff = '..';
} }
const submoduleRenamedFiles = yield (0, utils_1.gitRenamedFiles)({ const submoduleRenamedFiles = yield (0, utils_1.gitRenamedFiles)({
@@ -120,13 +125,14 @@ var ChangeTypeEnum;
ChangeTypeEnum["Unmerged"] = "U"; ChangeTypeEnum["Unmerged"] = "U";
ChangeTypeEnum["Unknown"] = "X"; ChangeTypeEnum["Unknown"] = "X";
})(ChangeTypeEnum || (exports.ChangeTypeEnum = ChangeTypeEnum = {})); })(ChangeTypeEnum || (exports.ChangeTypeEnum = ChangeTypeEnum = {}));
const getAllDiffFiles = ({ workingDirectory, hasSubmodule, diffResult, submodulePaths, outputRenamedFilesAsDeletedAndAdded }) => __awaiter(void 0, void 0, void 0, function* () { const getAllDiffFiles = ({ workingDirectory, hasSubmodule, diffResult, submodulePaths, outputRenamedFilesAsDeletedAndAdded, fetchSubmoduleHistory, failOnInitialDiffError, failOnSubmoduleDiffError }) => __awaiter(void 0, void 0, void 0, function* () {
const files = yield (0, utils_1.getAllChangedFiles)({ const files = yield (0, utils_1.getAllChangedFiles)({
cwd: workingDirectory, cwd: workingDirectory,
sha1: diffResult.previousSha, sha1: diffResult.previousSha,
sha2: diffResult.currentSha, sha2: diffResult.currentSha,
diff: diffResult.diff, diff: diffResult.diff,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
failOnInitialDiffError
}); });
if (hasSubmodule) { if (hasSubmodule) {
for (const submodulePath of submodulePaths) { for (const submodulePath of submodulePaths) {
@@ -146,6 +152,11 @@ const getAllDiffFiles = ({ workingDirectory, hasSubmodule, diffResult, submodule
sha2: submoduleShaResult.currentSha, sha2: submoduleShaResult.currentSha,
diff diff
}))) { }))) {
let message = `Set 'fetch_additional_submodule_history: true' to fetch additional submodule history for: ${submodulePath}`;
if (fetchSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`;
}
core.warning(message);
diff = '..'; diff = '..';
} }
const submoduleFiles = yield (0, utils_1.getAllChangedFiles)({ const submoduleFiles = yield (0, utils_1.getAllChangedFiles)({
@@ -155,7 +166,8 @@ const getAllDiffFiles = ({ workingDirectory, hasSubmodule, diffResult, submodule
diff, diff,
isSubmodule: true, isSubmodule: true,
parentDir: submodulePath, parentDir: submodulePath,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
failOnSubmoduleDiffError
}); });
for (const changeType of Object.keys(submoduleFiles)) { for (const changeType of Object.keys(submoduleFiles)) {
if (!files[changeType]) { if (!files[changeType]) {
@@ -208,14 +220,9 @@ const getChangeTypeFiles = ({ inputs, changedFiles, changeTypes }) => __awaiter(
const files = [ const files = [
...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes })) ...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes }))
].filter(Boolean); ].filter(Boolean);
if (inputs.json) { const paths = inputs.json ? files : files.join(inputs.separator);
return { return {
paths: (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }), paths,
count: files.length.toString()
};
}
return {
paths: files.join(inputs.separator),
count: files.length.toString() count: files.length.toString()
}; };
}); });
@@ -236,14 +243,9 @@ const getAllChangeTypeFiles = ({ inputs, changedFiles }) => __awaiter(void 0, vo
const files = [ const files = [
...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles })) ...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles }))
].filter(Boolean); ].filter(Boolean);
if (inputs.json) { const paths = inputs.json ? files : files.join(inputs.separator);
return { return {
paths: (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }), paths,
count: files.length.toString()
};
}
return {
paths: files.join(inputs.separator),
count: files.length.toString() count: files.length.toString()
}; };
}); });
@@ -361,6 +363,9 @@ const utils_1 = __nccwpck_require__(918);
const getOutputKey = (key, outputPrefix) => { const getOutputKey = (key, outputPrefix) => {
return outputPrefix ? `${outputPrefix}_${key}` : key; return outputPrefix ? `${outputPrefix}_${key}` : key;
}; };
const getArrayFromPaths = (paths, inputs) => {
return Array.isArray(paths) ? paths : paths.split(inputs.separator);
};
const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, filePatterns = [], outputPrefix = '' }) => __awaiter(void 0, void 0, void 0, function* () { const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, filePatterns = [], outputPrefix = '' }) => __awaiter(void 0, void 0, void 0, function* () {
const addedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const addedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -371,12 +376,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('added_files', outputPrefix), key: getOutputKey('added_files', outputPrefix),
value: addedFiles.paths, value: addedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('added_files_count', outputPrefix), key: getOutputKey('added_files_count', outputPrefix),
value: addedFiles.count, value: addedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const copiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const copiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -387,12 +396,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('copied_files', outputPrefix), key: getOutputKey('copied_files', outputPrefix),
value: copiedFiles.paths, value: copiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('copied_files_count', outputPrefix), key: getOutputKey('copied_files_count', outputPrefix),
value: copiedFiles.count, value: copiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const modifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const modifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -403,12 +416,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('modified_files', outputPrefix), key: getOutputKey('modified_files', outputPrefix),
value: modifiedFiles.paths, value: modifiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('modified_files_count', outputPrefix), key: getOutputKey('modified_files_count', outputPrefix),
value: modifiedFiles.count, value: modifiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const renamedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const renamedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -419,12 +436,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('renamed_files', outputPrefix), key: getOutputKey('renamed_files', outputPrefix),
value: renamedFiles.paths, value: renamedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('renamed_files_count', outputPrefix), key: getOutputKey('renamed_files_count', outputPrefix),
value: renamedFiles.count, value: renamedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const typeChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const typeChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -435,12 +456,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('type_changed_files', outputPrefix), key: getOutputKey('type_changed_files', outputPrefix),
value: typeChangedFiles.paths, value: typeChangedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('type_changed_files_count', outputPrefix), key: getOutputKey('type_changed_files_count', outputPrefix),
value: typeChangedFiles.count, value: typeChangedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const unmergedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const unmergedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -451,12 +476,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('unmerged_files', outputPrefix), key: getOutputKey('unmerged_files', outputPrefix),
value: unmergedFiles.paths, value: unmergedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('unmerged_files_count', outputPrefix), key: getOutputKey('unmerged_files_count', outputPrefix),
value: unmergedFiles.count, value: unmergedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const unknownFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const unknownFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -467,12 +496,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('unknown_files', outputPrefix), key: getOutputKey('unknown_files', outputPrefix),
value: unknownFiles.paths, value: unknownFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('unknown_files_count', outputPrefix), key: getOutputKey('unknown_files_count', outputPrefix),
value: unknownFiles.count, value: unknownFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const allChangedAndModifiedFiles = yield (0, changedFiles_1.getAllChangeTypeFiles)({ const allChangedAndModifiedFiles = yield (0, changedFiles_1.getAllChangeTypeFiles)({
inputs, inputs,
@@ -482,12 +515,16 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_and_modified_files', outputPrefix), key: getOutputKey('all_changed_and_modified_files', outputPrefix),
value: allChangedAndModifiedFiles.paths, value: allChangedAndModifiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix), key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
value: allChangedAndModifiedFiles.count, value: allChangedAndModifiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const allChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -503,17 +540,23 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_files', outputPrefix), key: getOutputKey('all_changed_files', outputPrefix),
value: allChangedFiles.paths, value: allChangedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_changed_files_count', outputPrefix), key: getOutputKey('all_changed_files_count', outputPrefix),
value: allChangedFiles.count, value: allChangedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('any_changed', outputPrefix), key: getOutputKey('any_changed', outputPrefix),
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0, value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
const allOtherChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allOtherChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -526,26 +569,34 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
] ]
}); });
core.debug(`All other changed files: ${JSON.stringify(allOtherChangedFiles)}`); core.debug(`All other changed files: ${JSON.stringify(allOtherChangedFiles)}`);
const otherChangedFiles = allOtherChangedFiles.paths const allOtherChangedFilesPaths = getArrayFromPaths(allOtherChangedFiles.paths, inputs);
.split(inputs.separator) const allChangedFilesPaths = getArrayFromPaths(allChangedFiles.paths, inputs);
.filter((filePath) => !allChangedFiles.paths.split(inputs.separator).includes(filePath)); const otherChangedFiles = allOtherChangedFilesPaths.filter((filePath) => !allChangedFilesPaths.includes(filePath));
const onlyChanged = otherChangedFiles.length === 0 && const onlyChanged = otherChangedFiles.length === 0 &&
allChangedFiles.paths.length > 0 && allChangedFiles.paths.length > 0 &&
filePatterns.length > 0; filePatterns.length > 0;
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('only_changed', outputPrefix), key: getOutputKey('only_changed', outputPrefix),
value: onlyChanged, value: onlyChanged,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('other_changed_files', outputPrefix), key: getOutputKey('other_changed_files', outputPrefix),
value: otherChangedFiles.join(inputs.separator), value: inputs.json
inputs ? otherChangedFiles
: otherChangedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('other_changed_files_count', outputPrefix), key: getOutputKey('other_changed_files_count', outputPrefix),
value: otherChangedFiles.length.toString(), value: otherChangedFiles.length.toString(),
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const allModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -562,17 +613,23 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_modified_files', outputPrefix), key: getOutputKey('all_modified_files', outputPrefix),
value: allModifiedFiles.paths, value: allModifiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('all_modified_files_count', outputPrefix), key: getOutputKey('all_modified_files_count', outputPrefix),
value: allModifiedFiles.count, value: allModifiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('any_modified', outputPrefix), key: getOutputKey('any_modified', outputPrefix),
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0, value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
const allOtherModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allOtherModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -585,26 +642,34 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
changedFiles_1.ChangeTypeEnum.Deleted changedFiles_1.ChangeTypeEnum.Deleted
] ]
}); });
const otherModifiedFiles = allOtherModifiedFiles.paths const allOtherModifiedFilesPaths = getArrayFromPaths(allOtherModifiedFiles.paths, inputs);
.split(inputs.separator) const allModifiedFilesPaths = getArrayFromPaths(allModifiedFiles.paths, inputs);
.filter((filePath) => !allModifiedFiles.paths.split(inputs.separator).includes(filePath)); const otherModifiedFiles = allOtherModifiedFilesPaths.filter((filePath) => !allModifiedFilesPaths.includes(filePath));
const onlyModified = otherModifiedFiles.length === 0 && const onlyModified = otherModifiedFiles.length === 0 &&
allModifiedFiles.paths.length > 0 && allModifiedFiles.paths.length > 0 &&
filePatterns.length > 0; filePatterns.length > 0;
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('only_modified', outputPrefix), key: getOutputKey('only_modified', outputPrefix),
value: onlyModified, value: onlyModified,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('other_modified_files', outputPrefix), key: getOutputKey('other_modified_files', outputPrefix),
value: otherModifiedFiles.join(inputs.separator), value: inputs.json
inputs ? otherModifiedFiles
: otherModifiedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('other_modified_files_count', outputPrefix), key: getOutputKey('other_modified_files_count', outputPrefix),
value: otherModifiedFiles.length.toString(), value: otherModifiedFiles.length.toString(),
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
const deletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const deletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
@@ -615,43 +680,57 @@ const setChangedFilesOutput = ({ allDiffFiles, allFilteredDiffFiles, inputs, fil
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('deleted_files', outputPrefix), key: getOutputKey('deleted_files', outputPrefix),
value: deletedFiles.paths, value: deletedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('deleted_files_count', outputPrefix), key: getOutputKey('deleted_files_count', outputPrefix),
value: deletedFiles.count, value: deletedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('any_deleted', outputPrefix), key: getOutputKey('any_deleted', outputPrefix),
value: deletedFiles.paths.length > 0 && filePatterns.length > 0, value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
const allOtherDeletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ const allOtherDeletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({
inputs, inputs,
changedFiles: allDiffFiles, changedFiles: allDiffFiles,
changeTypes: [changedFiles_1.ChangeTypeEnum.Deleted] changeTypes: [changedFiles_1.ChangeTypeEnum.Deleted]
}); });
const otherDeletedFiles = allOtherDeletedFiles.paths const allOtherDeletedFilesPaths = getArrayFromPaths(allOtherDeletedFiles.paths, inputs);
.split(inputs.separator) const deletedFilesPaths = getArrayFromPaths(deletedFiles.paths, inputs);
.filter(filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath)); const otherDeletedFiles = allOtherDeletedFilesPaths.filter(filePath => !deletedFilesPaths.includes(filePath));
const onlyDeleted = otherDeletedFiles.length === 0 && const onlyDeleted = otherDeletedFiles.length === 0 &&
deletedFiles.paths.length > 0 && deletedFiles.paths.length > 0 &&
filePatterns.length > 0; filePatterns.length > 0;
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('only_deleted', outputPrefix), key: getOutputKey('only_deleted', outputPrefix),
value: onlyDeleted, value: onlyDeleted,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('other_deleted_files', outputPrefix), key: getOutputKey('other_deleted_files', outputPrefix),
value: otherDeletedFiles.join(inputs.separator), value: inputs.json
inputs ? otherDeletedFiles
: otherDeletedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: getOutputKey('other_deleted_files_count', outputPrefix), key: getOutputKey('other_deleted_files_count', outputPrefix),
value: otherDeletedFiles.length.toString(), value: otherDeletedFiles.length.toString(),
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}); });
}); });
exports.setChangedFilesOutput = setChangedFilesOutput; exports.setChangedFilesOutput = setChangedFilesOutput;
@@ -753,7 +832,8 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
let targetBranch = env.GITHUB_REF_NAME; let targetBranch = env.GITHUB_REF_NAME;
const currentBranch = targetBranch; const currentBranch = targetBranch;
let initialCommit = false; let initialCommit = false;
if (isShallow && !inputs.skipInitialFetch) { if (!inputs.skipInitialFetch) {
if (isShallow) {
core.info('Repository is shallow, fetching more history...'); core.info('Repository is shallow, fetching more history...');
if (isTag) { if (isTag) {
let sourceBranch = ''; let sourceBranch = '';
@@ -800,6 +880,20 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
}); });
} }
} }
else {
if (hasSubmodule && inputs.fetchSubmoduleHistory) {
yield (0, utils_1.gitFetchSubmodules)({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
});
}
}
}
const currentSha = yield getCurrentSHA({ inputs, workingDirectory }); const currentSha = yield getCurrentSHA({ inputs, workingDirectory });
let previousSha = inputs.baseSha; let previousSha = inputs.baseSha;
const diff = '..'; const diff = '..';
@@ -910,8 +1004,9 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
if (inputs.sinceLastRemoteCommit) { if (inputs.sinceLastRemoteCommit) {
targetBranch = currentBranch; targetBranch = currentBranch;
} }
if (isShallow && !inputs.skipInitialFetch) { if (!inputs.skipInitialFetch) {
core.info('Repository is shallow, fetching more history...'); core.info('Repository is shallow, fetching more history...');
if (isShallow) {
let prFetchExitCode = yield (0, utils_1.gitFetch)({ let prFetchExitCode = yield (0, utils_1.gitFetch)({
cwd: workingDirectory, cwd: workingDirectory,
args: [ args: [
@@ -963,6 +1058,20 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
}); });
} }
} }
}
else {
if (hasSubmodule && inputs.fetchSubmoduleHistory) {
yield (0, utils_1.gitFetchSubmodules)({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
});
}
}
core.info('Completed fetching more history.'); core.info('Completed fetching more history.');
} }
const currentSha = yield getCurrentSHA({ inputs, workingDirectory }); const currentSha = yield getCurrentSHA({ inputs, workingDirectory });
@@ -995,7 +1104,13 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
(previousSha && (previousSha &&
(yield (0, utils_1.verifyCommitSha)({ sha: previousSha, cwd: workingDirectory })) !== (yield (0, utils_1.verifyCommitSha)({ sha: previousSha, cwd: workingDirectory })) !==
0)) { 0)) {
if (github.context.payload.action &&
github.context.payload.action === 'synchronize') {
core.warning('Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.'); core.warning('Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.');
}
else {
core.info(`Unable to locate the remote branch head sha for ${github.context.eventName} (${github.context.payload.action}) events. Falling back to the previous commit in the local history.`);
}
previousSha = yield (0, utils_1.getParentSha)({ previousSha = yield (0, utils_1.getParentSha)({
cwd: workingDirectory cwd: workingDirectory
}); });
@@ -1288,6 +1403,15 @@ const getInputs = () => {
const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', { const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', {
required: false required: false
}); });
const fetchSubmoduleHistory = core.getBooleanInput('fetch_additional_submodule_history', {
required: false
});
const failOnInitialDiffError = core.getBooleanInput('fail_on_initial_diff_error', {
required: false
});
const failOnSubmoduleDiffError = core.getBooleanInput('fail_on_submodule_diff_error', {
required: false
});
const inputs = { const inputs = {
files, files,
filesSeparator, filesSeparator,
@@ -1303,6 +1427,8 @@ const getInputs = () => {
filesIgnoreYaml, filesIgnoreYaml,
filesIgnoreYamlFromSourceFile, filesIgnoreYamlFromSourceFile,
filesIgnoreYamlFromSourceFileSeparator, filesIgnoreYamlFromSourceFileSeparator,
failOnInitialDiffError,
failOnSubmoduleDiffError,
separator, separator,
// Not Supported via REST API // Not Supported via REST API
sha, sha,
@@ -1323,6 +1449,7 @@ const getInputs = () => {
oldNewSeparator, oldNewSeparator,
oldNewFilesSeparator, oldNewFilesSeparator,
skipInitialFetch, skipInitialFetch,
fetchSubmoduleHistory,
// End Not Supported via REST API // End Not Supported via REST API
dirNames, dirNames,
dirNamesExcludeCurrentDir, dirNamesExcludeCurrentDir,
@@ -1496,7 +1623,10 @@ const getChangedFilesFromLocalGit = ({ inputs, env, workingDirectory, filePatter
hasSubmodule, hasSubmodule,
diffResult, diffResult,
submodulePaths, submodulePaths,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
fetchSubmoduleHistory: inputs.fetchSubmoduleHistory,
failOnInitialDiffError: inputs.failOnInitialDiffError,
failOnSubmoduleDiffError: inputs.failOnSubmoduleDiffError
}); });
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`); core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`);
core.info('All Done!'); core.info('All Done!');
@@ -1534,12 +1664,16 @@ const getChangedFilesFromLocalGit = ({ inputs, env, workingDirectory, filePatter
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: 'all_old_new_renamed_files', key: 'all_old_new_renamed_files',
value: allOldNewRenamedFiles.paths, value: allOldNewRenamedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
yield (0, utils_1.setOutput)({ yield (0, utils_1.setOutput)({
key: 'all_old_new_renamed_files_count', key: 'all_old_new_renamed_files_count',
value: allOldNewRenamedFiles.count, value: allOldNewRenamedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}); });
core.info('All Done!'); core.info('All Done!');
core.endGroup(); core.endGroup();
@@ -1596,7 +1730,8 @@ function run() {
'recoverFiles', 'recoverFiles',
'recoverFilesIgnore', 'recoverFilesIgnore',
'includeAllOldNewRenamedFiles', 'includeAllOldNewRenamedFiles',
'skipInitialFetch' 'skipInitialFetch',
'fetchSubmoduleHistory'
]; ];
for (const input of unsupportedInputs) { for (const input of unsupportedInputs) {
if (inputs[input]) { if (inputs[input]) {
@@ -2068,8 +2203,10 @@ exports.gitRenamedFiles = gitRenamedFiles;
* @param isSubmodule - is the repo a submodule * @param isSubmodule - is the repo a submodule
* @param parentDir - parent directory of the submodule * @param parentDir - parent directory of the submodule
* @param outputRenamedFilesAsDeletedAndAdded - output renamed files as deleted and added * @param outputRenamedFilesAsDeletedAndAdded - output renamed files as deleted and added
* @param failOnInitialDiffError - fail if the initial diff fails
* @param failOnSubmoduleDiffError - fail if the submodule diff fails
*/ */
const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parentDir = '', outputRenamedFilesAsDeletedAndAdded = false }) => __awaiter(void 0, void 0, void 0, function* () { const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parentDir = '', outputRenamedFilesAsDeletedAndAdded = false, failOnInitialDiffError = false, failOnSubmoduleDiffError = false }) => __awaiter(void 0, void 0, void 0, function* () {
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', [ const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', [
'diff', 'diff',
'--name-status', '--name-status',
@@ -2091,6 +2228,14 @@ const getAllChangedFiles = ({ cwd, sha1, sha2, diff, isSubmodule = false, parent
[changedFiles_1.ChangeTypeEnum.Unmerged]: [], [changedFiles_1.ChangeTypeEnum.Unmerged]: [],
[changedFiles_1.ChangeTypeEnum.Unknown]: [] [changedFiles_1.ChangeTypeEnum.Unknown]: []
}; };
if (exitCode !== 0) {
if (failOnInitialDiffError && !isSubmodule) {
throw new Error(`Failed to get changed files between: ${sha1}${diff}${sha2}: ${stderr}`);
}
else if (failOnSubmoduleDiffError && isSubmodule) {
throw new Error(`Failed to get changed files for submodule between: ${sha1}${diff}${sha2}: ${stderr}`);
}
}
if (exitCode !== 0) { if (exitCode !== 0) {
if (isSubmodule) { if (isSubmodule) {
core.warning(stderr || core.warning(stderr ||
@@ -2370,7 +2515,7 @@ const getFilePatterns = ({ inputs, workingDirectory }) => __awaiter(void 0, void
else { else {
const pathParts = pattern.split('/'); const pathParts = pattern.split('/');
const lastPart = pathParts[pathParts.length - 1]; const lastPart = pathParts[pathParts.length - 1];
if (!lastPart.includes('.') && !lastPart.includes('*')) { if (!lastPart.includes('.')) {
return `${pattern}/**`; return `${pattern}/**`;
} }
else { else {
@@ -2508,12 +2653,17 @@ const getRecoverFilePatterns = ({ inputs }) => {
return filePatterns.filter(Boolean); return filePatterns.filter(Boolean);
}; };
exports.getRecoverFilePatterns = getRecoverFilePatterns; exports.getRecoverFilePatterns = getRecoverFilePatterns;
const setOutput = ({ key, value, inputs }) => __awaiter(void 0, void 0, void 0, function* () { const setOutput = ({ key, value, writeOutputFiles, outputDir, json = false, shouldEscape = false }) => __awaiter(void 0, void 0, void 0, function* () {
const cleanedValue = value.toString().trim(); let cleanedValue;
if (json) {
cleanedValue = (0, exports.jsonOutput)({ value, shouldEscape });
}
else {
cleanedValue = value.toString().trim();
}
core.setOutput(key, cleanedValue); core.setOutput(key, cleanedValue);
if (inputs.writeOutputFiles) { if (writeOutputFiles) {
const outputDir = inputs.outputDir; const extension = json ? 'json' : 'txt';
const extension = inputs.json ? 'json' : 'txt';
const outputFilePath = path.join(outputDir, `${key}.${extension}`); const outputFilePath = path.join(outputDir, `${key}.${extension}`);
if (!(yield exists(outputDir))) { if (!(yield exists(outputDir))) {
yield fs_1.promises.mkdir(outputDir, { recursive: true }); yield fs_1.promises.mkdir(outputDir, { recursive: true });
@@ -29551,6 +29701,7 @@ exports.Headers = Headers;
exports.Request = Request; exports.Request = Request;
exports.Response = Response; exports.Response = Response;
exports.FetchError = FetchError; exports.FetchError = FetchError;
exports.AbortError = AbortError;
/***/ }), /***/ }),
@@ -37957,6 +38108,8 @@ function debug(logLevel, ...messages) {
} }
function warn(logLevel, warning) { function warn(logLevel, warning) {
if (logLevel === 'debug' || logLevel === 'warn') { if (logLevel === 'debug' || logLevel === 'warn') {
// https://github.com/typescript-eslint/typescript-eslint/issues/7478
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
if (typeof process !== 'undefined' && process.emitWarning) if (typeof process !== 'undefined' && process.emitWarning)
process.emitWarning(warning); process.emitWarning(warning);
else else
@@ -38738,7 +38891,7 @@ function stringifyKey(key, jsKey, ctx) {
return ''; return '';
if (typeof jsKey !== 'object') if (typeof jsKey !== 'object')
return String(jsKey); return String(jsKey);
if (identity.isNode(key) && ctx && ctx.doc) { if (identity.isNode(key) && ctx?.doc) {
const strCtx = stringify.createStringifyContext(ctx.doc, {}); const strCtx = stringify.createStringifyContext(ctx.doc, {});
strCtx.anchors = new Set(); strCtx.anchors = new Set();
for (const node of ctx.anchors.keys()) for (const node of ctx.anchors.keys())
@@ -42117,8 +42270,9 @@ function createPairs(schema, iterable, ctx) {
key = keys[0]; key = keys[0];
value = it[key]; value = it[key];
} }
else else {
throw new TypeError(`Expected { key: value } tuple: ${it}`); throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
}
} }
else { else {
key = it; key = it;
@@ -42793,7 +42947,7 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
if (iv.commentBefore) if (iv.commentBefore)
reqNewline = true; reqNewline = true;
} }
else if (item.value == null && ik && ik.comment) { else if (item.value == null && ik?.comment) {
comment = ik.comment; comment = ik.comment;
} }
} }
@@ -43419,7 +43573,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
function plainString(item, ctx, onComment, onChompKeep) { function plainString(item, ctx, onComment, onChompKeep) {
const { type, value } = item; const { type, value } = item;
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
if ((implicitKey && /[\n[\]{},]/.test(value)) || if ((implicitKey && value.includes('\n')) ||
(inFlow && /[[\]{},]/.test(value))) { (inFlow && /[[\]{},]/.test(value))) {
return quotedString(value, ctx); return quotedString(value, ctx);
} }

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "@tj-actions/changed-files", "name": "@tj-actions/changed-files",
"version": "37.4.0", "version": "38.2.2",
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.", "description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
"main": "lib/main.js", "main": "lib/main.js",
"publishConfig": { "publishConfig": {
@@ -35,7 +35,7 @@
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1", "@actions/github": "^5.1.1",
"@octokit/rest": "^19.0.13", "@octokit/rest": "^20.0.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"micromatch": "^4.0.5", "micromatch": "^4.0.5",
"yaml": "^2.3.1" "yaml": "^2.3.1"

View File

@@ -65,6 +65,11 @@ export const getRenamedFiles = async ({
diff diff
})) }))
) { ) {
let message = `Unable to use three dot diff for: ${submodulePath} submodule. Falling back to two dot diff. You can set 'fetch_additional_submodule_history: true' to fetch additional submodule history in order to use three dot diff`
if (inputs.fetchSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`
}
core.info(message)
diff = '..' diff = '..'
} }
@@ -115,20 +120,27 @@ export const getAllDiffFiles = async ({
hasSubmodule, hasSubmodule,
diffResult, diffResult,
submodulePaths, submodulePaths,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
fetchSubmoduleHistory,
failOnInitialDiffError,
failOnSubmoduleDiffError
}: { }: {
workingDirectory: string workingDirectory: string
hasSubmodule: boolean hasSubmodule: boolean
diffResult: DiffResult diffResult: DiffResult
submodulePaths: string[] submodulePaths: string[]
outputRenamedFilesAsDeletedAndAdded: boolean outputRenamedFilesAsDeletedAndAdded: boolean
fetchSubmoduleHistory: boolean
failOnInitialDiffError: boolean
failOnSubmoduleDiffError: boolean
}): Promise<ChangedFiles> => { }): Promise<ChangedFiles> => {
const files = await getAllChangedFiles({ const files = await getAllChangedFiles({
cwd: workingDirectory, cwd: workingDirectory,
sha1: diffResult.previousSha, sha1: diffResult.previousSha,
sha2: diffResult.currentSha, sha2: diffResult.currentSha,
diff: diffResult.diff, diff: diffResult.diff,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
failOnInitialDiffError
}) })
if (hasSubmodule) { if (hasSubmodule) {
@@ -157,6 +169,11 @@ export const getAllDiffFiles = async ({
diff diff
})) }))
) { ) {
let message = `Set 'fetch_additional_submodule_history: true' to fetch additional submodule history for: ${submodulePath}`
if (fetchSubmoduleHistory) {
message = `To fetch additional submodule history for: ${submodulePath} you can increase history depth using 'fetch_depth' input`
}
core.warning(message)
diff = '..' diff = '..'
} }
@@ -167,7 +184,8 @@ export const getAllDiffFiles = async ({
diff, diff,
isSubmodule: true, isSubmodule: true,
parentDir: submodulePath, parentDir: submodulePath,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
failOnSubmoduleDiffError
}) })
for (const changeType of Object.keys( for (const changeType of Object.keys(
@@ -250,20 +268,15 @@ export const getChangeTypeFiles = async ({
inputs: Inputs inputs: Inputs
changedFiles: ChangedFiles changedFiles: ChangedFiles
changeTypes: ChangeTypeEnum[] changeTypes: ChangeTypeEnum[]
}): Promise<{paths: string; count: string}> => { }): Promise<{paths: string[] | string; count: string}> => {
const files = [ const files = [
...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes})) ...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes}))
].filter(Boolean) ].filter(Boolean)
if (inputs.json) { const paths = inputs.json ? files : files.join(inputs.separator)
return {
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
count: files.length.toString()
}
}
return { return {
paths: files.join(inputs.separator), paths,
count: files.length.toString() count: files.length.toString()
} }
} }
@@ -299,20 +312,15 @@ export const getAllChangeTypeFiles = async ({
}: { }: {
inputs: Inputs inputs: Inputs
changedFiles: ChangedFiles changedFiles: ChangedFiles
}): Promise<{paths: string; count: string}> => { }): Promise<{paths: string[] | string; count: string}> => {
const files = [ const files = [
...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles})) ...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles}))
].filter(Boolean) ].filter(Boolean)
if (inputs.json) { const paths = inputs.json ? files : files.join(inputs.separator)
return {
paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}),
count: files.length.toString()
}
}
return { return {
paths: files.join(inputs.separator), paths,
count: files.length.toString() count: files.length.toString()
} }
} }

View File

@@ -12,6 +12,13 @@ const getOutputKey = (key: string, outputPrefix: string): string => {
return outputPrefix ? `${outputPrefix}_${key}` : key return outputPrefix ? `${outputPrefix}_${key}` : key
} }
const getArrayFromPaths = (
paths: string | string[],
inputs: Inputs
): string[] => {
return Array.isArray(paths) ? paths : paths.split(inputs.separator)
}
export const setChangedFilesOutput = async ({ export const setChangedFilesOutput = async ({
allDiffFiles, allDiffFiles,
allFilteredDiffFiles, allFilteredDiffFiles,
@@ -34,12 +41,16 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('added_files', outputPrefix), key: getOutputKey('added_files', outputPrefix),
value: addedFiles.paths, value: addedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('added_files_count', outputPrefix), key: getOutputKey('added_files_count', outputPrefix),
value: addedFiles.count, value: addedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const copiedFiles = await getChangeTypeFiles({ const copiedFiles = await getChangeTypeFiles({
@@ -51,13 +62,17 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('copied_files', outputPrefix), key: getOutputKey('copied_files', outputPrefix),
value: copiedFiles.paths, value: copiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('copied_files_count', outputPrefix), key: getOutputKey('copied_files_count', outputPrefix),
value: copiedFiles.count, value: copiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const modifiedFiles = await getChangeTypeFiles({ const modifiedFiles = await getChangeTypeFiles({
@@ -69,13 +84,17 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('modified_files', outputPrefix), key: getOutputKey('modified_files', outputPrefix),
value: modifiedFiles.paths, value: modifiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('modified_files_count', outputPrefix), key: getOutputKey('modified_files_count', outputPrefix),
value: modifiedFiles.count, value: modifiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const renamedFiles = await getChangeTypeFiles({ const renamedFiles = await getChangeTypeFiles({
@@ -87,13 +106,17 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('renamed_files', outputPrefix), key: getOutputKey('renamed_files', outputPrefix),
value: renamedFiles.paths, value: renamedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('renamed_files_count', outputPrefix), key: getOutputKey('renamed_files_count', outputPrefix),
value: renamedFiles.count, value: renamedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const typeChangedFiles = await getChangeTypeFiles({ const typeChangedFiles = await getChangeTypeFiles({
@@ -105,13 +128,17 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('type_changed_files', outputPrefix), key: getOutputKey('type_changed_files', outputPrefix),
value: typeChangedFiles.paths, value: typeChangedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('type_changed_files_count', outputPrefix), key: getOutputKey('type_changed_files_count', outputPrefix),
value: typeChangedFiles.count, value: typeChangedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const unmergedFiles = await getChangeTypeFiles({ const unmergedFiles = await getChangeTypeFiles({
@@ -123,13 +150,17 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('unmerged_files', outputPrefix), key: getOutputKey('unmerged_files', outputPrefix),
value: unmergedFiles.paths, value: unmergedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('unmerged_files_count', outputPrefix), key: getOutputKey('unmerged_files_count', outputPrefix),
value: unmergedFiles.count, value: unmergedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const unknownFiles = await getChangeTypeFiles({ const unknownFiles = await getChangeTypeFiles({
@@ -141,13 +172,17 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('unknown_files', outputPrefix), key: getOutputKey('unknown_files', outputPrefix),
value: unknownFiles.paths, value: unknownFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('unknown_files_count', outputPrefix), key: getOutputKey('unknown_files_count', outputPrefix),
value: unknownFiles.count, value: unknownFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const allChangedAndModifiedFiles = await getAllChangeTypeFiles({ const allChangedAndModifiedFiles = await getAllChangeTypeFiles({
@@ -162,13 +197,17 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('all_changed_and_modified_files', outputPrefix), key: getOutputKey('all_changed_and_modified_files', outputPrefix),
value: allChangedAndModifiedFiles.paths, value: allChangedAndModifiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix), key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
value: allChangedAndModifiedFiles.count, value: allChangedAndModifiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const allChangedFiles = await getChangeTypeFiles({ const allChangedFiles = await getChangeTypeFiles({
@@ -185,19 +224,25 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('all_changed_files', outputPrefix), key: getOutputKey('all_changed_files', outputPrefix),
value: allChangedFiles.paths, value: allChangedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('all_changed_files_count', outputPrefix), key: getOutputKey('all_changed_files_count', outputPrefix),
value: allChangedFiles.count, value: allChangedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
await setOutput({ await setOutput({
key: getOutputKey('any_changed', outputPrefix), key: getOutputKey('any_changed', outputPrefix),
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0, value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
const allOtherChangedFiles = await getChangeTypeFiles({ const allOtherChangedFiles = await getChangeTypeFiles({
@@ -212,11 +257,17 @@ export const setChangedFilesOutput = async ({
}) })
core.debug(`All other changed files: ${JSON.stringify(allOtherChangedFiles)}`) core.debug(`All other changed files: ${JSON.stringify(allOtherChangedFiles)}`)
const otherChangedFiles = allOtherChangedFiles.paths const allOtherChangedFilesPaths: string[] = getArrayFromPaths(
.split(inputs.separator) allOtherChangedFiles.paths,
.filter( inputs
(filePath: string) => )
!allChangedFiles.paths.split(inputs.separator).includes(filePath) const allChangedFilesPaths: string[] = getArrayFromPaths(
allChangedFiles.paths,
inputs
)
const otherChangedFiles = allOtherChangedFilesPaths.filter(
(filePath: string) => !allChangedFilesPaths.includes(filePath)
) )
const onlyChanged = const onlyChanged =
@@ -227,19 +278,27 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('only_changed', outputPrefix), key: getOutputKey('only_changed', outputPrefix),
value: onlyChanged, value: onlyChanged,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
await setOutput({ await setOutput({
key: getOutputKey('other_changed_files', outputPrefix), key: getOutputKey('other_changed_files', outputPrefix),
value: otherChangedFiles.join(inputs.separator), value: inputs.json
inputs ? otherChangedFiles
: otherChangedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('other_changed_files_count', outputPrefix), key: getOutputKey('other_changed_files_count', outputPrefix),
value: otherChangedFiles.length.toString(), value: otherChangedFiles.length.toString(),
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const allModifiedFiles = await getChangeTypeFiles({ const allModifiedFiles = await getChangeTypeFiles({
@@ -257,19 +316,25 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('all_modified_files', outputPrefix), key: getOutputKey('all_modified_files', outputPrefix),
value: allModifiedFiles.paths, value: allModifiedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('all_modified_files_count', outputPrefix), key: getOutputKey('all_modified_files_count', outputPrefix),
value: allModifiedFiles.count, value: allModifiedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
await setOutput({ await setOutput({
key: getOutputKey('any_modified', outputPrefix), key: getOutputKey('any_modified', outputPrefix),
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0, value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
const allOtherModifiedFiles = await getChangeTypeFiles({ const allOtherModifiedFiles = await getChangeTypeFiles({
@@ -284,11 +349,18 @@ export const setChangedFilesOutput = async ({
] ]
}) })
const otherModifiedFiles = allOtherModifiedFiles.paths const allOtherModifiedFilesPaths: string[] = getArrayFromPaths(
.split(inputs.separator) allOtherModifiedFiles.paths,
.filter( inputs
(filePath: string) => )
!allModifiedFiles.paths.split(inputs.separator).includes(filePath)
const allModifiedFilesPaths: string[] = getArrayFromPaths(
allModifiedFiles.paths,
inputs
)
const otherModifiedFiles = allOtherModifiedFilesPaths.filter(
(filePath: string) => !allModifiedFilesPaths.includes(filePath)
) )
const onlyModified = const onlyModified =
@@ -299,19 +371,27 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('only_modified', outputPrefix), key: getOutputKey('only_modified', outputPrefix),
value: onlyModified, value: onlyModified,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
await setOutput({ await setOutput({
key: getOutputKey('other_modified_files', outputPrefix), key: getOutputKey('other_modified_files', outputPrefix),
value: otherModifiedFiles.join(inputs.separator), value: inputs.json
inputs ? otherModifiedFiles
: otherModifiedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('other_modified_files_count', outputPrefix), key: getOutputKey('other_modified_files_count', outputPrefix),
value: otherModifiedFiles.length.toString(), value: otherModifiedFiles.length.toString(),
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
const deletedFiles = await getChangeTypeFiles({ const deletedFiles = await getChangeTypeFiles({
@@ -323,19 +403,25 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('deleted_files', outputPrefix), key: getOutputKey('deleted_files', outputPrefix),
value: deletedFiles.paths, value: deletedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('deleted_files_count', outputPrefix), key: getOutputKey('deleted_files_count', outputPrefix),
value: deletedFiles.count, value: deletedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
await setOutput({ await setOutput({
key: getOutputKey('any_deleted', outputPrefix), key: getOutputKey('any_deleted', outputPrefix),
value: deletedFiles.paths.length > 0 && filePatterns.length > 0, value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
const allOtherDeletedFiles = await getChangeTypeFiles({ const allOtherDeletedFiles = await getChangeTypeFiles({
@@ -344,10 +430,18 @@ export const setChangedFilesOutput = async ({
changeTypes: [ChangeTypeEnum.Deleted] changeTypes: [ChangeTypeEnum.Deleted]
}) })
const otherDeletedFiles = allOtherDeletedFiles.paths const allOtherDeletedFilesPaths: string[] = getArrayFromPaths(
.split(inputs.separator) allOtherDeletedFiles.paths,
.filter( inputs
filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath) )
const deletedFilesPaths: string[] = getArrayFromPaths(
deletedFiles.paths,
inputs
)
const otherDeletedFiles = allOtherDeletedFilesPaths.filter(
filePath => !deletedFilesPaths.includes(filePath)
) )
const onlyDeleted = const onlyDeleted =
@@ -358,18 +452,26 @@ export const setChangedFilesOutput = async ({
await setOutput({ await setOutput({
key: getOutputKey('only_deleted', outputPrefix), key: getOutputKey('only_deleted', outputPrefix),
value: onlyDeleted, value: onlyDeleted,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
await setOutput({ await setOutput({
key: getOutputKey('other_deleted_files', outputPrefix), key: getOutputKey('other_deleted_files', outputPrefix),
value: otherDeletedFiles.join(inputs.separator), value: inputs.json
inputs ? otherDeletedFiles
: otherDeletedFiles.join(inputs.separator),
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
shouldEscape: inputs.escapeJson
}) })
await setOutput({ await setOutput({
key: getOutputKey('other_deleted_files_count', outputPrefix), key: getOutputKey('other_deleted_files_count', outputPrefix),
value: otherDeletedFiles.length.toString(), value: otherDeletedFiles.length.toString(),
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
}) })
} }

View File

@@ -93,7 +93,8 @@ export const getSHAForNonPullRequestEvent = async (
const currentBranch = targetBranch const currentBranch = targetBranch
let initialCommit = false let initialCommit = false
if (isShallow && !inputs.skipInitialFetch) { if (!inputs.skipInitialFetch) {
if (isShallow) {
core.info('Repository is shallow, fetching more history...') core.info('Repository is shallow, fetching more history...')
if (isTag) { if (isTag) {
@@ -144,6 +145,19 @@ export const getSHAForNonPullRequestEvent = async (
] ]
}) })
} }
} else {
if (hasSubmodule && inputs.fetchSubmoduleHistory) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
})
}
}
} }
const currentSha = await getCurrentSHA({inputs, workingDirectory}) const currentSha = await getCurrentSHA({inputs, workingDirectory})
@@ -288,9 +302,9 @@ export const getSHAForPullRequestEvent = async (
targetBranch = currentBranch targetBranch = currentBranch
} }
if (isShallow && !inputs.skipInitialFetch) { if (!inputs.skipInitialFetch) {
core.info('Repository is shallow, fetching more history...') core.info('Repository is shallow, fetching more history...')
if (isShallow) {
let prFetchExitCode = await gitFetch({ let prFetchExitCode = await gitFetch({
cwd: workingDirectory, cwd: workingDirectory,
args: [ args: [
@@ -348,6 +362,19 @@ export const getSHAForPullRequestEvent = async (
}) })
} }
} }
} else {
if (hasSubmodule && inputs.fetchSubmoduleHistory) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
...gitFetchExtraArgs,
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`
]
})
}
}
core.info('Completed fetching more history.') core.info('Completed fetching more history.')
} }
@@ -394,10 +421,19 @@ export const getSHAForPullRequestEvent = async (
(previousSha && (previousSha &&
(await verifyCommitSha({sha: previousSha, cwd: workingDirectory})) !== (await verifyCommitSha({sha: previousSha, cwd: workingDirectory})) !==
0) 0)
) {
if (
github.context.payload.action &&
github.context.payload.action === 'synchronize'
) { ) {
core.warning( core.warning(
'Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.' 'Unable to locate the remote branch head sha. Falling back to the previous commit in the local history.'
) )
} else {
core.info(
`Unable to locate the remote branch head sha for ${github.context.eventName} (${github.context.payload.action}) events. Falling back to the previous commit in the local history.`
)
}
previousSha = await getParentSha({ previousSha = await getParentSha({
cwd: workingDirectory cwd: workingDirectory
}) })

View File

@@ -34,6 +34,7 @@ export type Inputs = {
json: boolean json: boolean
escapeJson: boolean escapeJson: boolean
fetchDepth?: number fetchDepth?: number
fetchSubmoduleHistory: boolean
sinceLastRemoteCommit: boolean sinceLastRemoteCommit: boolean
writeOutputFiles: boolean writeOutputFiles: boolean
outputDir: string outputDir: string
@@ -47,6 +48,8 @@ export type Inputs = {
token: string token: string
apiUrl: string apiUrl: string
skipInitialFetch: boolean skipInitialFetch: boolean
failOnInitialDiffError: boolean
failOnSubmoduleDiffError: boolean
} }
export const getInputs = (): Inputs => { export const getInputs = (): Inputs => {
@@ -189,6 +192,24 @@ export const getInputs = (): Inputs => {
const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', { const skipInitialFetch = core.getBooleanInput('skip_initial_fetch', {
required: false required: false
}) })
const fetchSubmoduleHistory = core.getBooleanInput(
'fetch_additional_submodule_history',
{
required: false
}
)
const failOnInitialDiffError = core.getBooleanInput(
'fail_on_initial_diff_error',
{
required: false
}
)
const failOnSubmoduleDiffError = core.getBooleanInput(
'fail_on_submodule_diff_error',
{
required: false
}
)
const inputs: Inputs = { const inputs: Inputs = {
files, files,
@@ -205,6 +226,8 @@ export const getInputs = (): Inputs => {
filesIgnoreYaml, filesIgnoreYaml,
filesIgnoreYamlFromSourceFile, filesIgnoreYamlFromSourceFile,
filesIgnoreYamlFromSourceFileSeparator, filesIgnoreYamlFromSourceFileSeparator,
failOnInitialDiffError,
failOnSubmoduleDiffError,
separator, separator,
// Not Supported via REST API // Not Supported via REST API
sha, sha,
@@ -225,6 +248,7 @@ export const getInputs = (): Inputs => {
oldNewSeparator, oldNewSeparator,
oldNewFilesSeparator, oldNewFilesSeparator,
skipInitialFetch, skipInitialFetch,
fetchSubmoduleHistory,
// End Not Supported via REST API // End Not Supported via REST API
dirNames, dirNames,
dirNamesExcludeCurrentDir, dirNamesExcludeCurrentDir,

View File

@@ -190,7 +190,10 @@ const getChangedFilesFromLocalGit = async ({
hasSubmodule, hasSubmodule,
diffResult, diffResult,
submodulePaths, submodulePaths,
outputRenamedFilesAsDeletedAndAdded outputRenamedFilesAsDeletedAndAdded,
fetchSubmoduleHistory: inputs.fetchSubmoduleHistory,
failOnInitialDiffError: inputs.failOnInitialDiffError,
failOnSubmoduleDiffError: inputs.failOnSubmoduleDiffError
}) })
core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`) core.debug(`All diff files: ${JSON.stringify(allDiffFiles)}`)
core.info('All Done!') core.info('All Done!')
@@ -233,12 +236,16 @@ const getChangedFilesFromLocalGit = async ({
await setOutput({ await setOutput({
key: 'all_old_new_renamed_files', key: 'all_old_new_renamed_files',
value: allOldNewRenamedFiles.paths, value: allOldNewRenamedFiles.paths,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
await setOutput({ await setOutput({
key: 'all_old_new_renamed_files_count', key: 'all_old_new_renamed_files_count',
value: allOldNewRenamedFiles.count, value: allOldNewRenamedFiles.count,
inputs writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json
}) })
core.info('All Done!') core.info('All Done!')
core.endGroup() core.endGroup()
@@ -317,7 +324,8 @@ export async function run(): Promise<void> {
'recoverFiles', 'recoverFiles',
'recoverFilesIgnore', 'recoverFilesIgnore',
'includeAllOldNewRenamedFiles', 'includeAllOldNewRenamedFiles',
'skipInitialFetch' 'skipInitialFetch',
'fetchSubmoduleHistory'
] ]
for (const input of unsupportedInputs) { for (const input of unsupportedInputs) {

View File

@@ -490,6 +490,8 @@ export const gitRenamedFiles = async ({
* @param isSubmodule - is the repo a submodule * @param isSubmodule - is the repo a submodule
* @param parentDir - parent directory of the submodule * @param parentDir - parent directory of the submodule
* @param outputRenamedFilesAsDeletedAndAdded - output renamed files as deleted and added * @param outputRenamedFilesAsDeletedAndAdded - output renamed files as deleted and added
* @param failOnInitialDiffError - fail if the initial diff fails
* @param failOnSubmoduleDiffError - fail if the submodule diff fails
*/ */
export const getAllChangedFiles = async ({ export const getAllChangedFiles = async ({
cwd, cwd,
@@ -498,7 +500,9 @@ export const getAllChangedFiles = async ({
diff, diff,
isSubmodule = false, isSubmodule = false,
parentDir = '', parentDir = '',
outputRenamedFilesAsDeletedAndAdded = false outputRenamedFilesAsDeletedAndAdded = false,
failOnInitialDiffError = false,
failOnSubmoduleDiffError = false
}: { }: {
cwd: string cwd: string
sha1: string sha1: string
@@ -507,6 +511,8 @@ export const getAllChangedFiles = async ({
isSubmodule?: boolean isSubmodule?: boolean
parentDir?: string parentDir?: string
outputRenamedFilesAsDeletedAndAdded?: boolean outputRenamedFilesAsDeletedAndAdded?: boolean
failOnInitialDiffError?: boolean
failOnSubmoduleDiffError?: boolean
}): Promise<ChangedFiles> => { }): Promise<ChangedFiles> => {
const {exitCode, stdout, stderr} = await exec.getExecOutput( const {exitCode, stdout, stderr} = await exec.getExecOutput(
'git', 'git',
@@ -534,6 +540,18 @@ export const getAllChangedFiles = async ({
[ChangeTypeEnum.Unknown]: [] [ChangeTypeEnum.Unknown]: []
} }
if (exitCode !== 0) {
if (failOnInitialDiffError && !isSubmodule) {
throw new Error(
`Failed to get changed files between: ${sha1}${diff}${sha2}: ${stderr}`
)
} else if (failOnSubmoduleDiffError && isSubmodule) {
throw new Error(
`Failed to get changed files for submodule between: ${sha1}${diff}${sha2}: ${stderr}`
)
}
}
if (exitCode !== 0) { if (exitCode !== 0) {
if (isSubmodule) { if (isSubmodule) {
core.warning( core.warning(
@@ -874,7 +892,7 @@ export const jsonOutput = ({
value, value,
shouldEscape shouldEscape
}: { }: {
value: string | string[] value: string | string[] | boolean
shouldEscape: boolean shouldEscape: boolean
}): string => { }): string => {
const result = JSON.stringify(value) const result = JSON.stringify(value)
@@ -979,7 +997,7 @@ export const getFilePatterns = async ({
} else { } else {
const pathParts = pattern.split('/') const pathParts = pattern.split('/')
const lastPart = pathParts[pathParts.length - 1] const lastPart = pathParts[pathParts.length - 1]
if (!lastPart.includes('.') && !lastPart.includes('*')) { if (!lastPart.includes('.')) {
return `${pattern}/**` return `${pattern}/**`
} else { } else {
return pattern return pattern
@@ -1208,18 +1226,29 @@ export const getRecoverFilePatterns = ({
export const setOutput = async ({ export const setOutput = async ({
key, key,
value, value,
inputs writeOutputFiles,
outputDir,
json = false,
shouldEscape = false
}: { }: {
key: string key: string
value: string | boolean value: string | string[] | boolean
inputs: Inputs writeOutputFiles: boolean
outputDir: string
json?: boolean
shouldEscape?: boolean
}): Promise<void> => { }): Promise<void> => {
const cleanedValue = value.toString().trim() let cleanedValue
if (json) {
cleanedValue = jsonOutput({value, shouldEscape})
} else {
cleanedValue = value.toString().trim()
}
core.setOutput(key, cleanedValue) core.setOutput(key, cleanedValue)
if (inputs.writeOutputFiles) { if (writeOutputFiles) {
const outputDir = inputs.outputDir const extension = json ? 'json' : 'txt'
const extension = inputs.json ? 'json' : 'txt'
const outputFilePath = path.join(outputDir, `${key}.${extension}`) const outputFilePath = path.join(outputDir, `${key}.${extension}`)
if (!(await exists(outputDir))) { if (!(await exists(outputDir))) {

1011
yarn.lock

File diff suppressed because it is too large Load Diff