Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change warning annotations to notices regarding ignored inputs #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ async function getChangedFiles(token: string, base: string, ref: string, initial
// This is the simplest case as we don't need to fetch more commits or evaluate current/before refs
if (base === git.HEAD) {
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`)
}
return await git.getChangesOnHead()
}

const prEvents = ['pull_request', 'pull_request_review', 'pull_request_review_comment', 'pull_request_target']
if (prEvents.includes(github.context.eventName)) {
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`)
}
Comment on lines 89 to 91
Copy link

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()
}

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`)
}
Comment on lines 92 to 94
Copy link

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

const pr = github.context.payload.pull_request as PullRequestEvent
if (token) {
Expand Down