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

feat(formatters): add GitHub Actions formatter #2508

Merged
merged 13 commits into from
Jul 26, 2023

Conversation

siketyan
Copy link
Contributor

@siketyan siketyan commented Jul 13, 2023

This pull requests add a built-in formatter for annotating errors in GitHub Actions.

Spectral already have spectral-action for running Spectral and annotating errors in the workflow. The action creates a new check entry to annotate, but sometimes the annotation is incorrectly attached to another job due to GitHub's bug. To avoid that, it would be great if the Spectral CLI support formatting errors to GitHub Actions format 1 as a built-in formatter, as same as TeamCity formatter does.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Screenshots

N/A

Additional context

N/A

Footnotes

  1. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message

@siketyan siketyan requested review from a team as code owners July 13, 2023 07:31
@siketyan siketyan changed the title feat: Add GitHub Actions formatter feat(formatter): Add GitHub Actions formatter Jul 13, 2023
@siketyan siketyan changed the title feat(formatter): Add GitHub Actions formatter feat(formatter): add GitHub Actions formatter Jul 13, 2023
@siketyan siketyan changed the title feat(formatter): add GitHub Actions formatter feat(formatters): add GitHub Actions formatter Jul 13, 2023
@siketyan siketyan force-pushed the feat/github-actions-formatter branch 2 times, most recently from e91eeb4 to f4c90b2 Compare July 13, 2023 07:47
@siketyan siketyan force-pushed the feat/github-actions-formatter branch from f4c90b2 to 3295bd4 Compare July 13, 2023 08:03
@siketyan siketyan requested a review from P0lip July 16, 2023 14:00
@P0lip
Copy link
Contributor

P0lip commented Jul 24, 2023

I'll try to take a look at it this week!

Copy link
Contributor

@P0lip P0lip left a comment

Choose a reason for hiding this comment

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

Other than a potential column mismatch, this looks great.
Thanks a lot for the contribution!

packages/formatters/src/github-actions.ts Outdated Show resolved Hide resolved
packages/formatters/src/github-actions.ts Outdated Show resolved Hide resolved
packages/formatters/src/github-actions.ts Outdated Show resolved Hide resolved
@P0lip P0lip added the enhancement New feature or request label Jul 24, 2023
@siketyan siketyan force-pushed the feat/github-actions-formatter branch from 77cddc0 to 0b0c635 Compare July 25, 2023 15:03
@siketyan siketyan requested a review from P0lip July 25, 2023 15:10
Copy link
Contributor

@P0lip P0lip left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks again!
I'll merge and release it today

@P0lip
Copy link
Contributor

P0lip commented Jul 25, 2023

Could you merge the latest develop branch? it's out of sync with the base branch

@siketyan
Copy link
Contributor Author

@P0lip merged, sorry for the delay; I was in the dream 💤

@P0lip P0lip enabled auto-merge (squash) July 26, 2023 09:37
@P0lip P0lip disabled auto-merge July 26, 2023 09:41
@P0lip P0lip merged commit b350511 into stoplightio:develop Jul 26, 2023
9 checks passed
P0lip pushed a commit that referenced this pull request Jul 26, 2023
stoplight-bot pushed a commit that referenced this pull request Jul 26, 2023
# @stoplight/spectral-formatters [1.2.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-formatters-1.1.0...@stoplight/spectral-formatters-1.2.0) (2023-07-26)

### Features

* **formatters:** add GitHub Actions formatter ([#2508](#2508)) ([6904927](6904927))
@siketyan siketyan deleted the feat/github-actions-formatter branch July 26, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants