Skip to content

Commit a5d650d

Browse files
committed
more logs
1 parent 44b074f commit a5d650d

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/report_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
ref: test-action # branch name
4141
path: test-action-dir # checkout path
4242

43-
- run: echo 1>>test-action-dir/f
43+
- run: cd test-action-dir && echo 1>>f && git status -s && git diff --staged --name-only
4444
- name: Local git-commit-pull-push-action 1
4545
uses: ./
4646
with:
@@ -49,7 +49,7 @@ jobs:
4949
commit_message: message ${{ github.run_id }}
5050
pull_args: --dry-run
5151

52-
- run: echo 2>>test-action-dir/f
52+
- run: cd test-action-dir && echo 2>>f && git status -s && git diff --staged --name-only
5353
- name: Local git-commit-pull-push-action 2
5454
uses: ./
5555
with:

dist/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,8 +2723,12 @@ try {
27232723
if (!(await (0,_src_isFileExists_js__WEBPACK_IMPORTED_MODULE_1__/* .isFileExist */ .e)(repository))) {
27242724
throw new Error("repository directory doesn't exist: " + repository);
27252725
}
2726+
if (branch.trim() === '') {
2727+
throw new Error('branch is a required field');
2728+
}
27262729
await (0,_src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__/* .spawnProcess */ .y)('git', ['add', '.'], repository);
27272730
const diff = await (0,_src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__/* .spawnProcess */ .y)('git', ['diff', '--staged', '--name-only'], repository);
2731+
console.log('diff', diff);
27282732
if (diff.trim() === '') {
27292733
console.log('Working tree is empty. Nothing to commit.');
27302734
}

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ try {
2121
throw new Error("repository directory doesn't exist: " + repository)
2222
}
2323

24+
if (branch.trim() === '') {
25+
throw new Error('branch is a required field')
26+
}
27+
2428
await spawnProcess('git', ['add', '.'], repository)
2529
const diff = await spawnProcess('git', ['diff', '--staged', '--name-only'], repository)
30+
console.log('diff', diff)
2631
if (diff.trim() === '') {
2732
console.log('Working tree is empty. Nothing to commit.')
2833
} else {

0 commit comments

Comments
 (0)