-
Notifications
You must be signed in to change notification settings - Fork 510
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
add if statement for pr & push event #476
add if statement for pr & push event #476
Conversation
Thanks. I am currently -1 for this duplication. |
.github/workflows/ci.yml
Outdated
@@ -44,11 +44,23 @@ jobs: | |||
export GOBIN=$HOME/bin | |||
go get sigs.k8s.io/krew/cmd/validate-krew-manifest@${KREW_VERSION} | |||
|
|||
- name: Validate updated plugin manifests | |||
- name: Validate updated plugin manifests PUSH case | |||
if: github.event_name == 'push' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need plugin validation to run only in PRs in all honesty.
Once merged, it’s too late to check manifests as we can’t act on it. Am i right @corneliusweig ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I am currently -1 for this duplication.
I am ~80% sure there’s a better way to do this, if not, I am questioning capabilities of Github Workflows system. Do you mind asking on their community forums if there’s a way to do this cleanly?
Sure, that was a quick solution. For those cases. But there are better options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The tests should only run on PR and pushes to pull requests.
The duplication between the steps does not make sense to me. I still don't understand why we don't just do
git diff --name-only --diff-filter=AM origin/master ${{ github.sha }} -- plugins/
This would work fine with force push AND it would always run the checks for everything that is about to be merged into master. Doesn't that sound right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. And travis was gracious enough to provide the right value as env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The tests should only run on PR and pushes to pull requests.
The duplication between the steps does not make sense to me. I still don't understand why we don't just do
git diff --name-only --diff-filter=AM origin/master ${{ github.sha }} -- plugins/
This would work fine with force push AND it would always run the checks for everything that is about to be merged into master. Doesn't that sound right?
In PR event it is the better option. But for push event, I needed a hash to compare. Now that it's just PR it's simple.
@alonyb can you update with the suggested changes? I think we don't need to build on "push" (I'm assuming it means pushing to master). We still need to rebuild on pushes to PR branches. |
I just deleted the push event, however, I could only be able to push on the master branch. Or only in PR, depending on what is needed now. |
Thanks! Let's give this a shot. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, alonyb The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR #486 should fix this. |
This should fix #462 and #475 (
force-pushed
cases) logs