diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index 740a974..0000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "files": [ - "README.md" - ], - "imageSize": 100, - "commit": false, - "contributors": [ - { - "login": "andrewmcodes", - "name": "Andrew Mason", - "avatar_url": "https://avatars1.githubusercontent.com/u/18423853?v=4", - "profile": "https://www.andrewmason.me/", - "contributions": [ - "infra", - "doc", - "code" - ] - } - ], - "contributorsPerLine": 7, - "projectName": "standard-ruby-action", - "projectOwner": "standardrb", - "repoType": "github", - "repoHost": "https://github.com" -} diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 841bf4b..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: andrewmcodes - ---- - -# Bug Report - -## Describe the bug - -A clear and concise description of what the bug is. - -# To Reproduce - -Steps to reproduce the behavior: - -# Expected behavior - -A clear and concise description of what you expected to happen. - -## Stacktrace - -If applicable, add the action stacktrace. - -## Action Version & Workflow File - - - Version [e.g. v0.0.1] - -### Workflow File - -```yaml -# my workflow -``` diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 21745de..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,16 +0,0 @@ -# Type of PR (feature, enhancement, bug fix, etc.) - -## Description - -Please include a summary of the change and which issue is fixed. - -Fixes # (issue) - -## Why should this be added - -Explain value. - -## Checklist - -- [ ] My code follows the style guidelines of this project -- [ ] Actions are passing diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml deleted file mode 100644 index 24d3799..0000000 --- a/.github/workflows/rubocop.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: StandardRB - -on: - pull_request: - branches: - - '*' - push: - branches: - - master - -jobs: - standardrb: - name: StandardRB Action - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Set up Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.1.2 - - name: Bundle - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - - name: Run standardrb - run: bin/standardrb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 5278d1a..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Test - -on: - pull_request: - branches: - - '*' - push: - branches: - - master - -jobs: - test: - name: Rspec Test Action - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Set up Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.1.2 - - name: Bundle - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - - name: Run Rspec - run: bin/rspec diff --git a/CHANGELOG.md b/CHANGELOG.md index 3505401..027561c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,11 @@ -# Changelog +# CHANGELOG -## [Unreleased](https://github.com/andrewmcodes/standardrb-action/tree/HEAD) +## 0.0.3 - 0.0.5 -[Full Changelog](https://github.com/andrewmcodes/standardrb-action/compare/v0.0.2...HEAD) +* Changes lost to the sands of time, because this file wasn't kept up to date. +* Feel free to review the [commit log](https://github.com/standardrb/standard-ruby-action/commits/main/) -**Merged pull requests:** - -- Update incorrect project name in README [\#8](https://github.com/andrewmcodes/standardrb-action/pull/8) ([martinemde](https://github.com/martinemde)) -- Add changelog generator [\#6](https://github.com/andrewmcodes/standardrb-action/pull/6) ([andrewmcodes](https://github.com/andrewmcodes)) - -## [v0.0.2](https://github.com/andrewmcodes/standardrb-action/tree/v0.0.2) (2019-11-07) +## 0.0.2 [Full Changelog](https://github.com/andrewmcodes/standardrb-action/compare/v0.0.1...v0.0.2) @@ -20,10 +16,6 @@ - docs: add andrewmcodes as a contributor [\#2](https://github.com/andrewmcodes/standardrb-action/pull/2) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - Update issue templates [\#1](https://github.com/andrewmcodes/standardrb-action/pull/1) ([andrewmcodes](https://github.com/andrewmcodes)) -## [v0.0.1](https://github.com/andrewmcodes/standardrb-action/tree/v0.0.1) (2019-11-07) - -[Full Changelog](https://github.com/andrewmcodes/standardrb-action/compare/1c89e16f1ed4ca0d42fbc84b93f925f6a8d83da9...v0.0.1) - - +## 0.0.1 -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* +* Initial release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 3b141e0..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,10 +0,0 @@ -# Contributing - -Hey, there! 👋 Any and all contributions are welcome. - -Please make sure to read the [code of conduct](https://testdouble.com/code-of-conduct) before submitting issues or pull requests. - -To lend a helping hand: -* [Fork the repository](https://help.github.com/articles/fork-a-repo/) -* Make your desired changes -* [Create a pull request](https://help.github.com/articles/creating-a-pull-request/) diff --git a/LICENSE b/LICENSE index 4467078..08b9913 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Andrew Mason +Copyright (c) 2024, Test Double Inc., 2019 Andrew Mason Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9cbfcce..69ace71 100644 --- a/README.md +++ b/README.md @@ -2,73 +2,77 @@ A GitHub Action to run [StandardRB](https://github.com/standardrb/standard) against your code and create annotations in the GitHub UI. -- [:white\_check\_mark: Standard Ruby Action](#white_check_mark-standard-ruby-action) - - [:page\_facing\_up: Introduction](#page_facing_up-introduction) - - [:bulb: Usage](#bulb-usage) - - [:package: Example Workflow](#package-example-workflow) - - [:warning: Gotchas](#warning-gotchas) - - [:camera\_flash: Screenshots](#camera_flash-screenshots) - - [:bookmark: Changelog](#bookmark-changelog) - - [:sos: Contributing](#sos-contributing) - - [:rotating\_light: Code of Conduct](#rotating_light-code-of-conduct) - - [✨ Contributors](#-contributors) +**[Status as of 6/17/2024: it's possible that the workflow may not work for most (or all) users. We're investigating.]** -## :page_facing_up: Introduction +## Usage -GitHub Actions are an amazing new tool that can dramatically improve productivity while using the GitHub platform. While it is not hard to write a custom GitHub action to run StandardRB on your codebase, this action takes that functionality one step further using the checks API. After the StandardRB Linter Action runs StandardRB against your code, it will create annotations that you can easily view, matched up with the offending code. +### Creating a Standard Ruby workflow: -Since GitHub actions and the checks API are continually changing, it is possible that there will be breaking API changes that affect this action. If so, please open an issue and I will look into it as soon as I can. - -## :bulb: Usage - -Add the following to your GitHub action workflow to use StandardRB Linter Action: +To separate Standard Ruby linting and formatting from your main test suite, you +can add it in a standalone workflow: ```yaml -- name: StandardRB Linter - uses: standardrb/standard-ruby-action@v0.0.5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - USE_BUNDLE_VERSION: true # anything else (or omitting) will run the current version instead of your projects version -``` - -### :package: Example Workflow - -Here is an example workflow file incorporating StandardRB Linter Action: - ```yaml -name: StandardRB +name: Standard Ruby on: [push] jobs: build: runs-on: ubuntu-latest + permissions: + checks: write + contents: read steps: - uses: actions/checkout@v4 - - name: StandardRB Linter + - name: Standard Ruby uses: standardrb/standard-ruby-action@v0.0.5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + USE_BUNDLE_VERSION: true ``` -## :warning: Gotchas +### Adding to an existing workflow: -Due to the GitHub Check Runs API, we can only return 50 annotations per run. See [here](https://developer.github.com/v3/checks/runs/#output-object) for more info. +You can add the following to your existing GitHub Action workflow: -## :camera_flash: Screenshots +```yaml +- name: Standard Ruby + uses: standardrb/standard-ruby-action@v0.0.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + USE_BUNDLE_VERSION: true +``` -![StandardRB Action Checks Overview](screenshots/check-overview.png) -![StandardRB Action File Annotation](screenshots/file-annotation.png) +This will require you to add these permissions (after specifying the operating system via `runs_on`): + +```yaml +runs-on: ubuntu-latest +permissions: + checks: write + contents: read +``` + +## Options + +These can be set under `env:` in the Standard Ruby action step. + +If you've installed the `standard` gem to your project with Bundler, then you +probably want to run the same version in this action. Under the action, set: -## :bookmark: Changelog +```yaml +USE_BUNDLE_VERSION: true +``` -[View our Changelog](/CHANGELOG.md) +Omitting this value or setting it to anything else will instead execute +`gem install standard` and run the latest version of Standard Ruby. -## :sos: Contributing +## Screenshots -[Contributing Guide](/CONTRIBUTING.md) +![StandardRB Action Checks Overview](screenshots/check-overview.png) +![StandardRB Action File Annotation](screenshots/file-annotation.png) -## :rotating_light: Code of Conduct +## Code of Conduct This project follows Test Double's [code of conduct](https://testdouble.com/code-of-conduct) for all community interactions, @@ -77,18 +81,8 @@ code reviews, pull requests, and GitHub issues. If violations occur, Test Double will take any action they deem appropriate for the infraction, up to and including blocking a user from the organization's repositories. -## ✨ Contributors - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - -
Andrew Mason 🚇 📖 💻 |
-