Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/pr-release-notes-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Validate release-notes from PRs

on:
pull_request:
types:
- opened
- edited
- reopened

permissions:
pull-requests: read

jobs:
validate-release-notes:
runs-on: ${{ vars.DEFAULT_RUNNER || 'ubuntu-latest' }}
steps:
- name: install-gardener-gha-libs
uses: gardener/cc-utils/.github/actions/install-gardener-gha-libs@master

- name: raise-on-malformed-release-notes
shell: python
run: |
import release_notes.model


pr_body_content = '''\
${{ github.event.pull_request.body }}
'''

_, malformed = release_notes.model.iter_source_blocks(
source={},
content=pr_body_content,
)

if malformed:
raise ValueError(f'do not know how to handle malformed release-notes blocks: {malformed}')