-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from nearform/fix/handle-no-release
fix: handle no release
- Loading branch information
Showing
8 changed files
with
113 additions
and
115 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
'use strict' | ||
const core = require('@actions/core') | ||
const { logInfo } = require('./log') | ||
|
||
const { runAction } = require('./release-notify-action') | ||
|
||
async function run() { | ||
try { | ||
const token = core.getInput('github-token', { required: true }) | ||
const staleDays = Number(core.getInput('stale-days')) | ||
const commitMessageLines = Number(core.getInput('commit-messages-lines')) | ||
const token = core.getInput('github-token', { required: true }) | ||
const staleDays = Number(core.getInput('stale-days')) | ||
const commitMessageLines = Number(core.getInput('commit-messages-lines')) | ||
|
||
return await runAction(token, staleDays, commitMessageLines) | ||
} catch (error) { | ||
logInfo(error.message) | ||
core.setFailed(error.message) | ||
} | ||
await runAction(token, staleDays, commitMessageLines) | ||
} | ||
|
||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict' | ||
|
||
jest.mock('@actions/core') | ||
|
||
const log = require('../src/log') | ||
|
||
describe('log', () => { | ||
it.each([['logDebug'], ['logInfo'], ['logWarning'], ['logError']])( | ||
'it should log with %s', | ||
(method) => log[method]() | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.