46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
name: Offline docs drift reminder
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "README.md"
|
|
|
|
jobs:
|
|
remind:
|
|
runs-on: racknerd-mini
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Check whether offline doc changed in same push
|
|
id: drift
|
|
run: |
|
|
if git diff --name-only HEAD~1 HEAD | grep -q '^docs/fish-config\.md$'; then
|
|
echo "synced=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "synced=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Open drift reminder issue
|
|
if: steps.drift.outputs.synced == 'false'
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
SERVER_URL: ${{ github.server_url }}
|
|
REPO: ${{ github.repository }}
|
|
SHA: ${{ github.sha }}
|
|
BRANCH: ${{ github.ref_name }}
|
|
run: |
|
|
curl -s -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
"${SERVER_URL}/api/v1/repos/${REPO}/issues" \
|
|
-d "{
|
|
\"title\": \"docs: README updated — review docs/fish-config.md for drift\",
|
|
\"body\": \"README.md was modified in commit ${SHA} but \`docs/fish-config.md\` (the offline manual) was not updated in the same push.\n\nPlease review the README diff and update the offline documentation if any functions, keybindings, abbreviations, or configuration options were added, removed, or changed.\n\nCommit: ${SHA}\nBranch: ${BRANCH}\",
|
|
\"labels\": [\"Kind/Documentation\"]
|
|
}"
|