-
Notifications
You must be signed in to change notification settings - Fork 143
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 runs-on field to Spotless Check step in CI #3400
Add runs-on field to Spotless Check step in CI #3400
Conversation
Signed-off-by: rithin-pullela-aws <[email protected]>
Signed-off-by: rithin-pullela-aws <[email protected]> (cherry picked from commit 48379ad)
Signed-off-by: rithin-pullela-aws <[email protected]> (cherry picked from commit 48379ad) Co-authored-by: Rithin Pullela <[email protected]>
@@ -23,6 +23,8 @@ jobs: | |||
product: opensearch | |||
|
|||
spotless: | |||
if: github.repository == 'opensearch-project/ml-commons' |
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.
Whats the significance of using if here?
I'm not too familiar with the CI workflow but cant we make it always run the latest?
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.
This if condition forces the job (specifically the spotless step) to only run, if triggered in ml-commons repo. Essentially preventing it to run in any other repository.
For example in line 20 we have this:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch
We are triggering a workflow file from opensearch-build team.
Had the openserach-build team put a condition in their workflow file to only run if the repo is opensearch-build, the Get-CI-Image-Tag step in our CI would have failed.
Having this check prevents accidental or unintended execution. (It does not effect the logic, just a good practice)
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.
Awesome thanks for sharing!
Description
Without the runs-on field, the spotless check step fails
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.