mirror of
https://github.com/zulip/zulip.git
synced 2025-10-22 20:42:14 +00:00
Updates "API Documentation Update Check" tool to add PR information in the message to chat.zulip.org when the new endpoints are added.
83 lines
2.4 KiB
YAML
83 lines
2.4 KiB
YAML
name: API Documentation Update Check
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "api_docs/**"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check-feature-level-updated:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Run tools/check-feature-level-updated
|
|
id: run_check
|
|
run: ./tools/check-feature-level-updated >> $GITHUB_OUTPUT
|
|
|
|
- name: Report status to CZO
|
|
if: ${{ steps.run_check.outputs.fail == 'true' && github.repository == 'zulip/zulip'}}
|
|
uses: zulip/github-actions-zulip/send-message@v1
|
|
with:
|
|
api-key: ${{ secrets.ZULIP_BOT_KEY }}
|
|
email: "github-actions-bot@chat.zulip.org"
|
|
organization-url: "https://chat.zulip.org"
|
|
to: "automated testing"
|
|
topic: ${{ steps.run_check.outputs.topic }}
|
|
type: "stream"
|
|
content: ${{ steps.run_check.outputs.content }}
|
|
|
|
- name: Fail job if feature level not updated in API docs
|
|
if: ${{ steps.run_check.outputs.fail == 'true' }}
|
|
run: exit 1
|
|
|
|
notify-if-api-docs-changed:
|
|
runs-on: ubuntu-latest
|
|
needs: check-feature-level-updated
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Add required permissions
|
|
run: chmod +x ./tools/notify-if-api-docs-changed
|
|
|
|
- name: Run tools/notify-if-api-docs-changed
|
|
id: run_check
|
|
run: ./tools/notify-if-api-docs-changed >> $GITHUB_OUTPUT
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Report status to CZO
|
|
if: ${{github.repository == 'zulip/zulip'}}
|
|
uses: zulip/github-actions-zulip/send-message@v1
|
|
with:
|
|
api-key: ${{ secrets.ZULIP_BOT_KEY }}
|
|
email: "github-actions-bot@chat.zulip.org"
|
|
organization-url: "https://chat.zulip.org"
|
|
to: "api documentation"
|
|
topic: ${{ steps.run_check.outputs.topic }}
|
|
type: "stream"
|
|
content: ${{ steps.run_check.outputs.content }}
|