Skip to content

Commit d919362

Browse files
authored
[DPE-2319] Enabling Discourse Gatekeeper one-way sync (#63)
1 parent dfda5ad commit d919362

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.github/workflows/ci.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ jobs:
5353
- name: Run tests
5454
run: tox run -e security
5555

56+
sync-docs:
57+
uses: ./.github/workflows/sync_docs.yaml
58+
secrets: inherit
59+
permissions:
60+
contents: write # Needed to update tags
61+
pull-requests: write # Need to create PR
62+
5663
build:
5764
name: Build charms
5865
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v2

.github/workflows/release.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
needs:
2828
- lib-check
2929
uses: ./.github/workflows/ci.yaml
30+
secrets: inherit
31+
permissions:
32+
contents: write # Needed to login to Discourse
33+
pull-requests: write # Need to create PR
34+
actions: write
3035

3136
build:
3237
name: Build charm

.github/workflows/sync_docs.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Sync docs from Discourse
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '53 0 * * *' # Daily at 00:53 UTC
7+
# Triggered on push to branch "main" by .github/workflows/release.yaml
8+
workflow_call:
9+
10+
jobs:
11+
sync-docs:
12+
name: Open PR with docs changes
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Open PR with docs changes
17+
uses: deusebio/discourse-gatekeeper@main
18+
id: docs-pr
19+
with:
20+
discourse_host: discourse.charmhub.io
21+
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
22+
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
dry_run: "true"
25+
26+
- name: Show migrate output
27+
run: echo '${{ steps.docs-pr.outputs.migrate }}'
28+
- name: Show reconcile output
29+
run: echo '${{ steps.docs-pr.outputs.reconcile }}'

0 commit comments

Comments
 (0)