Skip to content

Commit

Permalink
Update CI GitHub workflow
Browse files Browse the repository at this point in the history
Allow CI to be skipped with `[skip rspec]` in the pull request
description.
  • Loading branch information
gbp committed Oct 26, 2023
1 parent 035649e commit 25601e5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 25601e5

Please sign in to comment.