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

Skip push to main branch check in test workflow push #571

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

marcelveldt
Copy link
Collaborator

@marcelveldt marcelveldt commented Feb 22, 2024

Our test workflow should ignore the pre-commit action for push to main if running from CI (but still run locally)

@marcelveldt marcelveldt added the ci Improvements or additions to the CI actions label Feb 22, 2024
@MartinHjelmare
Copy link
Contributor

I don't think we should do this. Tests should run on main branch too.

@MartinHjelmare
Copy link
Contributor

I think we should exclude that hook from pre-commit run on CI instead.

@marcelveldt
Copy link
Collaborator Author

I don't think we should do this. Tests should run on main branch too.

But then its duplicated ?
As it will run when you create the PR, run when you push to that PR's branch.

We never push to main directly (without a PR) because we have protected the branch as well as the pre-commit that prevents it.

@marcelveldt
Copy link
Collaborator Author

@marcelveldt
Copy link
Collaborator Author

I think we should exclude that hook from pre-commit run on CI instead.

That sounds good, do you have any idea how ?

@MartinHjelmare
Copy link
Contributor

This should work:

SKIP=no-commit-to-branch pre-commit run --all-files

@MartinHjelmare
Copy link
Contributor

At least it works locally.

@marcelveldt
Copy link
Collaborator Author

@marcelveldt
Copy link
Collaborator Author

marcelveldt commented Feb 22, 2024

@MartinHjelmare I have adjusted it - so now it excludes that rule only in the CI action but it will still run locally.

Also updated the PR description.

@marcelveldt marcelveldt changed the title Ignore main branch in test workflow push Skip push to main branch check in test workflow push Feb 22, 2024
Copy link
Contributor

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Great!

@MartinHjelmare MartinHjelmare merged commit b0cf7aa into main Feb 22, 2024
4 checks passed
@MartinHjelmare MartinHjelmare deleted the ignore-main-push branch February 22, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Improvements or additions to the CI actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants