Skip to content

Commit

Permalink
feat(ci): enforce README update on major update (#1341)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau authored Feb 11, 2025
1 parent 752b25b commit a4560e6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/validate-pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
name: Validate Title
runs-on: ubuntu-latest
needs: getChangedChart
permissions:
pull-requests: read
env:
PR_TITLE: ${{ github.event.pull_request.title }}
steps:
Expand Down Expand Up @@ -66,3 +68,17 @@ jobs:
echo "PR title must have scope '$CHANGED_CHART/\$subscope'" >&2
exit 1
fi
- name: Verify readme is updated on major update
if: ${{ needs.getChangedChart.outputs.found == 'true' }}
env:
CHANGED_CHART: ${{ needs.getChangedChart.outputs.chart }}
run: |
set -e
set -o pipefail
if cog verify "$PR_TITLE" 2>&1 | grep -qi 'BREAKING CHANGE'; then
if ! gh api --paginate "/repos/${GITHUB_REPOSITORY}/pulls/${PULL_REQUEST_NUMBER}/files" | jq -cr 'map(.filename)[]' | grep -qi "charts/$CHANGED_CHART/README.md.gotmpl"; then
echo "You need to update the readme on a major update" >&2
exit 1
fi
fi

0 comments on commit a4560e6

Please sign in to comment.