Skip to content

Fix failing sonar-scan without changes #10278

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

Merged
merged 1 commit into from
Feb 14, 2022
Merged

Fix failing sonar-scan without changes #10278

merged 1 commit into from
Feb 14, 2022

Conversation

timroes
Copy link
Contributor

@timroes timroes commented Feb 11, 2022

What

Do not try to run the sonar-check if we don't have a matrix determined. This will currently fail (see e.g. https://github.com/airbytehq/airbyte/actions/runs/1830326733) and send notifications out for that failure. We should simply never try to run this if a PR doesn't change anything in a module requiring a sonar-scan.

See https://github.com/airbytehq/airbyte/actions/runs/1830360752 for an example run (on this PR) where this was now successfully skipped.

@@ -36,7 +36,8 @@ jobs:
echo "::set-output name=changed-modules::{ \"include\": $CHANGES }"

run-ci-tests:
if: github.event.pull_request.draft == false
# Do only run if the PR is not a draft and the changed modules matrix contains at least one entry
if: github.event.pull_request.draft == false && fromJson(needs.detect-changes.outputs.changed-modules).include[0] != null
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Unfortunately GitHub expressions syntax doesn't support any form of length. This seems to be the best way to check if the array has at least one element.

@timroes timroes requested a review from davinchia February 11, 2022 16:26
@timroes timroes added the build label Feb 11, 2022
Copy link
Contributor

@davinchia davinchia left a comment

Choose a reason for hiding this comment

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

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants