Skip to content

Commit

Permalink
Logging and fail on no diff
Browse files Browse the repository at this point in the history
  • Loading branch information
kpgalligan committed Aug 23, 2024
1 parent d8a6aac commit 6803d39
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ export async function run(): Promise<void> {
const diff = await git.diffSummary()

if (diff.changed > 0) {
core.info("Code changed. Add and commit.")

Check failure on line 25 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `"Code·changed.·Add·and·commit."` with `'Code·changed.·Add·and·commit.'`
for(const diffFile of diff.files){

Check failure on line 26 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `(const·diffFile·of·diff.files)` with `·(const·diffFile·of·diff.files)·`
core.debug(`-- ${diffFile.file}`)
}
await git.add('.')
await git.commit(commitMessage)
} else {
core.error("No diff found. Nothing to update.")

Check failure on line 32 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `"No·diff·found.·Nothing·to·update."` with `'No·diff·found.·Nothing·to·update.'`
core.setFailed("No diff found. Nothing to update.")

Check failure on line 33 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `"No·diff·found.·Nothing·to·update."` with `'No·diff·found.·Nothing·to·update.'`
}

await git.raw('tag', '-fa', tagVersion, '-m', tagMessage)
Expand Down

0 comments on commit 6803d39

Please sign in to comment.