Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abef388dd9 | ||
|
|
30e1bb07d4 | ||
|
|
9fdfe4cf16 | ||
|
|
024242fc77 | ||
|
|
ecdfb9c92e | ||
|
|
1c2673b763 | ||
|
|
4e23a965c8 |
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@@ -26,7 +26,6 @@ jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'push'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -50,6 +49,7 @@ jobs:
|
||||
|
||||
- name: Run eslint on changed files
|
||||
uses: tj-actions/eslint-changed-files@v18
|
||||
if: github.event_name != 'push'
|
||||
with:
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
config_path: ".eslintrc.json"
|
||||
@@ -62,13 +62,14 @@ jobs:
|
||||
- name: Verify Changed files
|
||||
uses: tj-actions/verify-changed-files@v14
|
||||
id: changed_files
|
||||
if: github.event_name != 'push'
|
||||
with:
|
||||
files: |
|
||||
src
|
||||
dist
|
||||
|
||||
- name: Commit files
|
||||
if: steps.changed_files.outputs.files_changed == 'true'
|
||||
if: steps.changed_files.outputs.files_changed == 'true' && github.event_name != 'push'
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
@@ -76,7 +77,7 @@ jobs:
|
||||
git commit -m "Added missing changes and modified dist assets."
|
||||
|
||||
- name: Push changes
|
||||
if: steps.changed_files.outputs.files_changed == 'true'
|
||||
if: steps.changed_files.outputs.files_changed == 'true' && github.event_name == 'pull_request'
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.PAT_TOKEN }}
|
||||
@@ -1160,7 +1161,7 @@ jobs:
|
||||
main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }}
|
||||
workflow-id: 'test.yml'
|
||||
- name: Run changed-files with a custom base sha
|
||||
if: github.event_name == 'pull_request' && github.event.action != 'closed' && matrix.fetch-depth == 0
|
||||
if: github.event_name != 'push' && github.event.action != 'closed' && matrix.fetch-depth == 0
|
||||
id: changed-files-custom-base-sha
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
62
HISTORY.md
62
HISTORY.md
@@ -1,5 +1,67 @@
|
||||
# Changelog
|
||||
|
||||
# [36.0.1](https://github.com/tj-actions/changed-files/compare/v36.0.0...v36.0.1) - (2023-05-25)
|
||||
|
||||
## <!-- 1 -->🐛 Bug Fixes
|
||||
|
||||
- Bug with retrieving submodules ([#1169](https://github.com/tj-actions/changed-files/issues/1169)) ([1c2673b](https://github.com/tj-actions/changed-files/commit/1c2673b763ea086acd660dd4257c9be06eb77667)) - (Tonye Jack)
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v36 ([#1168](https://github.com/tj-actions/changed-files/issues/1168))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([4e23a96](https://github.com/tj-actions/changed-files/commit/4e23a965c8abd6dfe7edc6d9f5523ebde932507d)) - (tj-actions[bot])
|
||||
|
||||
# [36.0.0](https://github.com/tj-actions/changed-files/compare/v35.9.2...v36.0.0) - (2023-05-25)
|
||||
|
||||
## <!-- 0 -->🚀 Features
|
||||
|
||||
- Update action to nodejs ([#1159](https://github.com/tj-actions/changed-files/issues/1159)) ([413fd78](https://github.com/tj-actions/changed-files/commit/413fd78918c15296b1518feffd64be07d16118b9)) - (tj-actions[bot])
|
||||
|
||||
## <!-- 26 -->🔄 Update
|
||||
|
||||
- Updated README.md ([#1166](https://github.com/tj-actions/changed-files/issues/1166))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([53c377a](https://github.com/tj-actions/changed-files/commit/53c377a374b445ec2a61e343068807bf41f2c9a6)) - (tj-actions[bot])
|
||||
- Update action.yml ([9d2dd83](https://github.com/tj-actions/changed-files/commit/9d2dd83a0150d52eca7815d48dd8a24d7da4a5d8)) - (Tonye Jack)
|
||||
- Update sync-release-version.yml ([fd208a9](https://github.com/tj-actions/changed-files/commit/fd208a9313303759fc804627ea0f81567c9f5a3c)) - (Tonye Jack)
|
||||
- Updated README.md ([#1160](https://github.com/tj-actions/changed-files/issues/1160))
|
||||
|
||||
Co-authored-by: tj-actions-bot <tj-actions-bot@users.noreply.github.com> ([088aefc](https://github.com/tj-actions/changed-files/commit/088aefc16aa6eadd995f8ff7e2aacd7c38962e87)) - (tj-actions[bot])
|
||||
- Update README.md ([be61785](https://github.com/tj-actions/changed-files/commit/be6178560929da94757e6d179b1126bae707a767)) - (tj-actions[bot])
|
||||
- Updated README.md ([#1125](https://github.com/tj-actions/changed-files/issues/1125))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([32778a6](https://github.com/tj-actions/changed-files/commit/32778a6046aabb1594e8adf611fbd2280fb1ded1)) - (Tonye Jack)
|
||||
- Update README.md ([96d3f73](https://github.com/tj-actions/changed-files/commit/96d3f739bc23e640f2fa127fbd98b8d7ebfe3bc9)) - (Tonye Jack)
|
||||
- Update README.md ([8f25d07](https://github.com/tj-actions/changed-files/commit/8f25d07e2f2b0ed2d694aa0273b972e4c8dc4c30)) - (Tonye Jack)
|
||||
- Update README.md ([a16f162](https://github.com/tj-actions/changed-files/commit/a16f162810b666d2dd15924db0b63c70419e3bd3)) - (Tonye Jack)
|
||||
- Updated README.md ([#1113](https://github.com/tj-actions/changed-files/issues/1113))
|
||||
|
||||
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([4ea8e08](https://github.com/tj-actions/changed-files/commit/4ea8e08f6930db51c667a695f94c99e1d9da9d63)) - (Tonye Jack)
|
||||
|
||||
## <!-- 3 -->📚 Documentation
|
||||
|
||||
- Clarify the intent of `fetch-depth` ([#1119](https://github.com/tj-actions/changed-files/issues/1119)) ([6d0aacb](https://github.com/tj-actions/changed-files/commit/6d0aacb11494bcdb6ce492f3c13e7a482b6b23d8)) - (Tonye Jack)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
- **deps:** Update typescript-eslint monorepo to v5.59.7 ([#1162](https://github.com/tj-actions/changed-files/issues/1162)) ([1cf8e0a](https://github.com/tj-actions/changed-files/commit/1cf8e0a6001c1ef22ac17ed4df03277ac8670071)) - (renovate[bot])
|
||||
- Delete sec-auto-merge.yml ([#1161](https://github.com/tj-actions/changed-files/issues/1161)) ([11b14ae](https://github.com/tj-actions/changed-files/commit/11b14aea27d9349a3159ffc66b691e44583994bc)) - (tj-actions[bot])
|
||||
- **deps:** Update tj-actions/glob action to v17.2.6 (main) ([#1137](https://github.com/tj-actions/changed-files/issues/1137)) ([7bbc71b](https://github.com/tj-actions/changed-files/commit/7bbc71bb94e17757e0061e7b0d8fbec2893afdd6)) - (renovate[bot])
|
||||
- **deps:** Update tj-actions/branch-names action to v7 (main) ([#1132](https://github.com/tj-actions/changed-files/issues/1132)) ([f569b77](https://github.com/tj-actions/changed-files/commit/f569b77fb1d9ad9f1a125757d7e9e07b1f320199)) - (renovate[bot])
|
||||
- Remove extra spaces ([#1131](https://github.com/tj-actions/changed-files/issues/1131)) ([c22c36b](https://github.com/tj-actions/changed-files/commit/c22c36bf000848fcd7e70bf3856005c782963715)) - (Tonye Jack)
|
||||
- **deps:** Update tj-actions/json2file action to v1.7.2 (main) ([#1128](https://github.com/tj-actions/changed-files/issues/1128)) ([3c03080](https://github.com/tj-actions/changed-files/commit/3c03080dbf8d021ad8453acb51048ff77c4e5923)) - (renovate[bot])
|
||||
- **deps:** Update tj-actions/json2file action to v1.7.1 (main) ([#1126](https://github.com/tj-actions/changed-files/issues/1126)) ([4897987](https://github.com/tj-actions/changed-files/commit/48979870c0e56e452728d7043ce7a1c1895ebffb)) - (renovate[bot])
|
||||
- **deps:** Update tj-actions/json2file action to v1.6.0 (main) ([#1123](https://github.com/tj-actions/changed-files/issues/1123)) ([8873eb7](https://github.com/tj-actions/changed-files/commit/8873eb78c35420478318bb2376654ad2364912e9)) - (renovate[bot])
|
||||
- **deps:** Update tj-actions/json2file action to v1.5.0 (main) ([#1120](https://github.com/tj-actions/changed-files/issues/1120)) ([82d64d3](https://github.com/tj-actions/changed-files/commit/82d64d32b471aca2662f3924ea8d434eac18e6d5)) - (renovate[bot])
|
||||
- **deps:** Update peter-evans/create-pull-request action to v5.0.1 (main) ([#1114](https://github.com/tj-actions/changed-files/issues/1114)) ([5fce989](https://github.com/tj-actions/changed-files/commit/5fce9894a2e9217983b4649ec6e43f1bbee951fb)) - (renovate[bot])
|
||||
|
||||
## <!-- 9 -->⬆️ Upgrades
|
||||
|
||||
- Upgraded to v35.9.2 ([#1112](https://github.com/tj-actions/changed-files/issues/1112))
|
||||
|
||||
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([3fb7110](https://github.com/tj-actions/changed-files/commit/3fb71100b17456daf24edac3ef41ef3cda647da9)) - (Tonye Jack)
|
||||
|
||||
# [35.9.2](https://github.com/tj-actions/changed-files/compare/v35.9.1...v35.9.2) - (2023-04-28)
|
||||
|
||||
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||
|
||||
46
README.md
46
README.md
@@ -99,7 +99,7 @@ jobs:
|
||||
# Example 1
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
|
||||
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
|
||||
# with:
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
# Example 2
|
||||
- name: Get changed files in the docs folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
|
||||
|
||||
@@ -127,7 +127,7 @@ jobs:
|
||||
# Example 3
|
||||
- name: Get all changed *.js file(s) or any file in the static folder excluding the docs folder
|
||||
id: changed-files-excluded
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
files: |
|
||||
**/*.js
|
||||
@@ -252,7 +252,7 @@ patch : is a patch release number that indicates bug fixes or other small change
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
...
|
||||
```
|
||||
|
||||
@@ -265,7 +265,7 @@ patch : is a patch release number that indicates bug fixes or other small change
|
||||
...
|
||||
- name: Get all changed files and use a comma separator in the output
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
separator: ","
|
||||
...
|
||||
@@ -282,7 +282,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
|
||||
- name: List all added files
|
||||
run: |
|
||||
@@ -303,7 +303,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
|
||||
- name: Run a step if my-file.txt was modified
|
||||
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
|
||||
@@ -363,7 +363,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -386,7 +386,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
files: |
|
||||
my-file.txt
|
||||
@@ -433,7 +433,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@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
files_from_source_file: test/changed-files-list.txt
|
||||
...
|
||||
@@ -450,7 +450,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@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
files_from_source_file: |
|
||||
test/changed-files-list.txt
|
||||
@@ -471,7 +471,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
sha: ${{ github.event.pull_request.head.sha }}
|
||||
...
|
||||
@@ -488,7 +488,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed files using a different base SHA
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
||||
...
|
||||
@@ -520,11 +520,11 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
|
||||
- name: Get changed files in the .github folder
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
base_sha: ${{ steps.get-base-sha.outputs.base_sha }}
|
||||
files: .github/**
|
||||
@@ -554,7 +554,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with defaults in dir1
|
||||
id: changed-files-for-dir1
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
path: dir1
|
||||
|
||||
@@ -577,7 +577,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with quotepath disabled
|
||||
id: changed-files-quotepath
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
quotepath: "false"
|
||||
|
||||
@@ -616,7 +616,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@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||
...
|
||||
@@ -643,7 +643,7 @@ See [inputs](#inputs) for more information.
|
||||
|
||||
- name: Run changed-files with the commit of the last successful test workflow run on main
|
||||
id: changed-files-base-sha-pull-request
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
||||
...
|
||||
@@ -667,7 +667,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with dir_names
|
||||
id: changed-files-dir-names
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
dir_names: "true"
|
||||
...
|
||||
@@ -684,7 +684,7 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Run changed-files with json output
|
||||
id: changed-files-json
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
json: "true"
|
||||
...
|
||||
@@ -701,13 +701,13 @@ See [inputs](#inputs) for more information.
|
||||
...
|
||||
- name: Get changed-files since 2022-08-19
|
||||
id: changed-files-since
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
since: "2022-08-19"
|
||||
|
||||
- name: Get changed-files until 2022-08-20
|
||||
id: changed-files-until
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v36
|
||||
with:
|
||||
until: "2022-08-20"
|
||||
...
|
||||
|
||||
108
dist/index.js
generated
vendored
108
dist/index.js
generated
vendored
@@ -181,8 +181,7 @@ const getCurrentSHA = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0
|
||||
currentSha = yield (0, utils_1.gitLog)({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
'--format',
|
||||
'"%H"',
|
||||
'--format=%H',
|
||||
'-n',
|
||||
'1',
|
||||
'--date',
|
||||
@@ -207,7 +206,7 @@ const getCurrentSHA = ({ inputs, workingDirectory }) => __awaiter(void 0, void 0
|
||||
return currentSha;
|
||||
});
|
||||
const getSHAForPushEvent = (inputs, env, workingDirectory, isShallow, hasSubmodule, gitExtraArgs, isTag) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
let targetBranch = env.GITHUB_REFNAME;
|
||||
let targetBranch = env.GITHUB_REF_NAME;
|
||||
const currentBranch = targetBranch;
|
||||
let initialCommit = false;
|
||||
if (isShallow) {
|
||||
@@ -275,19 +274,14 @@ const getSHAForPushEvent = (inputs, env, workingDirectory, isShallow, hasSubmodu
|
||||
if (inputs.since) {
|
||||
core.debug(`Getting base SHA for '${inputs.since}'...`);
|
||||
try {
|
||||
previousSha = yield (0, utils_1.gitLog)({
|
||||
const allCommitsFrom = yield (0, utils_1.gitLog)({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
'--format',
|
||||
'"%H"',
|
||||
'-n',
|
||||
'1',
|
||||
'--date',
|
||||
'local',
|
||||
'--since',
|
||||
inputs.since
|
||||
]
|
||||
args: ['--format=%H', '--date', 'local', '--since', inputs.since]
|
||||
});
|
||||
if (allCommitsFrom) {
|
||||
const allCommitsFromArray = allCommitsFrom.split('\n');
|
||||
previousSha = allCommitsFromArray[allCommitsFromArray.length - 1];
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
core.error(`Invalid since date: ${inputs.since}. ${error.message}`);
|
||||
@@ -301,31 +295,31 @@ const getSHAForPushEvent = (inputs, env, workingDirectory, isShallow, hasSubmodu
|
||||
targetBranch = tag;
|
||||
}
|
||||
else {
|
||||
if (inputs.sinceLastRemoteCommit) {
|
||||
core.debug('Getting previous SHA for last remote commit...');
|
||||
if (env.GITHUB_EVENT_FORCED === 'false' || !env.GITHUB_EVENT_FORCED) {
|
||||
previousSha = env.GITHUB_EVENT_BEFORE;
|
||||
}
|
||||
else {
|
||||
previousSha = yield (0, utils_1.getParentHeadSha)({ cwd: workingDirectory });
|
||||
}
|
||||
core.debug('Getting previous SHA for last remote commit...');
|
||||
if (env.GITHUB_EVENT_FORCED === 'false' || !env.GITHUB_EVENT_FORCED) {
|
||||
previousSha = env.GITHUB_EVENT_BEFORE;
|
||||
}
|
||||
else {
|
||||
core.debug('Getting previous SHA for last commit...');
|
||||
previousSha = yield (0, utils_1.getParentHeadSha)({ cwd: workingDirectory });
|
||||
previousSha = yield (0, utils_1.getParentSha)({
|
||||
cwd: workingDirectory
|
||||
});
|
||||
}
|
||||
if (!previousSha ||
|
||||
previousSha === '0000000000000000000000000000000000000000') {
|
||||
previousSha = yield (0, utils_1.getParentHeadSha)({ cwd: workingDirectory });
|
||||
previousSha = yield (0, utils_1.getParentSha)({
|
||||
cwd: workingDirectory
|
||||
});
|
||||
}
|
||||
if (previousSha === currentSha) {
|
||||
if (!(yield (0, utils_1.getParentHeadSha)({ cwd: workingDirectory }))) {
|
||||
if (!(yield (0, utils_1.getParentSha)({ cwd: workingDirectory }))) {
|
||||
core.warning('Initial commit detected no previous commit found.');
|
||||
initialCommit = true;
|
||||
previousSha = currentSha;
|
||||
}
|
||||
else {
|
||||
previousSha = yield (0, utils_1.getParentHeadSha)({ cwd: workingDirectory });
|
||||
previousSha = yield (0, utils_1.getParentSha)({
|
||||
cwd: workingDirectory
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -591,7 +585,7 @@ const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: ((_f = eventJson.pull_request) === null || _f === void 0 ? void 0 : _f.number) || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ((_h = (_g = eventJson.pull_request) === null || _g === void 0 ? void 0 : _g.base) === null || _h === void 0 ? void 0 : _h.sha) || '',
|
||||
GITHUB_EVENT_FORCED: eventJson.forced || '',
|
||||
GITHUB_REFNAME: process.env.GITHUB_REFNAME || '',
|
||||
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
|
||||
GITHUB_REF: process.env.GITHUB_REF || '',
|
||||
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE || ''
|
||||
};
|
||||
@@ -808,9 +802,10 @@ function run() {
|
||||
const hasSubmodule = yield (0, utils_1.submoduleExists)({ cwd: workingDirectory });
|
||||
let gitExtraArgs = ['--no-tags', '--prune', '--recurse-submodules'];
|
||||
const isTag = (_a = env.GITHUB_REF) === null || _a === void 0 ? void 0 : _a.startsWith('refs/tags/');
|
||||
const submodulePaths = yield (0, utils_1.getSubmodulePath)({
|
||||
cwd: workingDirectory
|
||||
});
|
||||
let submodulePaths = [];
|
||||
if (hasSubmodule) {
|
||||
submodulePaths = yield (0, utils_1.getSubmodulePath)({ cwd: workingDirectory });
|
||||
}
|
||||
if (isTag) {
|
||||
gitExtraArgs = ['--prune', '--no-recurse-submodules'];
|
||||
}
|
||||
@@ -1165,7 +1160,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.setOutput = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentHeadSha = exports.gitLsRemote = exports.getHeadSha = exports.gitLog = exports.gitDiff = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = void 0;
|
||||
exports.setOutput = exports.getFilePatterns = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.gitLsRemote = exports.getHeadSha = exports.gitLog = exports.gitDiff = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = void 0;
|
||||
/*global AsyncIterableIterator*/
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const exec = __importStar(__nccwpck_require__(1514));
|
||||
@@ -1239,7 +1234,7 @@ const versionToNumber = (version) => {
|
||||
return major * 1000000 + minor * 1000 + patch;
|
||||
};
|
||||
const verifyMinimumGitVersion = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['--version'], { silent: false });
|
||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['--version'], { silent: process.env.ACTION_DEBUG === 'false' });
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(stderr || 'An unexpected error occurred');
|
||||
}
|
||||
@@ -1334,7 +1329,7 @@ const getFilesFromSourceFile = ({ filePaths, excludedFiles = false }) => __await
|
||||
const updateGitGlobalConfig = ({ name, value }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['config', '--global', name, value], {
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
/* istanbul ignore if */
|
||||
if (exitCode !== 0 || stderr) {
|
||||
@@ -1345,16 +1340,20 @@ exports.updateGitGlobalConfig = updateGitGlobalConfig;
|
||||
const isRepoShallow = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', '--is-shallow-repository'], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
return stdout.trim() === 'true';
|
||||
});
|
||||
exports.isRepoShallow = isRepoShallow;
|
||||
const submoduleExists = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||
const { stdout, exitCode } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||
cwd,
|
||||
silent: false
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
return false;
|
||||
}
|
||||
return stdout.trim() !== '';
|
||||
});
|
||||
exports.submoduleExists = submoduleExists;
|
||||
@@ -1362,7 +1361,7 @@ const gitFetch = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function*
|
||||
const { exitCode } = yield exec.getExecOutput('git', ['fetch', '-q', ...args], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
return exitCode;
|
||||
});
|
||||
@@ -1371,7 +1370,7 @@ const gitFetchSubmodules = ({ args, cwd }) => __awaiter(void 0, void 0, void 0,
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['submodule', 'foreach', 'git', 'fetch', '-q', ...args], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
/* istanbul ignore if */
|
||||
if (exitCode !== 0) {
|
||||
@@ -1383,11 +1382,10 @@ const normalizePath = (p) => {
|
||||
return p.replace(/\\/g, '/');
|
||||
};
|
||||
const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
// git submodule status | awk '{print $2}'
|
||||
const { exitCode, stdout, stderr } = yield exec.getExecOutput('git', ['submodule', 'status'], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
core.warning(stderr || "Couldn't get submodule names");
|
||||
@@ -1403,7 +1401,7 @@ const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff
|
||||
var _h, _j, _k, _l;
|
||||
const { stdout } = yield exec.getExecOutput('git', ['diff', parentSha1, parentSha2, '--', submodulePath], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
const subprojectCommitPreRegex = /^(?<preCommit>-)Subproject commit (?<commitHash>.+)$/m;
|
||||
const subprojectCommitCurRegex = /^(?<curCommit>\+)Subproject commit (?<commitHash>.+)$/m;
|
||||
@@ -1427,7 +1425,7 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
|
||||
], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
if (isSubmodule) {
|
||||
@@ -1465,7 +1463,7 @@ const gitDiff = ({ cwd, sha1, sha2, diff, diffFilter, filePatterns = [], isSubmo
|
||||
], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
if (isSubmodule) {
|
||||
@@ -1500,7 +1498,7 @@ exports.gitDiff = gitDiff;
|
||||
const gitLog = ({ args, cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['log', ...args], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
return stdout.trim();
|
||||
});
|
||||
@@ -1508,7 +1506,7 @@ exports.gitLog = gitLog;
|
||||
const getHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
return stdout.trim();
|
||||
});
|
||||
@@ -1516,7 +1514,7 @@ exports.getHeadSha = getHeadSha;
|
||||
const gitLsRemote = ({ cwd, args }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['ls-remote', 'origin', ...args], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
const output = stdout.trim().split('\t');
|
||||
if (output.length === 0) {
|
||||
@@ -1525,19 +1523,19 @@ const gitLsRemote = ({ cwd, args }) => __awaiter(void 0, void 0, void 0, functio
|
||||
return output[0];
|
||||
});
|
||||
exports.gitLsRemote = gitLsRemote;
|
||||
const getParentHeadSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-parse', 'HEAD^'], {
|
||||
const getParentSha = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['rev-list', '-n', '1', 'HEAD^'], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
return stdout.trim();
|
||||
});
|
||||
exports.getParentHeadSha = getParentHeadSha;
|
||||
exports.getParentSha = getParentSha;
|
||||
const verifyCommitSha = ({ sha, cwd, showAsErrorMessage = true }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['rev-parse', '--verify', `${sha}^{commit}`], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
if (showAsErrorMessage) {
|
||||
@@ -1556,7 +1554,7 @@ exports.verifyCommitSha = verifyCommitSha;
|
||||
const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const { stdout } = yield exec.getExecOutput('git', ['tag', '--sort=-version:refname'], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
const tags = stdout.trim().split('\n');
|
||||
if (tags.length < 2) {
|
||||
@@ -1566,7 +1564,7 @@ const getPreviousGitTag = ({ cwd }) => __awaiter(void 0, void 0, void 0, functio
|
||||
const previousTag = tags[1];
|
||||
const { stdout: stdout2 } = yield exec.getExecOutput('git', ['rev-parse', previousTag], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
const sha = stdout2.trim();
|
||||
return { tag: previousTag, sha };
|
||||
@@ -1576,7 +1574,7 @@ const canDiffCommits = ({ cwd, sha1, sha2, diff }) => __awaiter(void 0, void 0,
|
||||
const { exitCode, stderr } = yield exec.getExecOutput('git', ['diff', '--name-only', '--ignore-submodules=all', `${sha1}${diff}${sha2}`], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
core.warning(stderr || `Unable find merge base between ${sha1} and ${sha2}`);
|
||||
|
||||
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
@@ -5,7 +5,7 @@ import {Inputs} from './inputs'
|
||||
import {
|
||||
canDiffCommits,
|
||||
getHeadSha,
|
||||
getParentHeadSha,
|
||||
getParentSha,
|
||||
getPreviousGitTag,
|
||||
gitFetch,
|
||||
gitFetchSubmodules,
|
||||
@@ -30,8 +30,7 @@ const getCurrentSHA = async ({
|
||||
currentSha = await gitLog({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
'--format',
|
||||
'"%H"',
|
||||
'--format=%H',
|
||||
'-n',
|
||||
'1',
|
||||
'--date',
|
||||
@@ -75,7 +74,7 @@ export const getSHAForPushEvent = async (
|
||||
gitExtraArgs: string[],
|
||||
isTag: boolean
|
||||
): Promise<DiffResult> => {
|
||||
let targetBranch = env.GITHUB_REFNAME
|
||||
let targetBranch = env.GITHUB_REF_NAME
|
||||
const currentBranch = targetBranch
|
||||
let initialCommit = false
|
||||
|
||||
@@ -154,19 +153,15 @@ export const getSHAForPushEvent = async (
|
||||
if (inputs.since) {
|
||||
core.debug(`Getting base SHA for '${inputs.since}'...`)
|
||||
try {
|
||||
previousSha = await gitLog({
|
||||
const allCommitsFrom = await gitLog({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
'--format',
|
||||
'"%H"',
|
||||
'-n',
|
||||
'1',
|
||||
'--date',
|
||||
'local',
|
||||
'--since',
|
||||
inputs.since
|
||||
]
|
||||
args: ['--format=%H', '--date', 'local', '--since', inputs.since]
|
||||
})
|
||||
|
||||
if (allCommitsFrom) {
|
||||
const allCommitsFromArray = allCommitsFrom.split('\n')
|
||||
previousSha = allCommitsFromArray[allCommitsFromArray.length - 1]
|
||||
}
|
||||
} catch (error) {
|
||||
core.error(
|
||||
`Invalid since date: ${inputs.since}. ${(error as Error).message}`
|
||||
@@ -179,33 +174,33 @@ export const getSHAForPushEvent = async (
|
||||
previousSha = sha
|
||||
targetBranch = tag
|
||||
} else {
|
||||
if (inputs.sinceLastRemoteCommit) {
|
||||
core.debug('Getting previous SHA for last remote commit...')
|
||||
|
||||
if (env.GITHUB_EVENT_FORCED === 'false' || !env.GITHUB_EVENT_FORCED) {
|
||||
previousSha = env.GITHUB_EVENT_BEFORE
|
||||
} else {
|
||||
previousSha = await getParentHeadSha({cwd: workingDirectory})
|
||||
}
|
||||
core.debug('Getting previous SHA for last remote commit...')
|
||||
if (env.GITHUB_EVENT_FORCED === 'false' || !env.GITHUB_EVENT_FORCED) {
|
||||
previousSha = env.GITHUB_EVENT_BEFORE
|
||||
} else {
|
||||
core.debug('Getting previous SHA for last commit...')
|
||||
previousSha = await getParentHeadSha({cwd: workingDirectory})
|
||||
previousSha = await getParentSha({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
}
|
||||
|
||||
if (
|
||||
!previousSha ||
|
||||
previousSha === '0000000000000000000000000000000000000000'
|
||||
) {
|
||||
previousSha = await getParentHeadSha({cwd: workingDirectory})
|
||||
previousSha = await getParentSha({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
}
|
||||
|
||||
if (previousSha === currentSha) {
|
||||
if (!(await getParentHeadSha({cwd: workingDirectory}))) {
|
||||
if (!(await getParentSha({cwd: workingDirectory}))) {
|
||||
core.warning('Initial commit detected no previous commit found.')
|
||||
initialCommit = true
|
||||
previousSha = currentSha
|
||||
} else {
|
||||
previousSha = await getParentHeadSha({cwd: workingDirectory})
|
||||
previousSha = await getParentSha({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (!previousSha) {
|
||||
|
||||
@@ -5,7 +5,7 @@ export type Env = {
|
||||
GITHUB_EVENT_PULL_REQUEST_HEAD_REF: string
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_REF: string
|
||||
GITHUB_EVENT_BEFORE: string
|
||||
GITHUB_REFNAME: string
|
||||
GITHUB_REF_NAME: string
|
||||
GITHUB_REF: string
|
||||
GITHUB_EVENT_BASE_REF: string
|
||||
GITHUB_EVENT_HEAD_REPO_FORK: string
|
||||
@@ -41,7 +41,6 @@ export const getEnv = async (): Promise<Env> => {
|
||||
if (eventPath) {
|
||||
eventJson = JSON.parse(await fs.readFile(eventPath, {encoding: 'utf8'}))
|
||||
}
|
||||
|
||||
core.debug(`Event: ${JSON.stringify(eventJson, null, 2)}`)
|
||||
|
||||
return {
|
||||
@@ -53,7 +52,7 @@ export const getEnv = async (): Promise<Env> => {
|
||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '',
|
||||
GITHUB_EVENT_FORCED: eventJson.forced || '',
|
||||
GITHUB_REFNAME: process.env.GITHUB_REFNAME || '',
|
||||
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
|
||||
GITHUB_REF: process.env.GITHUB_REF || '',
|
||||
GITHUB_WORKSPACE: process.env.GITHUB_WORKSPACE || ''
|
||||
}
|
||||
|
||||
@@ -54,9 +54,11 @@ export async function run(): Promise<void> {
|
||||
const hasSubmodule = await submoduleExists({cwd: workingDirectory})
|
||||
let gitExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
|
||||
const isTag = env.GITHUB_REF?.startsWith('refs/tags/')
|
||||
const submodulePaths = await getSubmodulePath({
|
||||
cwd: workingDirectory
|
||||
})
|
||||
let submodulePaths: string[] = []
|
||||
|
||||
if (hasSubmodule) {
|
||||
submodulePaths = await getSubmodulePath({cwd: workingDirectory})
|
||||
}
|
||||
|
||||
if (isTag) {
|
||||
gitExtraArgs = ['--prune', '--no-recurse-submodules']
|
||||
|
||||
69
src/utils.ts
69
src/utils.ts
@@ -93,7 +93,7 @@ export const verifyMinimumGitVersion = async (): Promise<void> => {
|
||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||
'git',
|
||||
['--version'],
|
||||
{silent: false}
|
||||
{silent: process.env.ACTION_DEBUG === 'false'}
|
||||
)
|
||||
|
||||
if (exitCode !== 0) {
|
||||
@@ -177,7 +177,7 @@ export const updateGitGlobalConfig = async ({
|
||||
['config', '--global', name, value],
|
||||
{
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -193,7 +193,7 @@ export const isRepoShallow = async ({cwd}: {cwd: string}): Promise<boolean> => {
|
||||
['rev-parse', '--is-shallow-repository'],
|
||||
{
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -205,10 +205,19 @@ export const submoduleExists = async ({
|
||||
}: {
|
||||
cwd: string
|
||||
}): Promise<boolean> => {
|
||||
const {stdout} = await exec.getExecOutput('git', ['submodule', 'status'], {
|
||||
cwd,
|
||||
silent: false
|
||||
})
|
||||
const {stdout, exitCode} = await exec.getExecOutput(
|
||||
'git',
|
||||
['submodule', 'status'],
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
if (exitCode !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
return stdout.trim() !== ''
|
||||
}
|
||||
@@ -223,7 +232,7 @@ export const gitFetch = async ({
|
||||
const {exitCode} = await exec.getExecOutput('git', ['fetch', '-q', ...args], {
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
})
|
||||
|
||||
return exitCode
|
||||
@@ -242,7 +251,7 @@ export const gitFetchSubmodules = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -261,15 +270,13 @@ export const getSubmodulePath = async ({
|
||||
}: {
|
||||
cwd: string
|
||||
}): Promise<string[]> => {
|
||||
// git submodule status | awk '{print $2}'
|
||||
|
||||
const {exitCode, stdout, stderr} = await exec.getExecOutput(
|
||||
'git',
|
||||
['submodule', 'status'],
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -302,7 +309,7 @@ export const gitSubmoduleDiffSHA = async ({
|
||||
['diff', parentSha1, parentSha2, '--', submodulePath],
|
||||
{
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -355,7 +362,7 @@ export const gitRenamedFiles = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -427,7 +434,7 @@ export const gitDiff = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -479,7 +486,7 @@ export const gitLog = async ({
|
||||
}): Promise<string> => {
|
||||
const {stdout} = await exec.getExecOutput('git', ['log', ...args], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
})
|
||||
|
||||
return stdout.trim()
|
||||
@@ -488,7 +495,7 @@ export const gitLog = async ({
|
||||
export const getHeadSha = async ({cwd}: {cwd: string}): Promise<string> => {
|
||||
const {stdout} = await exec.getExecOutput('git', ['rev-parse', 'HEAD'], {
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
})
|
||||
|
||||
return stdout.trim()
|
||||
@@ -506,7 +513,7 @@ export const gitLsRemote = async ({
|
||||
['ls-remote', 'origin', ...args],
|
||||
{
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
const output = stdout.trim().split('\t')
|
||||
@@ -518,15 +525,15 @@ export const gitLsRemote = async ({
|
||||
return output[0]
|
||||
}
|
||||
|
||||
export const getParentHeadSha = async ({
|
||||
cwd
|
||||
}: {
|
||||
cwd: string
|
||||
}): Promise<string> => {
|
||||
const {stdout} = await exec.getExecOutput('git', ['rev-parse', 'HEAD^'], {
|
||||
cwd,
|
||||
silent: false
|
||||
})
|
||||
export const getParentSha = async ({cwd}: {cwd: string}): Promise<string> => {
|
||||
const {stdout} = await exec.getExecOutput(
|
||||
'git',
|
||||
['rev-list', '-n', '1', 'HEAD^'],
|
||||
{
|
||||
cwd,
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
return stdout.trim()
|
||||
}
|
||||
@@ -546,7 +553,7 @@ export const verifyCommitSha = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -576,7 +583,7 @@ export const getPreviousGitTag = async ({
|
||||
['tag', '--sort=-version:refname'],
|
||||
{
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -594,7 +601,7 @@ export const getPreviousGitTag = async ({
|
||||
['rev-parse', previousTag],
|
||||
{
|
||||
cwd,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -620,7 +627,7 @@ export const canDiffCommits = async ({
|
||||
{
|
||||
cwd,
|
||||
ignoreReturnCode: true,
|
||||
silent: false
|
||||
silent: process.env.ACTION_DEBUG === 'false'
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user