-
Notifications
You must be signed in to change notification settings - Fork 350
57 lines (52 loc) · 1.94 KB
/
community_extension_docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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"