Skip to content

Commit 5968eaa

Browse files
committed
allow for changing link required status
1 parent 0e8b58f commit 5968eaa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

action.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ module.exports = async function action() {
8686
switch(ACTION){
8787
case 'assert-link': {
8888
const githubToken = core.getInput('github-token', {required: true});
89+
const linkRequired = core.getInput('link-required', {required: true}) === 'true';
8990
const octokit = new github.GitHub(githubToken);
90-
const statusState = (foundAsanaTasks.length > 0) ? 'success' : 'error';
91+
const statusState = (!linkRequired || foundAsanaTasks.length > 0) ? 'success' : 'error';
9192
core.info(`setting ${statusState} for ${github.context.payload.pull_request.head.sha}`);
9293
octokit.repos.createStatus({
9394
...github.context.repo,
@@ -144,7 +145,6 @@ module.exports = async function action() {
144145
return movedTasks;
145146
}
146147
default:
147-
console.info('lame');
148148
core.setFailed("unexpected action ${ACTION}");
149149
}
150150
}

action.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ describe('asana github actions', () => {
4343
inputs = {
4444
'asana-pat': asanaPAT,
4545
'action': 'assert-link',
46+
'link-required': 'true',
4647
'github-token': 'fake'
4748
}
4849
github.context.payload = {

0 commit comments

Comments
 (0)