Skip to content

Generate and Update Community Extensions Docs #153

Generate and Update Community Extensions Docs

Generate and Update Community Extensions Docs #153

name: Generate and Update Community Extensions Docs
on:
workflow_dispatch:
workflow_call:
schedule:
- cron: "0 */6 * * *"
jobs:
generate_docs:
uses: duckdb/community-extensions/.github/workflows/generate_docs.yml@main
deploy_docs:
needs:
- generate_docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: '.'
token: ${{ secrets.GH_UPDATE_DOCS_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: generated_markdowns
- name: Generate docs
run: |
unzip generated_md.zip
cp build/docs/*.md community_extensions/extensions/.
cp build/docs/extensions_list.md.tmp _includes/list_of_community_extensions.md
rm -r generated_md.zip
rm -rf build
- name: Send PR
run: |
git add _includes/list_of_community_extensions.md
git add --all community_extensions
git checkout -B auto_update_community_extensions_docs
git config user.email "[email protected]"
git config user.name "Quack Mc Docs"
git commit -m "chore: update Community Extensions docs"
git push -f origin auto_update_community_extensions_docs
# Store the PAT in a file that can be accessed by the
# GitHub CLI.
echo "${{ secrets.GH_UPDATE_DOCS_TOKEN }}" > token.txt
# Authorize GitHub CLI for the current repository and
# create a pull-requests containing the updates.
gh auth login --with-token < token.txt
gh pr create \
--body "" \
--title "chore: update Community Extensions docs" \
--head "auto_update_community_extensions_docs" \
--base "main" \
|| gh pr edit \
"auto_update_community_extensions_docs" \
--body "" \
--title "chore: update Community Extensions docs"