Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
635f118699 | ||
|
|
634b61511e | ||
|
|
77fcf43160 | ||
|
|
5f084a52a4 | ||
|
|
ff2cb1b4f2 | ||
|
|
5d5da31340 | ||
|
|
29bc0d3fd9 | ||
|
|
c9f9d5784e | ||
|
|
a4fba0109c | ||
|
|
8a6546164a | ||
|
|
bad2eb6859 | ||
|
|
b2dbd4264a | ||
|
|
57d40e662d | ||
|
|
185549c022 | ||
|
|
f853fd0592 | ||
|
|
cd3c6e6bbd | ||
|
|
e5ce44a301 | ||
|
|
ccdcd17ffd | ||
|
|
e4b8dafc5d | ||
|
|
2d756ea4c5 | ||
|
|
ce497c39e9 | ||
|
|
2d21bbb405 | ||
|
|
90941b398f | ||
|
|
2ca8dc42f6 | ||
|
|
ee096d679e | ||
|
|
4621617d4b | ||
|
|
4bbd49b998 | ||
|
|
c6557ed000 | ||
|
|
f0e7702ccc | ||
|
|
6354e6c542 | ||
|
|
117616472f | ||
|
|
4ff79362e5 | ||
|
|
0713a11242 | ||
|
|
064742427d | ||
|
|
efe5e6c7a4 | ||
|
|
01e9662a12 | ||
|
|
20576b4b9e | ||
|
|
077b23f6a6 | ||
|
|
02768050b1 | ||
|
|
427adf47f0 | ||
|
|
5c6aa49478 | ||
|
|
aa0b62a2d0 | ||
|
|
0320702dd5 | ||
|
|
38903688b4 | ||
|
|
98a74d2cd6 | ||
|
|
068000d9c6 | ||
|
|
490ac3999e | ||
|
|
2859a60726 | ||
|
|
d03038e4e4 | ||
|
|
77af4bed28 | ||
|
|
a5cf6aa30c | ||
|
|
15807c9c84 | ||
|
|
dc458cf753 | ||
|
|
92ca3eebd0 | ||
|
|
f591d0c7f0 | ||
|
|
35023362e2 | ||
|
|
e436cb6d85 | ||
|
|
257d47dfba | ||
|
|
4918e11830 |
2
.github/workflows/sync-release-version.yml
vendored
2
.github/workflows/sync-release-version.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
||||
- name: Run git-cliff
|
||||
uses: tj-actions/git-cliff@v1
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v6.0.1
|
||||
uses: peter-evans/create-pull-request@v6.0.2
|
||||
with:
|
||||
base: "main"
|
||||
labels: "merge when passing"
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -60,7 +60,7 @@ jobs:
|
||||
yarn install
|
||||
|
||||
- name: Run eslint on changed files
|
||||
uses: tj-actions/eslint-changed-files@v23
|
||||
uses: tj-actions/eslint-changed-files@v24
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
|
||||
125
HISTORY.md
125
HISTORY.md
@@ -1,5 +1,130 @@
|
||||
# Changelog
|
||||
|
||||
# [44.0.0](https://github.com/tj-actions/changed-files/compare/v43.0.1...v44.0.0) - (2024-03-27)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Ensure the fork remote doesn't exists before creating it ([#2012](https://github.com/tj-actions/changed-files/issues/2012)) ([4bbd49b](https://github.com/tj-actions/changed-files/commit/4bbd49b9986b1300b75e8efb5778350b750ae6c8)) - (Tonye Jack)
|
||||
- Update previos sha for forks ([#2011](https://github.com/tj-actions/changed-files/issues/2011)) ([f0e7702](https://github.com/tj-actions/changed-files/commit/f0e7702ccc35952acb83edeb7400b05c0a67e2be)) - (Tonye Jack)
|
||||
- Update to add the fork remote ([#2010](https://github.com/tj-actions/changed-files/issues/2010)) ([6354e6c](https://github.com/tj-actions/changed-files/commit/6354e6c5426d1e7c7a2d8a5887e26b535837958e)) - (Tonye Jack)
|
||||
- Check for setting remote urls for forks ([#2009](https://github.com/tj-actions/changed-files/issues/2009)) ([1176164](https://github.com/tj-actions/changed-files/commit/117616472fb771d9e030aa0c3741057ad520d9cf)) - (Tonye Jack)
|
||||
- Bug with prs from forks returning incorrect set of changed files ([#2007](https://github.com/tj-actions/changed-files/issues/2007)) ([4ff7936](https://github.com/tj-actions/changed-files/commit/4ff79362e5015d6d0c6c0050b3082c97a5b7e84a)) - (Tonye Jack)
|
||||
|
||||
## <!-- 17 -->➖ Remove
|
||||
|
||||
- Unused code ([#2014](https://github.com/tj-actions/changed-files/issues/2014)) ([90941b3](https://github.com/tj-actions/changed-files/commit/90941b398f6d8d3ade3e2b8f179d0c64f3679de6)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#2016](https://github.com/tj-actions/changed-files/issues/2016))
|
||||
|
||||
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([2d756ea](https://github.com/tj-actions/changed-files/commit/2d756ea4c53f7f6b397767d8723b3a10a9f35bf2)) - (tj-actions[bot])
|
||||
- Update README.md ([2d21bbb](https://github.com/tj-actions/changed-files/commit/2d21bbb405b3e0e15479b93c4d9989b4b780a266)) - (Tonye Jack)
|
||||
- Updated README.md ([#2013](https://github.com/tj-actions/changed-files/issues/2013))
|
||||
|
||||
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([2ca8dc4](https://github.com/tj-actions/changed-files/commit/2ca8dc42f60aab6d0f54beb4e1bd63f15aa53632)) - (tj-actions[bot])
|
||||
- Update README.md ([4621617](https://github.com/tj-actions/changed-files/commit/4621617d4b568fe72798b05a512482442405549c)) - (tonyejack1)
|
||||
- Update README.md ([c6557ed](https://github.com/tj-actions/changed-files/commit/c6557ed000b9d1dbc0abcb5c2a7efc1ef3baa379)) - (Tonye Jack)
|
||||
- Update README.md ([0713a11](https://github.com/tj-actions/changed-files/commit/0713a11242c796d0e601c9ac8f009c2beed0d646)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- Update description of outputs removing asterisks ([#2015](https://github.com/tj-actions/changed-files/issues/2015)) ([ce497c3](https://github.com/tj-actions/changed-files/commit/ce497c39e9043c5dec72f4506445f6b5dbd1f027)) - (tonyejack1)
|
||||
- Update description of other_deleted_files output ([#2008](https://github.com/tj-actions/changed-files/issues/2008)) ([ee096d6](https://github.com/tj-actions/changed-files/commit/ee096d679e877096b9d6e42066f654e0d9d65b1a)) - (tonyejack1)
|
||||
- **deps:** Update typescript-eslint monorepo to v7.4.0 ([0647424](https://github.com/tj-actions/changed-files/commit/064742427d8106b59345e3fabb40031068c82c41)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([efe5e6c](https://github.com/tj-actions/changed-files/commit/efe5e6c7a415f33e8936dea8c45a8fe80be66a92)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v43.0.1 ([#2004](https://github.com/tj-actions/changed-files/issues/2004))
|
||||
|
||||
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([01e9662](https://github.com/tj-actions/changed-files/commit/01e9662a12a71c5aea74e82ca1c58fa76a640c61)) - (tj-actions[bot])
|
||||
|
||||
# [43.0.1](https://github.com/tj-actions/changed-files/compare/v43.0.0...v43.0.1) - (2024-03-20)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Remove warning with detecting the local git repository when using Github's REST API ([#2002](https://github.com/tj-actions/changed-files/issues/2002)) ([077b23f](https://github.com/tj-actions/changed-files/commit/077b23f6a68d9322b1b4ed4d0c88791b30b314d8)) - (Tonye Jack)
|
||||
|
||||
## <!-- 13 -->📦 Bumps
|
||||
|
||||
- Bump @typescript-eslint/eslint-plugin from 7.3.0 to 7.3.1 ([#1995](https://github.com/tj-actions/changed-files/issues/1995))
|
||||
|
||||
Signed-off-by: dependabot[bot] <support@github.com>
|
||||
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
||||
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([5c6aa49](https://github.com/tj-actions/changed-files/commit/5c6aa4947834d6dd7af1de76ed0e000a8cbc0964)) - (dependabot[bot])
|
||||
- Bump @typescript-eslint/parser from 7.3.0 to 7.3.1 ([#1996](https://github.com/tj-actions/changed-files/issues/1996))
|
||||
|
||||
Signed-off-by: dependabot[bot] <support@github.com>
|
||||
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> ([0320702](https://github.com/tj-actions/changed-files/commit/0320702dd5d94814f6c31f81f51dda71ff2d2afc)) - (dependabot[bot])
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Update README.md ([2859a60](https://github.com/tj-actions/changed-files/commit/2859a60726ea6e36242029176333d2d37880bbc5)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update dependency typescript to v5.4.3 ([20576b4](https://github.com/tj-actions/changed-files/commit/20576b4b9ed46d41e2d45a2256e5e2316dde6834)) - (renovate[bot])
|
||||
- Update inputs.ts adding comment about fetch_depth ([#2000](https://github.com/tj-actions/changed-files/issues/2000)) ([0276805](https://github.com/tj-actions/changed-files/commit/02768050b13fdd81ec63a329d99c63c70c0498d5)) - (Tonye Jack)
|
||||
- **deps:** Update dependency @types/node to v20.11.30 ([427adf4](https://github.com/tj-actions/changed-files/commit/427adf47f0f2cc0562d8ed340e6ada019719e4ed)) - (renovate[bot])
|
||||
- **deps:** Update dependency @typescript-eslint/eslint-plugin to v7.3.1 ([aa0b62a](https://github.com/tj-actions/changed-files/commit/aa0b62a2d0821235d320c725d8a3ac5eaa3d227a)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.11.29 ([3890368](https://github.com/tj-actions/changed-files/commit/38903688b4f76a85d37c033f85de20dc15cae06f)) - (renovate[bot])
|
||||
- **deps:** Update typescript-eslint monorepo to v7.3.0 ([98a74d2](https://github.com/tj-actions/changed-files/commit/98a74d2cd69797eb746b5f87fc277dd48b6fecb7)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([068000d](https://github.com/tj-actions/changed-files/commit/068000d9c6712e4e03b15f450774548890556fc7)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.11.28 ([490ac39](https://github.com/tj-actions/changed-files/commit/490ac3999ea698495f8c32c2936450b9db118b2d)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v43 ([#1990](https://github.com/tj-actions/changed-files/issues/1990))
|
||||
|
||||
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([d03038e](https://github.com/tj-actions/changed-files/commit/d03038e4e418521b091b356b50cff5d7be177c78)) - (tj-actions[bot])
|
||||
|
||||
# [43.0.0](https://github.com/tj-actions/changed-files/compare/v42.1.0...v43.0.0) - (2024-03-13)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add support for returning true for `any_{changed, modified, deleted}` outputs when no patterns are specified ([#1988](https://github.com/tj-actions/changed-files/issues/1988)) ([a5cf6aa](https://github.com/tj-actions/changed-files/commit/a5cf6aa30cfbe1e0764d2aa5e9f42edb847b6d55)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1989](https://github.com/tj-actions/changed-files/issues/1989))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([77af4be](https://github.com/tj-actions/changed-files/commit/77af4bed286740ef1a6387dc4e4e4dec39f96054)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update dependency @types/node to v20.11.27 ([15807c9](https://github.com/tj-actions/changed-files/commit/15807c9c84ec7ff092c52f2f9fecc600e81420f1)) - (renovate[bot])
|
||||
- **deps:** Update peter-evans/create-pull-request action to v6.0.2 ([dc458cf](https://github.com/tj-actions/changed-files/commit/dc458cf7531fd39dcf942beb39ef6bdcaddc9715)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/lodash to v4.17.0 ([92ca3ee](https://github.com/tj-actions/changed-files/commit/92ca3eebd01cb3fc4d88a4cbd10f344ea4a116d3)) - (renovate[bot])
|
||||
- **deps:** Update dependency @typescript-eslint/eslint-plugin to v7.2.0 ([f591d0c](https://github.com/tj-actions/changed-files/commit/f591d0c7f0b790ca8c139ce92ff4e8c238cb8940)) - (renovate[bot])
|
||||
- **deps:** Update dependency @types/node to v20.11.26 ([3502336](https://github.com/tj-actions/changed-files/commit/35023362e2b0ff1cd9b970167a1603614e1ad854)) - (renovate[bot])
|
||||
- **deps:** Update dependency @typescript-eslint/parser to v7.2.0 ([e436cb6](https://github.com/tj-actions/changed-files/commit/e436cb6d85bcd4aecab64c542f2268998a1cdd2f)) - (renovate[bot])
|
||||
- **deps:** Lock file maintenance ([257d47d](https://github.com/tj-actions/changed-files/commit/257d47dfba22be3e0a17f6bad47ff07f7e76747c)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v42.1.0 ([#1977](https://github.com/tj-actions/changed-files/issues/1977))
|
||||
|
||||
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([4918e11](https://github.com/tj-actions/changed-files/commit/4918e1183080b35a085c91c8abc9e6adc4de61a1)) - (tj-actions[bot])
|
||||
|
||||
# [42.1.0](https://github.com/tj-actions/changed-files/compare/v42.0.7...v42.1.0) - (2024-03-09)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Add matrix alias to simplify using outputs for matrix jobs ([#1975](https://github.com/tj-actions/changed-files/issues/1975)) ([008ba8c](https://github.com/tj-actions/changed-files/commit/008ba8ceec9f1757264e0512542d5ecab6d87ae6)) - (Tonye Jack)
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1976](https://github.com/tj-actions/changed-files/issues/1976))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([aa08304](https://github.com/tj-actions/changed-files/commit/aa08304bd477b800d468db44fe10f6c61f7f7b11)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v42.0.7 ([#1974](https://github.com/tj-actions/changed-files/issues/1974))
|
||||
|
||||
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([fe6c3ea](https://github.com/tj-actions/changed-files/commit/fe6c3ea0ca88f25e4ba51fa00c27bb5dd06cb08a)) - (tj-actions[bot])
|
||||
|
||||
# [42.0.7](https://github.com/tj-actions/changed-files/compare/v42.0.6...v42.0.7) - (2024-03-07)
|
||||
|
||||
## <!-- 16 -->➕ Add
|
||||
|
||||
101
README.md
101
README.md
@@ -116,15 +116,13 @@ jobs:
|
||||
name: Test changed-files
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
||||
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
# Example 1
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
|
||||
# with:
|
||||
# since_last_remote_commit: true
|
||||
@@ -142,7 +140,7 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
- name: Get all changed markdown files
|
||||
id: changed-markdown-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
# Avoid using single or double quotes for multiline patterns
|
||||
files: |
|
||||
@@ -162,7 +160,7 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
- name: Get all test, doc and src files that have changed
|
||||
id: changed-files-yaml
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files_yaml: |
|
||||
doc:
|
||||
@@ -197,7 +195,7 @@ jobs:
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
- name: Get changed files in the docs folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: docs/*.{js,html} # Alternatively using: `docs/**`
|
||||
files_ignore: docs/static.js
|
||||
@@ -229,7 +227,7 @@ jobs:
|
||||
# NOTE:
|
||||
# - This is limited to pull_request* events and would raise an error for other events.
|
||||
# - A maximum of 3000 files can be returned.
|
||||
# - For more flexibility and no limitations see "Using local .git history" above.
|
||||
# - For more flexibility and no limitations see "Using local .git directory" above.
|
||||
|
||||
runs-on: ubuntu-latest # windows-latest || macos-latest
|
||||
name: Test changed-files
|
||||
@@ -239,7 +237,7 @@ jobs:
|
||||
steps:
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
|
||||
- name: List all changed files
|
||||
env:
|
||||
@@ -282,7 +280,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
|
||||
|
||||
- name: List all changed files
|
||||
@@ -322,14 +320,14 @@ Support this project with a :star:
|
||||
> * When using `files_yaml*` inputs:
|
||||
> * All keys must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
|
||||
>
|
||||
> For example, `test` or `test_key` or `test-key` or `_test_key` are all valid.
|
||||
> For example, `test` or `test_key` or `test-key` or `_test_key` are all valid choices.
|
||||
|
||||
## Inputs ⚙️
|
||||
|
||||
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
||||
|
||||
```yaml
|
||||
- uses: tj-actions/changed-files@v42
|
||||
- uses: tj-actions/changed-files@v44
|
||||
id: changed-files
|
||||
with:
|
||||
# Github API URL.
|
||||
@@ -664,33 +662,33 @@ Support this project with a :star:
|
||||
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| <a name="output_added_files"></a>[added\_files](#output_added_files) | string | Returns only files that are <br>Added (A). |
|
||||
| <a name="output_added_files_count"></a>[added\_files\_count](#output_added_files_count) | string | Returns the number of `added_files` |
|
||||
| <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
|
||||
| <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. a combination of <br>(ACMRDTUX) |
|
||||
| <a name="output_all_changed_and_modified_files_count"></a>[all\_changed\_and\_modified\_files\_count](#output_all_changed_and_modified_files_count) | string | Returns the number of `all_changed_and_modified_files` |
|
||||
| <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
|
||||
| <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>a combination of all added, <br>copied, modified and renamed files <br>(ACMR) |
|
||||
| <a name="output_all_changed_files_count"></a>[all\_changed\_files\_count](#output_all_changed_files_count) | string | Returns the number of `all_changed_files` |
|
||||
| <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
|
||||
| <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>a combination of all added, <br>copied, modified, renamed and deleted <br>files (ACMRD). |
|
||||
| <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` |
|
||||
| <a name="output_all_old_new_renamed_files"></a>[all\_old\_new\_renamed\_files](#output_all_old_new_renamed_files) | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
|
||||
| <a name="output_all_old_new_renamed_files_count"></a>[all\_old\_new\_renamed\_files\_count](#output_all_old_new_renamed_files_count) | string | Returns the number of `all_old_new_renamed_files` |
|
||||
| <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have changed. i.e. <br>*includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| <a name="output_any_deleted"></a>[any\_deleted](#output_any_deleted) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been deleted. <br>(D) |
|
||||
| <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs has been modified. <br>i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
|
||||
| <a name="output_changed_keys"></a>[changed\_keys](#output_changed_keys) | string | Returns all changed YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)* |
|
||||
| <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have changed. This <br>defaults to `true` when no <br>patterns are specified. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| <a name="output_any_deleted"></a>[any\_deleted](#output_any_deleted) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been deleted. <br>This defaults to `true` when <br>no patterns are specified. (D) |
|
||||
| <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been modified. <br>This defaults to `true` when <br>no patterns are specified. i.e. <br>*includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
|
||||
| <a name="output_changed_keys"></a>[changed\_keys](#output_changed_keys) | string | Returns all changed YAML keys <br>when the `files_yaml` input is <br>used. i.e. key that contains <br>any path that has either <br>been added, copied, modified, and <br>renamed (ACMR) |
|
||||
| <a name="output_copied_files"></a>[copied\_files](#output_copied_files) | string | Returns only files that are <br>Copied (C). |
|
||||
| <a name="output_copied_files_count"></a>[copied\_files\_count](#output_copied_files_count) | string | Returns the number of `copied_files` |
|
||||
| <a name="output_deleted_files"></a>[deleted\_files](#output_deleted_files) | string | Returns only files that are <br>Deleted (D). |
|
||||
| <a name="output_deleted_files_count"></a>[deleted\_files\_count](#output_deleted_files_count) | string | Returns the number of `deleted_files` |
|
||||
| <a name="output_modified_files"></a>[modified\_files](#output_modified_files) | string | Returns only files that are <br>Modified (M). |
|
||||
| <a name="output_modified_files_count"></a>[modified\_files\_count](#output_modified_files_count) | string | Returns the number of `modified_files` |
|
||||
| <a name="output_modified_keys"></a>[modified\_keys](#output_modified_keys) | string | Returns all modified YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)* |
|
||||
| <a name="output_modified_keys"></a>[modified\_keys](#output_modified_keys) | string | Returns all modified YAML keys <br>when the `files_yaml` input is <br>used. i.e. key that contains <br>any path that has either <br>been added, copied, modified, and <br>deleted (ACMRD) |
|
||||
| <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| <a name="output_only_deleted"></a>[only\_deleted](#output_only_deleted) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been deleted. (D) |
|
||||
| <a name="output_only_modified"></a>[only\_modified](#output_only_modified) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>has been modified. (ACMRD). |
|
||||
| <a name="output_other_changed_files"></a>[other\_changed\_files](#output_other_changed_files) | string | Returns all other changed files <br>not listed in the files <br>input i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||
| <a name="output_only_deleted"></a>[only\_deleted](#output_only_deleted) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have been deleted. (D) |
|
||||
| <a name="output_only_modified"></a>[only\_modified](#output_only_modified) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have been modified. (ACMRD). |
|
||||
| <a name="output_other_changed_files"></a>[other\_changed\_files](#output_other_changed_files) | string | Returns all other changed files <br>not listed in the files <br>input i.e. includes a combination <br>of all added, copied, modified <br>and renamed files (ACMR). |
|
||||
| <a name="output_other_changed_files_count"></a>[other\_changed\_files\_count](#output_other_changed_files_count) | string | Returns the number of `other_changed_files` |
|
||||
| <a name="output_other_deleted_files"></a>[other\_deleted\_files](#output_other_deleted_files) | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* |
|
||||
| <a name="output_other_deleted_files"></a>[other\_deleted\_files](#output_other_deleted_files) | string | Returns all other deleted files <br>not listed in the files <br>input i.e. a combination of <br>all deleted files (D) |
|
||||
| <a name="output_other_deleted_files_count"></a>[other\_deleted\_files\_count](#output_other_deleted_files_count) | string | Returns the number of `other_deleted_files` |
|
||||
| <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
|
||||
| <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. a combination of <br>all added, copied, modified, and <br>deleted files (ACMRD) |
|
||||
| <a name="output_other_modified_files_count"></a>[other\_modified\_files\_count](#output_other_modified_files_count) | string | Returns the number of `other_modified_files` |
|
||||
| <a name="output_renamed_files"></a>[renamed\_files](#output_renamed_files) | string | Returns only files that are <br>Renamed (R). |
|
||||
| <a name="output_renamed_files_count"></a>[renamed\_files\_count](#output_renamed_files_count) | string | Returns the number of `renamed_files` |
|
||||
@@ -724,7 +722,7 @@ The format of the version string is as follows:
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
...
|
||||
```
|
||||
|
||||
@@ -737,7 +735,7 @@ The format of the version string is as follows:
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
|
||||
|
||||
@@ -760,7 +758,7 @@ The format of the version string is as follows:
|
||||
...
|
||||
- name: Get all changed files and use a comma separator in the output
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
separator: ","
|
||||
...
|
||||
@@ -777,7 +775,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
|
||||
- name: List all added files
|
||||
env:
|
||||
@@ -800,7 +798,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
|
||||
- name: Run a step if my-file.txt was modified
|
||||
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
|
||||
@@ -821,7 +819,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
|
||||
- name: Get changed files and write the outputs to a Txt file
|
||||
id: changed-files-write-output-files-txt
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
write_output_files: true
|
||||
|
||||
@@ -840,7 +838,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files and write the outputs to a JSON file
|
||||
id: changed-files-write-output-files-json
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
json: true
|
||||
write_output_files: true
|
||||
@@ -860,7 +858,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -883,7 +881,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -934,7 +932,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files using a source file or list of file(s) to populate to files input.
|
||||
id: changed-files-specific-source-file
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files_from_source_file: test/changed-files-list.txt
|
||||
...
|
||||
@@ -951,7 +949,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files.
|
||||
id: changed-files-specific-source-file-and-specify-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -972,7 +970,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
sha: ${{ github.event.pull_request.head.sha }}
|
||||
...
|
||||
@@ -989,7 +987,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different base SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
||||
...
|
||||
@@ -1021,7 +1019,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
|
||||
- name: List changed files
|
||||
env:
|
||||
@@ -1031,7 +1029,7 @@ jobs:
|
||||
|
||||
- name: Get changed files in the .github folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: .github/**
|
||||
|
||||
@@ -1062,14 +1060,13 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with defaults in dir1
|
||||
id: changed-files-for-dir1
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
- name: List all added files in dir1
|
||||
env:
|
||||
ADDED_FILES: |-
|
||||
${{ steps.changed-files-for-dir1.outputs.added_files }}
|
||||
ADDED_FILES: ${{ steps.changed-files-for-dir1.outputs.added_files }}
|
||||
run: |
|
||||
for file in ${ADDED_FILES}; do
|
||||
echo "$file was added"
|
||||
@@ -1088,13 +1085,13 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with quotepath disabled
|
||||
id: changed-files-quotepath
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
quotepath: "false"
|
||||
|
||||
- name: Run changed-files with quotepath disabled for a specified list of file(s)
|
||||
id: changed-files-quotepath-specific
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: test/test-è.txt
|
||||
quotepath: "false"
|
||||
@@ -1127,7 +1124,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run
|
||||
id: changed-files-base-sha-push
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||
...
|
||||
@@ -1154,7 +1151,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run on the main branch
|
||||
id: changed-files-base-sha-pull-request
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
||||
...
|
||||
@@ -1180,7 +1177,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with dir_names
|
||||
id: changed-files-dir-names
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
dir_names: "true"
|
||||
...
|
||||
@@ -1197,7 +1194,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with JSON output
|
||||
id: changed-files-json
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
json: "true"
|
||||
...
|
||||
@@ -1214,13 +1211,13 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed-files since 2022-08-19
|
||||
id: changed-files-since
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
since: "2022-08-19"
|
||||
|
||||
- name: Get changed-files until 2022-08-20
|
||||
id: changed-files-until
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
until: "2022-08-20"
|
||||
...
|
||||
@@ -1252,7 +1249,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
* [qmk\_firmware uses tj-actions/changed-files to run linters](https://github.com/qmk/qmk_firmware/blob/7a737235ffd49c32d2c5561e8fe53fd96baa7f96/.github/workflows/lint.yml#L30)
|
||||
|
||||
* [argo-cd uses tj-actions/chnaged-files to detect changed frontend or backend files](https://github.com/argoproj/argo-cd/blob/5bc1850aa1d26301043be9f2fb825d88c80c111c/.github/workflows/ci-build.yaml#L33)
|
||||
* [argo-cd uses tj-actions/changed-files to detect changed frontend or backend files](https://github.com/argoproj/argo-cd/blob/5bc1850aa1d26301043be9f2fb825d88c80c111c/.github/workflows/ci-build.yaml#L33)
|
||||
|
||||
* [argo-workflows uses tj-actions/changed-files to run specific jobs based on changes detected](https://github.com/argoproj/argo-workflows/blob/baef4856ff2603c76dbe277c825eaa3f9788fc91/.github/workflows/ci-build.yaml#L34)
|
||||
|
||||
@@ -1309,7 +1306,7 @@ Report bugs at https://github.com/tj-actions/changed-files/issues.
|
||||
If you are reporting a bug, please include:
|
||||
|
||||
* Your operating system name and version.
|
||||
* Any details about your workflow that might be helpful in troubleshooting. (**NOTE**: Ensure that you include full log outputs with debugging enabled)
|
||||
* All essential details about your workflow that might be helpful in troubleshooting. (**NOTE**: Ensure that you include full log outputs with debugging enabled)
|
||||
* Detailed steps to reproduce the bug.
|
||||
|
||||
## Contributors ✨
|
||||
|
||||
26
action.yml
26
action.yml
@@ -262,45 +262,45 @@ outputs:
|
||||
unknown_files_count:
|
||||
description: "Returns the number of `unknown_files`"
|
||||
all_changed_and_modified_files:
|
||||
description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*"
|
||||
description: "Returns all changed and modified files i.e. a combination of (ACMRDTUX)"
|
||||
all_changed_and_modified_files_count:
|
||||
description: "Returns the number of `all_changed_and_modified_files`"
|
||||
all_changed_files:
|
||||
description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*"
|
||||
description: "Returns all changed files i.e. a combination of all added, copied, modified and renamed files (ACMR)"
|
||||
all_changed_files_count:
|
||||
description: "Returns the number of `all_changed_files`"
|
||||
any_changed:
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have changed. This defaults to `true` when no patterns are specified. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
only_changed:
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
other_changed_files:
|
||||
description: "Returns all other changed files not listed in the files input i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||
description: "Returns all other changed files not listed in the files input i.e. includes a combination of all added, copied, modified and renamed files (ACMR)."
|
||||
other_changed_files_count:
|
||||
description: "Returns the number of `other_changed_files`"
|
||||
all_modified_files:
|
||||
description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*."
|
||||
description: "Returns all changed files i.e. a combination of all added, copied, modified, renamed and deleted files (ACMRD)."
|
||||
all_modified_files_count:
|
||||
description: "Returns the number of `all_modified_files`"
|
||||
any_modified:
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been modified. This defaults to `true` when no patterns are specified. i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
|
||||
only_modified:
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)."
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been modified. (ACMRD)."
|
||||
other_modified_files:
|
||||
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
|
||||
description: "Returns all other modified files not listed in the files input i.e. a combination of all added, copied, modified, and deleted files (ACMRD)"
|
||||
other_modified_files_count:
|
||||
description: "Returns the number of `other_modified_files`"
|
||||
any_deleted:
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
|
||||
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been deleted. This defaults to `true` when no patterns are specified. (D)"
|
||||
only_deleted:
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
|
||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been deleted. (D)"
|
||||
other_deleted_files:
|
||||
description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
|
||||
description: "Returns all other deleted files not listed in the files input i.e. a combination of all deleted files (D)"
|
||||
other_deleted_files_count:
|
||||
description: "Returns the number of `other_deleted_files`"
|
||||
modified_keys:
|
||||
description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)*"
|
||||
description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and deleted (ACMRD)"
|
||||
changed_keys:
|
||||
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)*"
|
||||
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and renamed (ACMR)"
|
||||
|
||||
runs:
|
||||
using: 'node20'
|
||||
|
||||
406
dist/index.js
generated
vendored
406
dist/index.js
generated
vendored
@@ -637,7 +637,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = (_a) => __awaiter(void 0,
|
||||
});
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: (0, utils_1.getOutputKey)('any_changed', outputPrefix),
|
||||
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
value: allChangedFiles.paths.length > 0,
|
||||
writeOutputFiles: inputs.writeOutputFiles,
|
||||
outputDir: inputs.outputDir,
|
||||
json: inputs.json
|
||||
@@ -707,7 +707,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = (_a) => __awaiter(void 0,
|
||||
});
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: (0, utils_1.getOutputKey)('any_modified', outputPrefix),
|
||||
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
value: allModifiedFiles.paths.length > 0,
|
||||
writeOutputFiles: inputs.writeOutputFiles,
|
||||
outputDir: inputs.outputDir,
|
||||
json: inputs.json
|
||||
@@ -789,7 +789,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = (_a) => __awaiter(void 0,
|
||||
});
|
||||
yield (0, utils_1.setOutput)({
|
||||
key: (0, utils_1.getOutputKey)('any_deleted', outputPrefix),
|
||||
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
value: deletedFiles.paths.length > 0,
|
||||
writeOutputFiles: inputs.writeOutputFiles,
|
||||
outputDir: inputs.outputDir,
|
||||
json: inputs.json
|
||||
@@ -825,8 +825,8 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = (_a) => __awaiter(void 0,
|
||||
outputDir: inputs.outputDir
|
||||
});
|
||||
return {
|
||||
anyModified: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
anyChanged: allChangedFiles.paths.length > 0 && filePatterns.length > 0
|
||||
anyModified: allModifiedFiles.paths.length > 0,
|
||||
anyChanged: allChangedFiles.paths.length > 0
|
||||
};
|
||||
});
|
||||
exports.setOutputsAndGetModifiedAndChangedFilesStatus = setOutputsAndGetModifiedAndChangedFilesStatus;
|
||||
@@ -927,8 +927,8 @@ const getCurrentSHA = (_a) => __awaiter(void 0, [_a], void 0, function* ({ input
|
||||
core.debug(`Current SHA: ${currentSha}`);
|
||||
return currentSha;
|
||||
});
|
||||
const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, isTag) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
var _j, _k, _l;
|
||||
const getSHAForNonPullRequestEvent = (_j) => __awaiter(void 0, [_j], void 0, function* ({ inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, isTag, remoteName }) {
|
||||
var _k, _l, _m;
|
||||
let targetBranch = env.GITHUB_REF_NAME;
|
||||
let currentBranch = targetBranch;
|
||||
let initialCommit = false;
|
||||
@@ -940,8 +940,8 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
||||
if (github.context.payload.base_ref) {
|
||||
sourceBranch = github.context.payload.base_ref.replace('refs/heads/', '');
|
||||
}
|
||||
else if ((_j = github.context.payload.release) === null || _j === void 0 ? void 0 : _j.target_commitish) {
|
||||
sourceBranch = (_k = github.context.payload.release) === null || _k === void 0 ? void 0 : _k.target_commitish;
|
||||
else if ((_k = github.context.payload.release) === null || _k === void 0 ? void 0 : _k.target_commitish) {
|
||||
sourceBranch = (_l = github.context.payload.release) === null || _l === void 0 ? void 0 : _l.target_commitish;
|
||||
}
|
||||
yield (0, utils_1.gitFetch)({
|
||||
cwd: workingDirectory,
|
||||
@@ -950,8 +950,8 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${sourceBranch}:refs/remotes/origin/${sourceBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${sourceBranch}:refs/remotes/${remoteName}/${sourceBranch}`
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -963,8 +963,8 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
||||
else {
|
||||
if (github.context.eventName === 'merge_group') {
|
||||
core.debug('Getting previous SHA for merge group...');
|
||||
previousSha = (_l = github.context.payload.merge_group) === null || _l === void 0 ? void 0 : _l.base_sha;
|
||||
previousSha = (_m = github.context.payload.merge_group) === null || _m === void 0 ? void 0 : _m.base_sha;
|
||||
}
|
||||
else {
|
||||
core.debug('Getting previous SHA for last remote commit...');
|
||||
@@ -1107,10 +1107,10 @@ const getSHAForNonPullRequestEvent = (inputs, env, workingDirectory, isShallow,
|
||||
};
|
||||
});
|
||||
exports.getSHAForNonPullRequestEvent = getSHAForNonPullRequestEvent;
|
||||
const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
var _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
||||
let targetBranch = (_o = (_m = github.context.payload.pull_request) === null || _m === void 0 ? void 0 : _m.base) === null || _o === void 0 ? void 0 : _o.ref;
|
||||
const currentBranch = (_q = (_p = github.context.payload.pull_request) === null || _p === void 0 ? void 0 : _p.head) === null || _q === void 0 ? void 0 : _q.ref;
|
||||
const getSHAForPullRequestEvent = (_o) => __awaiter(void 0, [_o], void 0, function* ({ inputs, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, remoteName }) {
|
||||
var _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
||||
let targetBranch = (_q = (_p = github.context.payload.pull_request) === null || _p === void 0 ? void 0 : _p.base) === null || _q === void 0 ? void 0 : _q.ref;
|
||||
const currentBranch = (_s = (_r = github.context.payload.pull_request) === null || _r === void 0 ? void 0 : _r.head) === null || _s === void 0 ? void 0 : _s.ref;
|
||||
if (inputs.sinceLastRemoteCommit) {
|
||||
targetBranch = currentBranch;
|
||||
}
|
||||
@@ -1123,8 +1123,8 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
'origin',
|
||||
`pull/${(_r = github.context.payload.pull_request) === null || _r === void 0 ? void 0 : _r.number}/head:${currentBranch}`
|
||||
remoteName,
|
||||
`pull/${(_t = github.context.payload.pull_request) === null || _t === void 0 ? void 0 : _t.number}/head:${currentBranch}`
|
||||
]
|
||||
});
|
||||
if (prFetchExitCode !== 0) {
|
||||
@@ -1135,8 +1135,8 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${currentBranch}*:refs/remotes/origin/${currentBranch}*`
|
||||
remoteName,
|
||||
`+refs/heads/${currentBranch}*:refs/remotes/${remoteName}/${currentBranch}*`
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -1152,8 +1152,8 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||
]
|
||||
});
|
||||
if (hasSubmodule) {
|
||||
@@ -1206,8 +1206,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
diff
|
||||
};
|
||||
}
|
||||
if (!((_t = (_s = github.context.payload.pull_request) === null || _s === void 0 ? void 0 : _s.base) === null || _t === void 0 ? void 0 : _t.ref) ||
|
||||
((_w = (_v = (_u = github.context.payload.pull_request) === null || _u === void 0 ? void 0 : _u.head) === null || _v === void 0 ? void 0 : _v.repo) === null || _w === void 0 ? void 0 : _w.fork) === true) {
|
||||
if (!((_v = (_u = github.context.payload.pull_request) === null || _u === void 0 ? void 0 : _u.base) === null || _v === void 0 ? void 0 : _v.ref)) {
|
||||
diff = '..';
|
||||
}
|
||||
if (!previousSha || previousSha === currentSha) {
|
||||
@@ -1248,17 +1247,13 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (github.context.payload.action === 'closed') {
|
||||
previousSha = (_y = (_x = github.context.payload.pull_request) === null || _x === void 0 ? void 0 : _x.base) === null || _y === void 0 ? void 0 : _y.sha;
|
||||
}
|
||||
else {
|
||||
previousSha = (_x = (_w = github.context.payload.pull_request) === null || _w === void 0 ? void 0 : _w.base) === null || _x === void 0 ? void 0 : _x.sha;
|
||||
if (!previousSha) {
|
||||
previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({
|
||||
cwd: workingDirectory,
|
||||
remoteName,
|
||||
branch: targetBranch
|
||||
});
|
||||
if (!previousSha) {
|
||||
previousSha = (_0 = (_z = github.context.payload.pull_request) === null || _z === void 0 ? void 0 : _z.base) === null || _0 === void 0 ? void 0 : _0.sha;
|
||||
}
|
||||
}
|
||||
if (isShallow) {
|
||||
if (!(yield (0, utils_1.canDiffCommits)({
|
||||
@@ -1276,8 +1271,8 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||
]
|
||||
});
|
||||
if (yield (0, utils_1.canDiffCommits)({
|
||||
@@ -1295,7 +1290,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
||||
}
|
||||
}
|
||||
if (!previousSha || previousSha === currentSha) {
|
||||
previousSha = (_2 = (_1 = github.context.payload.pull_request) === null || _1 === void 0 ? void 0 : _1.base) === null || _2 === void 0 ? void 0 : _2.sha;
|
||||
previousSha = (_z = (_y = github.context.payload.pull_request) === null || _y === void 0 ? void 0 : _y.base) === null || _z === void 0 ? void 0 : _z.sha;
|
||||
}
|
||||
}
|
||||
if (!(yield (0, utils_1.canDiffCommits)({
|
||||
@@ -1650,6 +1645,7 @@ const getInputs = () => {
|
||||
useRestApi
|
||||
};
|
||||
if (fetchDepth) {
|
||||
// Fallback to at least 2 if the fetch_depth is less than 2
|
||||
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2);
|
||||
}
|
||||
if (dirNamesMaxDepth) {
|
||||
@@ -1731,8 +1727,12 @@ const getChangedFilesFromLocalGitHistory = (_a) => __awaiter(void 0, [_a], void
|
||||
}
|
||||
const isShallow = yield (0, utils_1.isRepoShallow)({ cwd: workingDirectory });
|
||||
const hasSubmodule = yield (0, utils_1.submoduleExists)({ cwd: workingDirectory });
|
||||
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules'];
|
||||
let gitFetchExtraArgs = ['--no-tags', '--prune'];
|
||||
if (hasSubmodule) {
|
||||
gitFetchExtraArgs.push('--recurse-submodules');
|
||||
}
|
||||
const isTag = (_b = env.GITHUB_REF) === null || _b === void 0 ? void 0 : _b.startsWith('refs/tags/');
|
||||
const remoteName = 'origin';
|
||||
const outputRenamedFilesAsDeletedAndAdded = inputs.outputRenamedFilesAsDeletedAndAdded;
|
||||
let submodulePaths = [];
|
||||
if (hasSubmodule) {
|
||||
@@ -1744,11 +1744,27 @@ const getChangedFilesFromLocalGitHistory = (_a) => __awaiter(void 0, [_a], void
|
||||
let diffResult;
|
||||
if (!((_d = (_c = github.context.payload.pull_request) === null || _c === void 0 ? void 0 : _c.base) === null || _d === void 0 ? void 0 : _d.ref)) {
|
||||
core.info(`Running on a ${github.context.eventName || 'push'} event...`);
|
||||
diffResult = yield (0, commitSha_1.getSHAForNonPullRequestEvent)(inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs, isTag);
|
||||
diffResult = yield (0, commitSha_1.getSHAForNonPullRequestEvent)({
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitFetchExtraArgs,
|
||||
isTag,
|
||||
remoteName
|
||||
});
|
||||
}
|
||||
else {
|
||||
core.info(`Running on a ${github.context.eventName || 'pull_request'} (${github.context.payload.action}) event...`);
|
||||
diffResult = yield (0, commitSha_1.getSHAForPullRequestEvent)(inputs, env, workingDirectory, isShallow, hasSubmodule, gitFetchExtraArgs);
|
||||
diffResult = yield (0, commitSha_1.getSHAForPullRequestEvent)({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitFetchExtraArgs,
|
||||
remoteName
|
||||
});
|
||||
}
|
||||
if (diffResult.initialCommit) {
|
||||
core.info('This is the first commit for this repository; exiting...');
|
||||
@@ -2461,14 +2477,11 @@ const isInsideWorkTree = (_0) => __awaiter(void 0, [_0], void 0, function* ({ cw
|
||||
ignoreReturnCode: true,
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
if (stdout.trim() !== 'true') {
|
||||
core.warning(`The current working directory is not inside a git repository: ${cwd}`);
|
||||
}
|
||||
return stdout.trim() === 'true';
|
||||
});
|
||||
exports.isInsideWorkTree = isInsideWorkTree;
|
||||
const getRemoteBranchHeadSha = (_1) => __awaiter(void 0, [_1], void 0, function* ({ cwd, branch }) {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `origin/${branch}`], {
|
||||
const getRemoteBranchHeadSha = (_1) => __awaiter(void 0, [_1], void 0, function* ({ cwd, branch, remoteName }) {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', `${remoteName}/${branch}`], {
|
||||
cwd,
|
||||
silent: !core.isDebug()
|
||||
});
|
||||
@@ -6413,7 +6426,7 @@ var import_graphql = __nccwpck_require__(8467);
|
||||
var import_auth_token = __nccwpck_require__(334);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "5.1.0";
|
||||
var VERSION = "5.2.0";
|
||||
|
||||
// pkg/dist-src/index.js
|
||||
var noop = () => {
|
||||
@@ -6580,7 +6593,7 @@ module.exports = __toCommonJS(dist_src_exports);
|
||||
var import_universal_user_agent = __nccwpck_require__(5030);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "9.0.4";
|
||||
var VERSION = "9.0.5";
|
||||
|
||||
// pkg/dist-src/defaults.js
|
||||
var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
|
||||
@@ -6965,7 +6978,7 @@ var import_request3 = __nccwpck_require__(6234);
|
||||
var import_universal_user_agent = __nccwpck_require__(5030);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "7.0.2";
|
||||
var VERSION = "7.1.0";
|
||||
|
||||
// pkg/dist-src/with-defaults.js
|
||||
var import_request2 = __nccwpck_require__(6234);
|
||||
@@ -9790,7 +9803,7 @@ var import_endpoint = __nccwpck_require__(9440);
|
||||
var import_universal_user_agent = __nccwpck_require__(5030);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "8.2.0";
|
||||
var VERSION = "8.3.1";
|
||||
|
||||
// pkg/dist-src/is-plain-object.js
|
||||
function isPlainObject(value) {
|
||||
@@ -38597,6 +38610,132 @@ function onConnectTimeout (socket) {
|
||||
module.exports = buildConnector
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4462:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/** @type {Record<string, string | undefined>} */
|
||||
const headerNameLowerCasedRecord = {}
|
||||
|
||||
// https://developer.mozilla.org/docs/Web/HTTP/Headers
|
||||
const wellknownHeaderNames = [
|
||||
'Accept',
|
||||
'Accept-Encoding',
|
||||
'Accept-Language',
|
||||
'Accept-Ranges',
|
||||
'Access-Control-Allow-Credentials',
|
||||
'Access-Control-Allow-Headers',
|
||||
'Access-Control-Allow-Methods',
|
||||
'Access-Control-Allow-Origin',
|
||||
'Access-Control-Expose-Headers',
|
||||
'Access-Control-Max-Age',
|
||||
'Access-Control-Request-Headers',
|
||||
'Access-Control-Request-Method',
|
||||
'Age',
|
||||
'Allow',
|
||||
'Alt-Svc',
|
||||
'Alt-Used',
|
||||
'Authorization',
|
||||
'Cache-Control',
|
||||
'Clear-Site-Data',
|
||||
'Connection',
|
||||
'Content-Disposition',
|
||||
'Content-Encoding',
|
||||
'Content-Language',
|
||||
'Content-Length',
|
||||
'Content-Location',
|
||||
'Content-Range',
|
||||
'Content-Security-Policy',
|
||||
'Content-Security-Policy-Report-Only',
|
||||
'Content-Type',
|
||||
'Cookie',
|
||||
'Cross-Origin-Embedder-Policy',
|
||||
'Cross-Origin-Opener-Policy',
|
||||
'Cross-Origin-Resource-Policy',
|
||||
'Date',
|
||||
'Device-Memory',
|
||||
'Downlink',
|
||||
'ECT',
|
||||
'ETag',
|
||||
'Expect',
|
||||
'Expect-CT',
|
||||
'Expires',
|
||||
'Forwarded',
|
||||
'From',
|
||||
'Host',
|
||||
'If-Match',
|
||||
'If-Modified-Since',
|
||||
'If-None-Match',
|
||||
'If-Range',
|
||||
'If-Unmodified-Since',
|
||||
'Keep-Alive',
|
||||
'Last-Modified',
|
||||
'Link',
|
||||
'Location',
|
||||
'Max-Forwards',
|
||||
'Origin',
|
||||
'Permissions-Policy',
|
||||
'Pragma',
|
||||
'Proxy-Authenticate',
|
||||
'Proxy-Authorization',
|
||||
'RTT',
|
||||
'Range',
|
||||
'Referer',
|
||||
'Referrer-Policy',
|
||||
'Refresh',
|
||||
'Retry-After',
|
||||
'Sec-WebSocket-Accept',
|
||||
'Sec-WebSocket-Extensions',
|
||||
'Sec-WebSocket-Key',
|
||||
'Sec-WebSocket-Protocol',
|
||||
'Sec-WebSocket-Version',
|
||||
'Server',
|
||||
'Server-Timing',
|
||||
'Service-Worker-Allowed',
|
||||
'Service-Worker-Navigation-Preload',
|
||||
'Set-Cookie',
|
||||
'SourceMap',
|
||||
'Strict-Transport-Security',
|
||||
'Supports-Loading-Mode',
|
||||
'TE',
|
||||
'Timing-Allow-Origin',
|
||||
'Trailer',
|
||||
'Transfer-Encoding',
|
||||
'Upgrade',
|
||||
'Upgrade-Insecure-Requests',
|
||||
'User-Agent',
|
||||
'Vary',
|
||||
'Via',
|
||||
'WWW-Authenticate',
|
||||
'X-Content-Type-Options',
|
||||
'X-DNS-Prefetch-Control',
|
||||
'X-Frame-Options',
|
||||
'X-Permitted-Cross-Domain-Policies',
|
||||
'X-Powered-By',
|
||||
'X-Requested-With',
|
||||
'X-XSS-Protection'
|
||||
]
|
||||
|
||||
for (let i = 0; i < wellknownHeaderNames.length; ++i) {
|
||||
const key = wellknownHeaderNames[i]
|
||||
const lowerCasedKey = key.toLowerCase()
|
||||
headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
|
||||
lowerCasedKey
|
||||
}
|
||||
|
||||
// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
|
||||
Object.setPrototypeOf(headerNameLowerCasedRecord, null)
|
||||
|
||||
module.exports = {
|
||||
wellknownHeaderNames,
|
||||
headerNameLowerCasedRecord
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8045:
|
||||
@@ -39429,6 +39568,7 @@ const { InvalidArgumentError } = __nccwpck_require__(8045)
|
||||
const { Blob } = __nccwpck_require__(4300)
|
||||
const nodeUtil = __nccwpck_require__(3837)
|
||||
const { stringify } = __nccwpck_require__(3477)
|
||||
const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
|
||||
|
||||
const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
|
||||
|
||||
@@ -39638,6 +39778,15 @@ function parseKeepAliveTimeout (val) {
|
||||
return m ? parseInt(m[1], 10) * 1000 : null
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a header name and returns its lowercase value.
|
||||
* @param {string | Buffer} value Header name
|
||||
* @returns {string}
|
||||
*/
|
||||
function headerNameToString (value) {
|
||||
return headerNameLowerCasedRecord[value] || value.toLowerCase()
|
||||
}
|
||||
|
||||
function parseHeaders (headers, obj = {}) {
|
||||
// For H2 support
|
||||
if (!Array.isArray(headers)) return headers
|
||||
@@ -39909,6 +40058,7 @@ module.exports = {
|
||||
isIterable,
|
||||
isAsyncIterable,
|
||||
isDestroyed,
|
||||
headerNameToString,
|
||||
parseRawHeaders,
|
||||
parseHeaders,
|
||||
parseKeepAliveTimeout,
|
||||
@@ -46556,14 +46706,18 @@ const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983
|
||||
const assert = __nccwpck_require__(9491)
|
||||
const { isUint8Array } = __nccwpck_require__(9830)
|
||||
|
||||
let supportedHashes = []
|
||||
|
||||
// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
|
||||
/** @type {import('crypto')|undefined} */
|
||||
let crypto
|
||||
|
||||
try {
|
||||
crypto = __nccwpck_require__(6113)
|
||||
const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
|
||||
supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
|
||||
/* c8 ignore next 3 */
|
||||
} catch {
|
||||
|
||||
}
|
||||
|
||||
function responseURL (response) {
|
||||
@@ -47091,66 +47245,56 @@ function bytesMatch (bytes, metadataList) {
|
||||
return true
|
||||
}
|
||||
|
||||
// 3. If parsedMetadata is the empty set, return true.
|
||||
// 3. If response is not eligible for integrity validation, return false.
|
||||
// TODO
|
||||
|
||||
// 4. If parsedMetadata is the empty set, return true.
|
||||
if (parsedMetadata.length === 0) {
|
||||
return true
|
||||
}
|
||||
|
||||
// 4. Let metadata be the result of getting the strongest
|
||||
// 5. Let metadata be the result of getting the strongest
|
||||
// metadata from parsedMetadata.
|
||||
const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo))
|
||||
// get the strongest algorithm
|
||||
const strongest = list[0].algo
|
||||
// get all entries that use the strongest algorithm; ignore weaker
|
||||
const metadata = list.filter((item) => item.algo === strongest)
|
||||
const strongest = getStrongestMetadata(parsedMetadata)
|
||||
const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
|
||||
|
||||
// 5. For each item in metadata:
|
||||
// 6. For each item in metadata:
|
||||
for (const item of metadata) {
|
||||
// 1. Let algorithm be the alg component of item.
|
||||
const algorithm = item.algo
|
||||
|
||||
// 2. Let expectedValue be the val component of item.
|
||||
let expectedValue = item.hash
|
||||
const expectedValue = item.hash
|
||||
|
||||
// See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
|
||||
// "be liberal with padding". This is annoying, and it's not even in the spec.
|
||||
|
||||
if (expectedValue.endsWith('==')) {
|
||||
expectedValue = expectedValue.slice(0, -2)
|
||||
}
|
||||
|
||||
// 3. Let actualValue be the result of applying algorithm to bytes.
|
||||
let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
|
||||
|
||||
if (actualValue.endsWith('==')) {
|
||||
actualValue = actualValue.slice(0, -2)
|
||||
if (actualValue[actualValue.length - 1] === '=') {
|
||||
if (actualValue[actualValue.length - 2] === '=') {
|
||||
actualValue = actualValue.slice(0, -2)
|
||||
} else {
|
||||
actualValue = actualValue.slice(0, -1)
|
||||
}
|
||||
}
|
||||
|
||||
// 4. If actualValue is a case-sensitive match for expectedValue,
|
||||
// return true.
|
||||
if (actualValue === expectedValue) {
|
||||
return true
|
||||
}
|
||||
|
||||
let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url')
|
||||
|
||||
if (actualBase64URL.endsWith('==')) {
|
||||
actualBase64URL = actualBase64URL.slice(0, -2)
|
||||
}
|
||||
|
||||
if (actualBase64URL === expectedValue) {
|
||||
if (compareBase64Mixed(actualValue, expectedValue)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Return false.
|
||||
// 7. Return false.
|
||||
return false
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
|
||||
// https://www.w3.org/TR/CSP2/#source-list-syntax
|
||||
// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
|
||||
const parseHashWithOptions = /((?<algo>sha256|sha384|sha512)-(?<hash>[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i
|
||||
const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
|
||||
|
||||
/**
|
||||
* @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
|
||||
@@ -47164,8 +47308,6 @@ function parseMetadata (metadata) {
|
||||
// 2. Let empty be equal to true.
|
||||
let empty = true
|
||||
|
||||
const supportedHashes = crypto.getHashes()
|
||||
|
||||
// 3. For each token returned by splitting metadata on spaces:
|
||||
for (const token of metadata.split(' ')) {
|
||||
// 1. Set empty to false.
|
||||
@@ -47175,7 +47317,11 @@ function parseMetadata (metadata) {
|
||||
const parsedToken = parseHashWithOptions.exec(token)
|
||||
|
||||
// 3. If token does not parse, continue to the next token.
|
||||
if (parsedToken === null || parsedToken.groups === undefined) {
|
||||
if (
|
||||
parsedToken === null ||
|
||||
parsedToken.groups === undefined ||
|
||||
parsedToken.groups.algo === undefined
|
||||
) {
|
||||
// Note: Chromium blocks the request at this point, but Firefox
|
||||
// gives a warning that an invalid integrity was given. The
|
||||
// correct behavior is to ignore these, and subsequently not
|
||||
@@ -47184,11 +47330,11 @@ function parseMetadata (metadata) {
|
||||
}
|
||||
|
||||
// 4. Let algorithm be the hash-algo component of token.
|
||||
const algorithm = parsedToken.groups.algo
|
||||
const algorithm = parsedToken.groups.algo.toLowerCase()
|
||||
|
||||
// 5. If algorithm is a hash function recognized by the user
|
||||
// agent, add the parsed token to result.
|
||||
if (supportedHashes.includes(algorithm.toLowerCase())) {
|
||||
if (supportedHashes.includes(algorithm)) {
|
||||
result.push(parsedToken.groups)
|
||||
}
|
||||
}
|
||||
@@ -47201,6 +47347,82 @@ function parseMetadata (metadata) {
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
|
||||
*/
|
||||
function getStrongestMetadata (metadataList) {
|
||||
// Let algorithm be the algo component of the first item in metadataList.
|
||||
// Can be sha256
|
||||
let algorithm = metadataList[0].algo
|
||||
// If the algorithm is sha512, then it is the strongest
|
||||
// and we can return immediately
|
||||
if (algorithm[3] === '5') {
|
||||
return algorithm
|
||||
}
|
||||
|
||||
for (let i = 1; i < metadataList.length; ++i) {
|
||||
const metadata = metadataList[i]
|
||||
// If the algorithm is sha512, then it is the strongest
|
||||
// and we can break the loop immediately
|
||||
if (metadata.algo[3] === '5') {
|
||||
algorithm = 'sha512'
|
||||
break
|
||||
// If the algorithm is sha384, then a potential sha256 or sha384 is ignored
|
||||
} else if (algorithm[3] === '3') {
|
||||
continue
|
||||
// algorithm is sha256, check if algorithm is sha384 and if so, set it as
|
||||
// the strongest
|
||||
} else if (metadata.algo[3] === '3') {
|
||||
algorithm = 'sha384'
|
||||
}
|
||||
}
|
||||
return algorithm
|
||||
}
|
||||
|
||||
function filterMetadataListByAlgorithm (metadataList, algorithm) {
|
||||
if (metadataList.length === 1) {
|
||||
return metadataList
|
||||
}
|
||||
|
||||
let pos = 0
|
||||
for (let i = 0; i < metadataList.length; ++i) {
|
||||
if (metadataList[i].algo === algorithm) {
|
||||
metadataList[pos++] = metadataList[i]
|
||||
}
|
||||
}
|
||||
|
||||
metadataList.length = pos
|
||||
|
||||
return metadataList
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two base64 strings, allowing for base64url
|
||||
* in the second string.
|
||||
*
|
||||
* @param {string} actualValue always base64
|
||||
* @param {string} expectedValue base64 or base64url
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function compareBase64Mixed (actualValue, expectedValue) {
|
||||
if (actualValue.length !== expectedValue.length) {
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < actualValue.length; ++i) {
|
||||
if (actualValue[i] !== expectedValue[i]) {
|
||||
if (
|
||||
(actualValue[i] === '+' && expectedValue[i] === '-') ||
|
||||
(actualValue[i] === '/' && expectedValue[i] === '_')
|
||||
) {
|
||||
continue
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
|
||||
function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
|
||||
// TODO
|
||||
@@ -47616,7 +47838,8 @@ module.exports = {
|
||||
urlHasHttpsScheme,
|
||||
urlIsHttpHttpsScheme,
|
||||
readAllBytes,
|
||||
normalizeMethodRecord
|
||||
normalizeMethodRecord,
|
||||
parseMetadata
|
||||
}
|
||||
|
||||
|
||||
@@ -49703,12 +49926,17 @@ function parseLocation (statusCode, headers) {
|
||||
|
||||
// https://tools.ietf.org/html/rfc7231#section-6.4.4
|
||||
function shouldRemoveHeader (header, removeContent, unknownOrigin) {
|
||||
return (
|
||||
(header.length === 4 && header.toString().toLowerCase() === 'host') ||
|
||||
(removeContent && header.toString().toLowerCase().indexOf('content-') === 0) ||
|
||||
(unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') ||
|
||||
(unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie')
|
||||
)
|
||||
if (header.length === 4) {
|
||||
return util.headerNameToString(header) === 'host'
|
||||
}
|
||||
if (removeContent && util.headerNameToString(header).startsWith('content-')) {
|
||||
return true
|
||||
}
|
||||
if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
|
||||
const name = util.headerNameToString(header)
|
||||
return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc7231#section-6.4
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tj-actions/changed-files",
|
||||
"version": "42.0.7",
|
||||
"version": "44.0.0",
|
||||
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
|
||||
"main": "lib/main.js",
|
||||
"publishConfig": {
|
||||
@@ -51,7 +51,7 @@
|
||||
"@vercel/ncc": "^0.38.0",
|
||||
"eslint": "^8.43.0",
|
||||
"eslint-plugin-github": "^4.8.0",
|
||||
"eslint-plugin-jest": "^27.2.2",
|
||||
"eslint-plugin-jest": "^28.0.0",
|
||||
"eslint-plugin-prettier": "^5.0.0-alpha.2",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"jest": "^29.5.0",
|
||||
|
||||
@@ -247,7 +247,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('any_changed', outputPrefix),
|
||||
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
value: allChangedFiles.paths.length > 0,
|
||||
writeOutputFiles: inputs.writeOutputFiles,
|
||||
outputDir: inputs.outputDir,
|
||||
json: inputs.json
|
||||
@@ -336,7 +336,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('any_modified', outputPrefix),
|
||||
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
value: allModifiedFiles.paths.length > 0,
|
||||
writeOutputFiles: inputs.writeOutputFiles,
|
||||
outputDir: inputs.outputDir,
|
||||
json: inputs.json
|
||||
@@ -442,7 +442,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
|
||||
|
||||
await setOutput({
|
||||
key: getOutputKey('any_deleted', outputPrefix),
|
||||
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
value: deletedFiles.paths.length > 0,
|
||||
writeOutputFiles: inputs.writeOutputFiles,
|
||||
outputDir: inputs.outputDir,
|
||||
json: inputs.json
|
||||
@@ -496,7 +496,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
|
||||
})
|
||||
|
||||
return {
|
||||
anyModified: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||
anyChanged: allChangedFiles.paths.length > 0 && filePatterns.length > 0
|
||||
anyModified: allModifiedFiles.paths.length > 0,
|
||||
anyChanged: allChangedFiles.paths.length > 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,15 +86,27 @@ export interface DiffResult {
|
||||
initialCommit?: boolean
|
||||
}
|
||||
|
||||
export const getSHAForNonPullRequestEvent = async (
|
||||
inputs: Inputs,
|
||||
env: Env,
|
||||
workingDirectory: string,
|
||||
isShallow: boolean,
|
||||
hasSubmodule: boolean,
|
||||
gitFetchExtraArgs: string[],
|
||||
interface SHAForNonPullRequestEvent {
|
||||
inputs: Inputs
|
||||
env: Env
|
||||
workingDirectory: string
|
||||
isShallow: boolean
|
||||
hasSubmodule: boolean
|
||||
gitFetchExtraArgs: string[]
|
||||
isTag: boolean
|
||||
): Promise<DiffResult> => {
|
||||
remoteName: string
|
||||
}
|
||||
|
||||
export const getSHAForNonPullRequestEvent = async ({
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitFetchExtraArgs,
|
||||
isTag,
|
||||
remoteName
|
||||
}: SHAForNonPullRequestEvent): Promise<DiffResult> => {
|
||||
let targetBranch = env.GITHUB_REF_NAME
|
||||
let currentBranch = targetBranch
|
||||
let initialCommit = false
|
||||
@@ -122,8 +134,8 @@ export const getSHAForNonPullRequestEvent = async (
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${sourceBranch}:refs/remotes/origin/${sourceBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${sourceBranch}:refs/remotes/${remoteName}/${sourceBranch}`
|
||||
]
|
||||
})
|
||||
} else {
|
||||
@@ -134,8 +146,8 @@ export const getSHAForNonPullRequestEvent = async (
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||
]
|
||||
})
|
||||
}
|
||||
@@ -307,14 +319,23 @@ export const getSHAForNonPullRequestEvent = async (
|
||||
}
|
||||
}
|
||||
|
||||
export const getSHAForPullRequestEvent = async (
|
||||
inputs: Inputs,
|
||||
env: Env,
|
||||
workingDirectory: string,
|
||||
isShallow: boolean,
|
||||
hasSubmodule: boolean,
|
||||
interface SHAForPullRequestEvent {
|
||||
inputs: Inputs
|
||||
workingDirectory: string
|
||||
isShallow: boolean
|
||||
hasSubmodule: boolean
|
||||
gitFetchExtraArgs: string[]
|
||||
): Promise<DiffResult> => {
|
||||
remoteName: string
|
||||
}
|
||||
|
||||
export const getSHAForPullRequestEvent = async ({
|
||||
inputs,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitFetchExtraArgs,
|
||||
remoteName
|
||||
}: SHAForPullRequestEvent): Promise<DiffResult> => {
|
||||
let targetBranch = github.context.payload.pull_request?.base?.ref
|
||||
const currentBranch = github.context.payload.pull_request?.head?.ref
|
||||
if (inputs.sinceLastRemoteCommit) {
|
||||
@@ -330,7 +351,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
...gitFetchExtraArgs,
|
||||
'-u',
|
||||
'--progress',
|
||||
'origin',
|
||||
remoteName,
|
||||
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
|
||||
]
|
||||
})
|
||||
@@ -343,8 +364,8 @@ export const getSHAForPullRequestEvent = async (
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${currentBranch}*:refs/remotes/origin/${currentBranch}*`
|
||||
remoteName,
|
||||
`+refs/heads/${currentBranch}*:refs/remotes/${remoteName}/${currentBranch}*`
|
||||
]
|
||||
})
|
||||
}
|
||||
@@ -364,8 +385,8 @@ export const getSHAForPullRequestEvent = async (
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||
]
|
||||
})
|
||||
|
||||
@@ -427,10 +448,7 @@ export const getSHAForPullRequestEvent = async (
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!github.context.payload.pull_request?.base?.ref ||
|
||||
github.context.payload.pull_request?.head?.repo?.fork === true
|
||||
) {
|
||||
if (!github.context.payload.pull_request?.base?.ref) {
|
||||
diff = '..'
|
||||
}
|
||||
|
||||
@@ -487,17 +505,14 @@ export const getSHAForPullRequestEvent = async (
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (github.context.payload.action === 'closed') {
|
||||
previousSha = github.context.payload.pull_request?.base?.sha
|
||||
} else {
|
||||
previousSha = github.context.payload.pull_request?.base?.sha
|
||||
|
||||
if (!previousSha) {
|
||||
previousSha = await getRemoteBranchHeadSha({
|
||||
cwd: workingDirectory,
|
||||
remoteName,
|
||||
branch: targetBranch
|
||||
})
|
||||
|
||||
if (!previousSha) {
|
||||
previousSha = github.context.payload.pull_request?.base?.sha
|
||||
}
|
||||
}
|
||||
|
||||
if (isShallow) {
|
||||
@@ -521,8 +536,8 @@ export const getSHAForPullRequestEvent = async (
|
||||
'-u',
|
||||
'--progress',
|
||||
`--deepen=${inputs.fetchDepth}`,
|
||||
'origin',
|
||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
||||
remoteName,
|
||||
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
@@ -297,6 +297,7 @@ export const getInputs = (): Inputs => {
|
||||
}
|
||||
|
||||
if (fetchDepth) {
|
||||
// Fallback to at least 2 if the fetch_depth is less than 2
|
||||
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2)
|
||||
}
|
||||
|
||||
|
||||
23
src/main.ts
23
src/main.ts
@@ -65,8 +65,14 @@ const getChangedFilesFromLocalGitHistory = async ({
|
||||
|
||||
const isShallow = await isRepoShallow({cwd: workingDirectory})
|
||||
const hasSubmodule = await submoduleExists({cwd: workingDirectory})
|
||||
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
|
||||
let gitFetchExtraArgs = ['--no-tags', '--prune']
|
||||
|
||||
if (hasSubmodule) {
|
||||
gitFetchExtraArgs.push('--recurse-submodules')
|
||||
}
|
||||
|
||||
const isTag = env.GITHUB_REF?.startsWith('refs/tags/')
|
||||
const remoteName = 'origin'
|
||||
const outputRenamedFilesAsDeletedAndAdded =
|
||||
inputs.outputRenamedFilesAsDeletedAndAdded
|
||||
let submodulePaths: string[] = []
|
||||
@@ -83,29 +89,30 @@ const getChangedFilesFromLocalGitHistory = async ({
|
||||
|
||||
if (!github.context.payload.pull_request?.base?.ref) {
|
||||
core.info(`Running on a ${github.context.eventName || 'push'} event...`)
|
||||
diffResult = await getSHAForNonPullRequestEvent(
|
||||
diffResult = await getSHAForNonPullRequestEvent({
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitFetchExtraArgs,
|
||||
isTag
|
||||
)
|
||||
isTag,
|
||||
remoteName
|
||||
})
|
||||
} else {
|
||||
core.info(
|
||||
`Running on a ${github.context.eventName || 'pull_request'} (${
|
||||
github.context.payload.action
|
||||
}) event...`
|
||||
)
|
||||
diffResult = await getSHAForPullRequestEvent(
|
||||
diffResult = await getSHAForPullRequestEvent({
|
||||
inputs,
|
||||
env,
|
||||
workingDirectory,
|
||||
isShallow,
|
||||
hasSubmodule,
|
||||
gitFetchExtraArgs
|
||||
)
|
||||
gitFetchExtraArgs,
|
||||
remoteName
|
||||
})
|
||||
}
|
||||
|
||||
if (diffResult.initialCommit) {
|
||||
|
||||
12
src/utils.ts
12
src/utils.ts
@@ -680,25 +680,21 @@ export const isInsideWorkTree = async ({
|
||||
}
|
||||
)
|
||||
|
||||
if (stdout.trim() !== 'true') {
|
||||
core.warning(
|
||||
`The current working directory is not inside a git repository: ${cwd}`
|
||||
)
|
||||
}
|
||||
|
||||
return stdout.trim() === 'true'
|
||||
}
|
||||
|
||||
export const getRemoteBranchHeadSha = async ({
|
||||
cwd,
|
||||
branch
|
||||
branch,
|
||||
remoteName
|
||||
}: {
|
||||
cwd: string
|
||||
branch: string
|
||||
remoteName: string
|
||||
}): Promise<string> => {
|
||||
const {stdout} = await exec.getExecOutput(
|
||||
'git',
|
||||
['rev-parse', `origin/${branch}`],
|
||||
['rev-parse', `${remoteName}/${branch}`],
|
||||
{
|
||||
cwd,
|
||||
silent: !core.isDebug()
|
||||
|
||||
Reference in New Issue
Block a user