Skip to content

Changelog generator #17

Changelog generator

Changelog generator #17

Workflow file for this run

name: Linting
on:
pull_request:
types: [synchronize, ready_for_review, opened]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check if manual review has been performed
uses: actions/github-script@v6
id: labels
with:
result-encoding: string
script: |
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
...context.repo,
issue_number: context.issue.number
});
return labels.map(l => l.name).includes('ci:manual-approve:linting')
outputs:
result: ${{ steps.labels.outputs.result }}
prettier:
needs: check
if: needs.check.outputs.result == 'false'
name: Prettier
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
with:
sha: ${{ github.sha }}
files: |
app/_src/**
app/_assets/**
files_ignore: |
app/_src/.repos/kuma/**
- run: npx prettier --check ${{ steps.changed-files.outputs.all_changed_files }}
rubocop:
needs: check
if: needs.check.outputs.result == 'false'
name: Rubocop
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
# Configure Ruby to build Jekyll site
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
- name: Ruby gem cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle Setup
run: bundle config path ${{ github.workspace }}/vendor/bundle
- name: Bundle Install
run: bundle install --jobs 4 --retry 3
- name: Rubocop
run: |
bundle exec rubocop app
vale:
needs: check
if: needs.check.outputs.result == 'false'
name: Vale
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: errata-ai/vale-action@v2
with:
# path where vale checks checking only modified files.
filter_mode: file
fail_on_error: true
vale_flags: "--glob=!app/_src/.repos/kuma/**"
reporter: github-pr-review
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}