Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a6dabf8d1 | ||
|
|
4f9f822a4a | ||
|
|
e5ceb2cea2 | ||
|
|
238f44e1cf | ||
|
|
dc4c7d50aa | ||
|
|
ebf889a3b1 | ||
|
|
45c8d9cb88 | ||
|
|
19b584354a |
@@ -169,6 +169,15 @@
|
|||||||
"code",
|
"code",
|
||||||
"doc"
|
"doc"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "cfernhout",
|
||||||
|
"name": "Chiel Fernhout",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/22294606?v=4",
|
||||||
|
"profile": "https://github.com/cfernhout",
|
||||||
|
"contributions": [
|
||||||
|
"doc"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
|||||||
74
HISTORY.md
74
HISTORY.md
@@ -2,19 +2,33 @@
|
|||||||
|
|
||||||
## [Unreleased](https://github.com/tj-actions/changed-files/tree/HEAD)
|
## [Unreleased](https://github.com/tj-actions/changed-files/tree/HEAD)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.1...HEAD)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.2...HEAD)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
- \[BUG\] v35.3.0 Fails to add \[\] around files when with:json: true [\#926](https://github.com/tj-actions/changed-files/issues/926)
|
- \[BUG\] v35.3.0 Fails to add \[\] around files when with:json: true [\#926](https://github.com/tj-actions/changed-files/issues/926)
|
||||||
|
|
||||||
## [v35.3.1](https://github.com/tj-actions/changed-files/tree/v35.3.1) (2023-01-05)
|
## [v35.3.2](https://github.com/tj-actions/changed-files/tree/v35.3.2) (2023-01-05)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35...v35.3.1)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35...v35.3.2)
|
||||||
|
|
||||||
## [v35](https://github.com/tj-actions/changed-files/tree/v35) (2023-01-05)
|
## [v35](https://github.com/tj-actions/changed-files/tree/v35) (2023-01-05)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.0...v35)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.1...v35)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- fix\(regression\): invalid json output. [\#930](https://github.com/tj-actions/changed-files/pull/930) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore\(deps\): update actions/checkout action to v3.3.0 [\#929](https://github.com/tj-actions/changed-files/pull/929) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Upgraded to v35.3.1 [\#928](https://github.com/tj-actions/changed-files/pull/928) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v35.3.1](https://github.com/tj-actions/changed-files/tree/v35.3.1) (2023-01-05)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.3.0...v35.3.1)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -29,10 +43,6 @@
|
|||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.2.1...v35.3.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v35.2.1...v35.3.0)
|
||||||
|
|
||||||
**Closed issues:**
|
|
||||||
|
|
||||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- fix: bug dirnames output [\#923](https://github.com/tj-actions/changed-files/pull/923) ([jackton1](https://github.com/jackton1))
|
- fix: bug dirnames output [\#923](https://github.com/tj-actions/changed-files/pull/923) ([jackton1](https://github.com/jackton1))
|
||||||
@@ -133,7 +143,7 @@
|
|||||||
|
|
||||||
## [v35.0.0](https://github.com/tj-actions/changed-files/tree/v35.0.0) (2022-12-19)
|
## [v35.0.0](https://github.com/tj-actions/changed-files/tree/v35.0.0) (2022-12-19)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.6.2...v35.0.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34...v35.0.0)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -151,13 +161,13 @@
|
|||||||
- fix: fail when the merge base is not found [\#879](https://github.com/tj-actions/changed-files/pull/879) ([jackton1](https://github.com/jackton1))
|
- fix: fail when the merge base is not found [\#879](https://github.com/tj-actions/changed-files/pull/879) ([jackton1](https://github.com/jackton1))
|
||||||
- Upgraded to v34.6.2 [\#878](https://github.com/tj-actions/changed-files/pull/878) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v34.6.2 [\#878](https://github.com/tj-actions/changed-files/pull/878) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v34.6.2](https://github.com/tj-actions/changed-files/tree/v34.6.2) (2022-12-16)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34...v34.6.2)
|
|
||||||
|
|
||||||
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-12-16)
|
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-12-16)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.6.1...v34)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.6.2...v34)
|
||||||
|
|
||||||
|
## [v34.6.2](https://github.com/tj-actions/changed-files/tree/v34.6.2) (2022-12-16)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.6.1...v34.6.2)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -379,7 +389,7 @@
|
|||||||
|
|
||||||
## [v34.3.3](https://github.com/tj-actions/changed-files/tree/v34.3.3) (2022-11-08)
|
## [v34.3.3](https://github.com/tj-actions/changed-files/tree/v34.3.3) (2022-11-08)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.2...v34.3.3)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.1...v34.3.3)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -394,13 +404,13 @@
|
|||||||
- chore: update readme [\#784](https://github.com/tj-actions/changed-files/pull/784) ([jackton1](https://github.com/jackton1))
|
- chore: update readme [\#784](https://github.com/tj-actions/changed-files/pull/784) ([jackton1](https://github.com/jackton1))
|
||||||
- Upgraded to v34.3.2 [\#781](https://github.com/tj-actions/changed-files/pull/781) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v34.3.2 [\#781](https://github.com/tj-actions/changed-files/pull/781) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v34.3.2](https://github.com/tj-actions/changed-files/tree/v34.3.2) (2022-11-07)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.1...v34.3.2)
|
|
||||||
|
|
||||||
## [v34.3.1](https://github.com/tj-actions/changed-files/tree/v34.3.1) (2022-11-07)
|
## [v34.3.1](https://github.com/tj-actions/changed-files/tree/v34.3.1) (2022-11-07)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.0...v34.3.1)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.2...v34.3.1)
|
||||||
|
|
||||||
|
## [v34.3.2](https://github.com/tj-actions/changed-files/tree/v34.3.2) (2022-11-07)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.0...v34.3.2)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -752,7 +762,7 @@
|
|||||||
|
|
||||||
## [v30.0.0](https://github.com/tj-actions/changed-files/tree/v30.0.0) (2022-09-24)
|
## [v30.0.0](https://github.com/tj-actions/changed-files/tree/v30.0.0) (2022-09-24)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.9...v30.0.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29...v30.0.0)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -768,13 +778,13 @@
|
|||||||
- chore\(deps\): update codacy/codacy-analysis-cli-action action to v4.2.0 [\#634](https://github.com/tj-actions/changed-files/pull/634) ([renovate[bot]](https://github.com/apps/renovate))
|
- chore\(deps\): update codacy/codacy-analysis-cli-action action to v4.2.0 [\#634](https://github.com/tj-actions/changed-files/pull/634) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
- Upgraded to v29.0.9 [\#633](https://github.com/tj-actions/changed-files/pull/633) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v29.0.9 [\#633](https://github.com/tj-actions/changed-files/pull/633) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v29.0.9](https://github.com/tj-actions/changed-files/tree/v29.0.9) (2022-09-20)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29...v29.0.9)
|
|
||||||
|
|
||||||
## [v29](https://github.com/tj-actions/changed-files/tree/v29) (2022-09-20)
|
## [v29](https://github.com/tj-actions/changed-files/tree/v29) (2022-09-20)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.8...v29)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.9...v29)
|
||||||
|
|
||||||
|
## [v29.0.9](https://github.com/tj-actions/changed-files/tree/v29.0.9) (2022-09-20)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.8...v29.0.9)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1699,7 +1709,7 @@
|
|||||||
|
|
||||||
## [v12](https://github.com/tj-actions/changed-files/tree/v12) (2021-12-14)
|
## [v12](https://github.com/tj-actions/changed-files/tree/v12) (2021-12-14)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.9...v12)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11...v12)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1717,13 +1727,13 @@
|
|||||||
- \[PR 1\]: Renamed all\_modified\_files to all\_changed\_files [\#283](https://github.com/tj-actions/changed-files/pull/283) ([jackton1](https://github.com/jackton1))
|
- \[PR 1\]: Renamed all\_modified\_files to all\_changed\_files [\#283](https://github.com/tj-actions/changed-files/pull/283) ([jackton1](https://github.com/jackton1))
|
||||||
- Upgraded to v11.9 [\#280](https://github.com/tj-actions/changed-files/pull/280) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v11.9 [\#280](https://github.com/tj-actions/changed-files/pull/280) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v11.9](https://github.com/tj-actions/changed-files/tree/v11.9) (2021-12-04)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11...v11.9)
|
|
||||||
|
|
||||||
## [v11](https://github.com/tj-actions/changed-files/tree/v11) (2021-12-04)
|
## [v11](https://github.com/tj-actions/changed-files/tree/v11) (2021-12-04)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.3.1...v11)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.9...v11)
|
||||||
|
|
||||||
|
## [v11.9](https://github.com/tj-actions/changed-files/tree/v11.9) (2021-12-04)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.3.1...v11.9)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||||
|
|
||||||
[](#contributors-)
|
[](#contributors-)
|
||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ Retrieve all changed files and directories relative to the target branch or the
|
|||||||
> * For monorepos where pulling all the branch history might not be desired, you can omit `fetch-depth` for `pull_request` events.
|
> * For monorepos where pulling all the branch history might not be desired, you can omit `fetch-depth` for `pull_request` events.
|
||||||
> * For files located in a sub-directory ensure that the pattern specified contains `**/` (globstar) to match any preceding directories or explicitly pass the full path relative to the project root. See: [#314](https://github.com/tj-actions/changed-files/issues/314).
|
> * For files located in a sub-directory ensure that the pattern specified contains `**/` (globstar) to match any preceding directories or explicitly pass the full path relative to the project root. See: [#314](https://github.com/tj-actions/changed-files/issues/314).
|
||||||
> * All multiline inputs should not use double or single qoutes since the value is already a string seperated by a newline character. See [Examples](#examples) for more information.
|
> * All multiline inputs should not use double or single qoutes since the value is already a string seperated by a newline character. See [Examples](#examples) for more information.
|
||||||
> * Ensure that `persist-credentials` is set to `true` when configuring `actions/checkout`.
|
> * Ensure that `persist-credentials` is set to `true` when configuring `actions/checkout` if `fetch-depth` isn't set to `0`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: CI
|
name: CI
|
||||||
@@ -64,7 +64,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
runs-on: ubuntu-latest # windows-latest | macos-latest
|
||||||
@@ -290,7 +289,7 @@ See [inputs](#inputs) for more information.
|
|||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v35
|
uses: tj-actions/changed-files@v35
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
@@ -312,16 +311,16 @@ See [inputs](#inputs) for more information.
|
|||||||
echo "Only files listed above have changed."
|
echo "Only files listed above have changed."
|
||||||
|
|
||||||
- name: Run step if any of the listed files above is deleted
|
- name: Run step if any of the listed files above is deleted
|
||||||
if: steps.changed-files.outputs.any_deleted == 'true'
|
if: steps.changed-files-specific.outputs.any_deleted == 'true'
|
||||||
run: |
|
run: |
|
||||||
for file in ${{ steps.changed-files.outputs.deleted_files }}; do
|
for file in ${{ steps.changed-files-specific.outputs.deleted_files }}; do
|
||||||
echo "$file was deleted"
|
echo "$file was deleted"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Run step if all listed files above have been deleted
|
- name: Run step if all listed files above have been deleted
|
||||||
if: steps.changed-files.outputs.only_deleted == 'true'
|
if: steps.changed-files-specific.outputs.only_deleted == 'true'
|
||||||
run: |
|
run: |
|
||||||
for file in ${{ steps.changed-files.outputs.deleted_files }}; do
|
for file in ${{ steps.changed-files-specific.outputs.deleted_files }}; do
|
||||||
echo "$file was deleted"
|
echo "$file was deleted"
|
||||||
done
|
done
|
||||||
...
|
...
|
||||||
@@ -687,6 +686,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
<td align="center"><a href="https://github.com/lpulley"><img src="https://avatars.githubusercontent.com/u/7193187?v=4?s=100" width="100px;" alt="Logan Pulley"/><br /><sub><b>Logan Pulley</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=lpulley" title="Code">💻</a></td>
|
<td align="center"><a href="https://github.com/lpulley"><img src="https://avatars.githubusercontent.com/u/7193187?v=4?s=100" width="100px;" alt="Logan Pulley"/><br /><sub><b>Logan Pulley</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=lpulley" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://www.linkedin.com/in/kenji-miyake/"><img src="https://avatars.githubusercontent.com/u/31987104?v=4?s=100" width="100px;" alt="Kenji Miyake"/><br /><sub><b>Kenji Miyake</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=kenji-miyake" title="Code">💻</a></td>
|
<td align="center"><a href="https://www.linkedin.com/in/kenji-miyake/"><img src="https://avatars.githubusercontent.com/u/31987104?v=4?s=100" width="100px;" alt="Kenji Miyake"/><br /><sub><b>Kenji Miyake</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=kenji-miyake" title="Code">💻</a></td>
|
||||||
<td align="center"><a href="https://github.com/adonisgarciac"><img src="https://avatars.githubusercontent.com/u/71078987?v=4?s=100" width="100px;" alt="adonisgarciac"/><br /><sub><b>adonisgarciac</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Documentation">📖</a></td>
|
<td align="center"><a href="https://github.com/adonisgarciac"><img src="https://avatars.githubusercontent.com/u/71078987?v=4?s=100" width="100px;" alt="adonisgarciac"/><br /><sub><b>adonisgarciac</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Documentation">📖</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/cfernhout"><img src="https://avatars.githubusercontent.com/u/22294606?v=4?s=100" width="100px;" alt="Chiel Fernhout"/><br /><sub><b>Chiel Fernhout</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=cfernhout" title="Documentation">📖</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
47
diff-sha.sh
47
diff-sha.sh
@@ -54,11 +54,12 @@ if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_REF ]]; then
|
|||||||
echo "Running on a push event..."
|
echo "Running on a push event..."
|
||||||
TARGET_BRANCH=$GITHUB_REFNAME
|
TARGET_BRANCH=$GITHUB_REFNAME
|
||||||
CURRENT_BRANCH=$TARGET_BRANCH
|
CURRENT_BRANCH=$TARGET_BRANCH
|
||||||
|
|
||||||
echo "Fetching remote refs..."
|
if [[ -f .git/shallow ]]; then
|
||||||
|
echo "Fetching remote refs..."
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null
|
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH" 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::debug::Getting HEAD SHA..."
|
echo "::debug::Getting HEAD SHA..."
|
||||||
if [[ -n "$INPUT_UNTIL" ]]; then
|
if [[ -n "$INPUT_UNTIL" ]]; then
|
||||||
@@ -157,9 +158,11 @@ else
|
|||||||
TARGET_BRANCH=$CURRENT_BRANCH
|
TARGET_BRANCH=$CURRENT_BRANCH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Fetching remote refs..."
|
if [[ -f .git/shallow ]]; then
|
||||||
# shellcheck disable=SC2086
|
echo "Fetching remote refs..."
|
||||||
git fetch $EXTRA_ARGS -u --progress origin pull/"$GITHUB_EVENT_PULL_REQUEST_NUMBER"/head:"$CURRENT_BRANCH" 1>/dev/null
|
# shellcheck disable=SC2086
|
||||||
|
git fetch $EXTRA_ARGS -u --progress origin pull/"$GITHUB_EVENT_PULL_REQUEST_NUMBER"/head:"$CURRENT_BRANCH" 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::debug::Getting HEAD SHA..."
|
echo "::debug::Getting HEAD SHA..."
|
||||||
if [[ -n "$INPUT_UNTIL" ]]; then
|
if [[ -n "$INPUT_UNTIL" ]]; then
|
||||||
@@ -197,9 +200,11 @@ else
|
|||||||
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "::debug::Fetching remote target branch..."
|
if [[ -f .git/shallow ]]; then
|
||||||
# shellcheck disable=SC2086
|
echo "::debug::Fetching remote target branch..."
|
||||||
git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
|
# shellcheck disable=SC2086
|
||||||
|
git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 1>/dev/null 2>&1 || true
|
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 1>/dev/null 2>&1 || true
|
||||||
|
|
||||||
@@ -210,21 +215,16 @@ else
|
|||||||
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
||||||
|
PREVIOUS_SHA=$(git rev-parse "$TARGET_BRANCH") && exit_status=$? || exit_status=$?
|
||||||
|
DIFF=".."
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||||
else
|
else
|
||||||
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
|
||||||
PREVIOUS_SHA=$(git rev-parse "$TARGET_BRANCH") && exit_status=$? || exit_status=$?
|
|
||||||
DIFF=".."
|
|
||||||
|
|
||||||
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
|
||||||
echo "::error::Unable find a diff between $PREVIOUS_SHA and $CURRENT_SHA"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "::debug::Target branch: $TARGET_BRANCH"
|
echo "::debug::Target branch: $TARGET_BRANCH"
|
||||||
echo "::debug::Current branch: $CURRENT_BRANCH"
|
echo "::debug::Current branch: $CURRENT_BRANCH"
|
||||||
|
|
||||||
@@ -236,6 +236,11 @@ else
|
|||||||
echo "::error::Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH."
|
echo "::error::Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
||||||
|
echo "::error::Unable find a diff between $PREVIOUS_SHA and $CURRENT_SHA"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" && "$INITIAL_COMMIT" == "false" ]]; then
|
if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" && "$INITIAL_COMMIT" == "false" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user