mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
Fix `notify-if-api-docs-changed` tool to send the notification only when "changelog.md" is changed in the PR.
84 lines
2.4 KiB
YAML
84 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 }}
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Run tools/github-changes-contain-file
|
|
run: ./tools/github-changes-contain-file api_docs/changelog.md
|
|
|
|
- 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 }}
|