name: CI

on:
  - push
  - pull_request

jobs:
  test:
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: false
      matrix:
        ruby: ['2.7', '3.0', '3.1', 'head']
        script: [test]
        experimental: [false]
        include:
          - ruby: '2.7'
            script: templates:test
            experimental: true

    steps:
    - uses: actions/checkout@v3
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - name: Run tests
      run: bundle exec rake ${{ matrix.script }}

name: CI

on:
  - push
  - pull_request

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: false
      matrix:
        ruby: ['2.7', '3.0', '3.1', 'head']
        script: [test]
        experimental: [false]
        include:
          - ruby: '2.7'
            script: templates:test
            experimental: true

    steps:
    - uses: actions/checkout@v3
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - name: Run tests
      run: bundle exec rake ${{ matrix.script }}

Add GitHub token permissions for workflow
Add GitHub token permissions for workflow

GitHub asks developers to define workflow permissions,
see below for securing GitHub workflows against supply-chain attacks.
- https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/
- https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
