diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48546fd7c9..cf629dd808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,34 @@ permissions: contents: read jobs: + check: + runs-on: ubuntu-latest + + outputs: + skip_rspec: ${{ steps.skip.outputs.skip_rspec }} + + env: + GH_TOKEN: ${{ github.token }} + + steps: + - name: Check for [skip rspec] + id: skip + run: | + PR_DESCRIPTION=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json body -q '.body') + if echo "$PR_DESCRIPTION" | grep -q "\[skip rspec\]"; then + echo "Skip RSpec found in PR description. Passing the action." + echo "skip_rspec=true" >> $GITHUB_OUTPUT + else + echo "skip_rspec=false" >> $GITHUB_OUTPUT + fi + rspec: name: Ruby ${{ matrix.ruby }} / PostgreSQL ${{ matrix.postgres }} runs-on: ubuntu-20.04 + needs: check + if: needs.check.outputs.skip_rspec == 'false' + permissions: checks: write # for coverallsapp/github-action to create new checks