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

ci(label): trigger workflows on labelling #3070

Merged
merged 9 commits into from
Aug 19, 2023
Merged

ci(label): trigger workflows on labelling #3070

merged 9 commits into from
Aug 19, 2023

Conversation

clearloop
Copy link
Contributor

@clearloop clearloop commented Aug 15, 2023

Resolves #2888

  1. list all check runs for the PR
  2. find if the latest check has processed workflow build
  3. dispatch workflow with github API
  4. create checks from the dispatched workflow
  5. update the status of the checks till they are completed
  • trigger build on A0-pleasereview
  • dispatch workflow and create specified build checks
  • maintain the status of the new created checks
  • not trigger workflow build when it has already been triggered

Why create checks instead of just triggering the workflows with labels?

Triggering the workflows directly will cause the workflows be triggered on each labelling and even if we can skip triggering on non-A0/E2 labels, the state of the check suite will be reset which means our build checks will be disappeared as well

@gear-tech/dev

@clearloop clearloop added A1-inprogress Issue is in progress or PR draft is not ready to be reviewed A0-pleasereview PR is ready to be reviewed by the team and removed A1-inprogress Issue is in progress or PR draft is not ready to be reviewed A0-pleasereview PR is ready to be reviewed by the team labels Aug 16, 2023
@clearloop clearloop changed the title ci(label): trigger workflows while labeling ci(label): trigger workflows on labeling Aug 16, 2023
@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 16, 2023
@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 16, 2023
@clearloop clearloop added the A0-pleasereview PR is ready to be reviewed by the team label Aug 16, 2023
@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 16, 2023
@clearloop clearloop added the A0-pleasereview PR is ready to be reviewed by the team label Aug 16, 2023
@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team A5-dontmerge PR should not be merged yet and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 16, 2023
@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team E2-forcemacos Force CI to run macOS build in PR and removed A0-pleasereview PR is ready to be reviewed by the team E2-forcemacos Force CI to run macOS build in PR labels Aug 17, 2023
@clearloop clearloop removed A1-inprogress Issue is in progress or PR draft is not ready to be reviewed A5-dontmerge PR should not be merged yet labels Aug 18, 2023
@clearloop clearloop changed the title ci(label): trigger workflows on labeling ci(label): trigger workflows on labelling Aug 18, 2023
@clearloop clearloop marked this pull request as ready for review August 18, 2023 05:17
@clearloop clearloop removed the A0-pleasereview PR is ready to be reviewed by the team label Aug 18, 2023
@clearloop
Copy link
Contributor Author

clearloop commented Aug 18, 2023

show case here:

push without A0-pleasereview in PR, now labelling A0-pleasereview, we can see there are two new checks

  • Docs / build / linux
  • Docs / build / win-cross

why starts with Docs? see #3087

@clearloop clearloop added the A0-pleasereview PR is ready to be reviewed by the team label Aug 18, 2023
@clearloop
Copy link
Contributor Author

clearloop commented Aug 18, 2023

now, re-labelling A0-pleasereview and no new builds are triggered, E2-forcemacos will work as same after merging, it doesn't work for now because the new introduced build-macos workflow is not recognized by the github API yet

@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 18, 2023
@shamilsan
Copy link
Contributor

Did you check how it works with [skip ci] prefix?

@clearloop
Copy link
Contributor Author

clearloop commented Aug 19, 2023

Did you check how it works with [skip ci] prefix?

It follows the rules of the provided skip CI implementation https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs since the label workflow is on: pull_request

I'm thinking of skipping CI may require extra work since I used to try [skip ci] with different workflows, none of them works =,=

.github/actions/label/build.js Show resolved Hide resolved
@clearloop clearloop merged commit b74a34a into master Aug 19, 2023
12 checks passed
@clearloop clearloop deleted the cl/issue-2888 branch August 19, 2023 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More conditions for the build job of workflow Labels
3 participants