Drieam / rspec-github

Formatter for RSpec to show errors in GitHub action annotations
https://drieam.github.io/rspec-github/
MIT License
60 stars 10 forks source link

Formatter using Checks API #10

Closed StefSchenkelaars closed 5 months ago

StefSchenkelaars commented 3 years ago

Definitely still a draft but it pushes all the annotations using the checks API.

You can use this branch by selecting it in the gemfile:

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
  "https://github.com/#{repo_name}.git"
end

gem 'rspec-github', require: false, github: 'Drieam/rspec-github', branch: 'issue/7'

To test it, make sure you add the OCTOKIT_ACCESS_TOKEN environment variable to you job and select the RSpec::Github::Annotator class as the formatter:

jobs:
  rspec:
    steps:
      # ...
      - name: Run RSpec
        env:
          OCTOKIT_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: bundle exec rspec --format RSpec::Github::Annotator

Closes #7