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

fix: FOAS Prod GH Action creates wrong issue #125

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

andreaangiolillo
Copy link
Collaborator

Proposed changes

This PR fixes a bug with the FOAS GH action that creates multiple issue when one step fails

fixes: #123

@andreaangiolillo andreaangiolillo marked this pull request as ready for review July 31, 2024 09:57
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner July 31, 2024 09:57
@@ -41,7 +42,7 @@ jobs:
npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ./tmp/collection.json --ruleset=./validation/spectral.yaml
popd
- name: Create Issue
if: ${{ failure() }}
if: ${{ failure() && steps.spectral-validation.outcome == 'failure' }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you explain a bit how this fix the issue? (newbie)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

failure() && steps.spectral-validation.outcome == 'failure'
failure() check if the overall GH action has failed.
steps.spectral-validation.outcome == 'failure' makes sure that the step with the id spectral-validation has failed

Only if both conditions are satisfied, the Create Issue step will run.

Before the fix, the only condition to create the issue was that the overall action has failed.

@andreaangiolillo andreaangiolillo merged commit 5be2d23 into main Jul 31, 2024
6 checks passed
@andreaangiolillo andreaangiolillo deleted the fix_prod_release_action branch July 31, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(prod) Required GO SDK validation failed 🙀
2 participants