Skip to content

Commit

Permalink
Inline required workflows for GHA (#895)
Browse files Browse the repository at this point in the history
* Create github-actions-lint.yml

* Create yaml-lint.yml

* Create rubocop.yml
  • Loading branch information
javierjulio committed Jan 11, 2024
1 parent cce444a commit ed65a5f
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/github-actions-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: GitHub Actions Lint

on:
pull_request:

jobs:
github_actions_lint:
name: Run actionlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v41
id: changed-files
with:
files: |
.github/workflows/*.yaml
.github/workflows/*.yml
- uses: reviewdog/action-actionlint@v1
if: steps.changed-files.outputs.any_changed == 'true'
with:
fail_on_error: true
filter_mode: nofilter # added (default), diff_context, file, nofilter
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
41 changes: 41 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Rubocop

on:
pull_request:

env:
RUBY_VERSION: ${{ vars.RUBOCOP_RUBY_VERSION || '3.2' }}

jobs:
rubocop:
name: Run rubocop
runs-on: ubuntu-latest
env:
BUNDLE_ONLY: ${{ vars.RUBOCOP_BUNDLE_ONLY || 'rubocop' }}
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v41
id: changed-files
with:
files: |
.github/workflows/rubocop.yml
.rubocop.yml
**.rb
bin/*
gemfiles/**/Gemfile
Gemfile*
Rakefile
*.gemspec
- uses: ruby/setup-ruby@v1
if: steps.changed-files.outputs.any_changed == 'true'
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- uses: reviewdog/action-rubocop@v2
if: steps.changed-files.outputs.any_changed == 'true'
with:
fail_on_error: true
filter_mode: nofilter # added (default), diff_context, file, nofilter
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_install: true
use_bundler: true
24 changes: 24 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: YAML Lint

on:
pull_request:

jobs:
yaml_lint:
name: Run yamllint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v41
id: changed-files
with:
files: |
**.yaml
**.yml
- uses: reviewdog/action-yamllint@v1
if: steps.changed-files.outputs.any_changed == 'true'
with:
fail_on_error: true
filter_mode: nofilter # added (default), diff_context, file, nofilter
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check

0 comments on commit ed65a5f

Please sign in to comment.