Skip to content

Change warning annotations to notices regarding ignored inputs#241

Open
Vanley wants to merge 1 commit into
dorny:masterfrom
Vanley:master
Open

Change warning annotations to notices regarding ignored inputs#241
Vanley wants to merge 1 commit into
dorny:masterfrom
Vanley:master

Conversation

@Vanley

@Vanley Vanley commented Jun 7, 2024

Copy link
Copy Markdown

When input parameter is ignored, annotation should just inform about it.

Available annotations on the github actions (https://github.com/actions/toolkit/tree/main/packages/core):
image

Comment thread src/main.ts
Comment on lines 92 to 94
if (base) {
core.warning(`'base' input parameter is ignored when action is triggered by pull request event`)
core.notice(`'base' input parameter is ignored when action is triggered by pull request event`)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be even deleted altogether. base is used now when the action is triggered by a pull request event.

return await git.getChanges(base || baseSha || defaultBranch, currentRef)

Commit that switched to this behavior: 5266f0a

Comment thread src/main.ts
Comment on lines 89 to 91
if (ref) {
core.warning(`'ref' input parameter is ignored when 'base' is set to HEAD`)
core.notice(`'ref' input parameter is ignored when 'base' is set to HEAD`)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be deleted too, I think. I don't see any if clause here that evaluates base === git.HEAD like for the return statement above.

paths-filter/src/main.ts

Lines 80 to 85 in de90cc6

if (base === git.HEAD) {
if (ref) {
core.warning(`'ref' input parameter is ignored when 'base' is set to HEAD`)
}
return await git.getChangesOnHead()
}

@Vanley

Vanley commented Oct 29, 2024

Copy link
Copy Markdown
Author

thanks @ento for review

Will keep this pr short and sweet about the github annotation and information feedback during the github action run.

If you are more familiar with the project and improvements which can be made around it, please create separate pr with those changes! Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants