mirror of
https://github.com/awsdocs/aws-doc-sdk-examples.git
synced 2026-03-26 06:22:18 +00:00
* Scope down GitHub token permissions for writeme.yml, yaml-lint.yml, lint-php.yml, lint-ruby.yml, lint-kotlin.yml, and lint-javascript.yml
40 lines
907 B
YAML
40 lines
907 B
YAML
name: Ruby Linting
|
|
|
|
on: # yamllint disable-line rule:truthy
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
rubocop:
|
|
name: RuboCop
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
|
|
with:
|
|
files: "ruby/**/*.rb"
|
|
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: 3.0
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
gem install rubocop
|
|
|
|
- name: Run RuboCop
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
run: |
|
|
changed_files=(${{steps.changed-files.outputs.all_changed_files}})
|
|
rubocop --config .github/linters/.ruby-lint.yml "${changed_files[@]}"
|