-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,40 @@ | ||
|
||
name: 'Standard Ruby' | ||
description: 'A GitHub Action that lints your Ruby code with Standard Ruby' | ||
description: 'A GitHub Action that lints and auto-fixes your Ruby code with Standard Ruby' | ||
author: 'Justin Searls <[email protected]>' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
using: 'composite' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 'ruby' | ||
bundler-cache: true | ||
|
||
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: Run Standard Ruby with autofix | ||
run: bundle exec standardrb --fix | ||
id: standardrb | ||
|
||
- name: Commit changes | ||
run: | | ||
git config --global user.name 'standard-ruby-action[bot]' | ||
git config --global user.email 'standard-ruby-action[bot]@users.noreply.github.com' | ||
# Add any files that were changed by Standard Ruby | ||
git diff --name-only --diff-filter=M | xargs git add | ||
git commit -m "Apply Standard Ruby autofixes" || echo "No changes to commit" | ||
git push | ||
- name: Fail if Standard Ruby failed | ||
if: ${{ steps.standardrb.outcome == 'failure' }} | ||
run: exit 1 | ||
|
||
env: | ||
GITHUB_TOKEN: secrets.GITHUB_TOKEN | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
branding: | ||
icon: 'code' | ||
color: 'gray-dark' |
This file was deleted.
Oops, something went wrong.