Skip to content

Commit

Permalink
Automate openapi changes notification to Horreum clients
Browse files Browse the repository at this point in the history
  • Loading branch information
lampajr authored and stalep committed Apr 3, 2024
1 parent 451bb89 commit 1cf0775
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/notify-clients.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Notify clients

on:
push:
branches:
- main
- 0.12.x
paths:
- "docs/site/content/en/openapi/openapi.yaml"

jobs:
clients-notification:
runs-on: ubuntu-latest
strategy:
matrix:
clients:
- name: Golang
repository: Hyperfoil/horreum-client-golang
- name: Python
repository: Hyperfoil/horreum-client-python

steps:
- name: Extract trigger branch
id: extractor
shell: bash
run: |
echo "current_branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Notify ${{ matrix.clients.name }} client
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.CLIENTS_NOTIFICATION_TOKEN }}
repository: ${{ matrix.clients.repository }}
event-type: detected-horreum-openapi-change
client-payload: '{"branch": "${{ steps.extractor.outputs.current_branch }}"}'
11 changes: 11 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ on:
workflow_dispatch:
```
Update the Github action to notify openapi changes to the clients on every stable branch push:
```yaml
on:
push:
branches:
- main
- 0.12.x
paths:
- "docs/site/content/en/openapi/openapi.yaml"
```
Commit the changes:
```bash
Expand Down

0 comments on commit 1cf0775

Please sign in to comment.