-
Notifications
You must be signed in to change notification settings - Fork 124
67 lines (61 loc) · 3.11 KB
/
docs-update-feature-catalog.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
58
59
60
61
62
63
64
65
66
67
name: Update feature catalog page
on:
schedule:
- cron: 0 10 * * MON
workflow_dispatch:
jobs:
generate-feature-catalog-file:
name: Generate feature catalog page
runs-on: ubuntu-latest
steps:
- name: Checkout docs repository
uses: actions/checkout@v4
- name: Latest run-id from community repository
run: |
latest_workflow_id=$(curl -s https://api.github.com/repos/localstack/localstack/actions/workflows \
| jq '.workflows[] | select(.name=="Artifact with features files").id')
latest_run_id=$(curl -s \
https://api.github.com/repos/localstack/localstack/actions/workflows/$latest_workflow_id/runs | jq '.workflow_runs[0].id')
echo "Latest run-id: ${latest_run_id}"
echo "FEATURES_ARTIFACTS_COMMUNITY_RUN_ID=${latest_run_id}" >> $GITHUB_ENV
- name: Download features files from Collect feature files (GitHub)
uses: actions/download-artifact@v4
with:
path: features-files-community
name: features-files
github-token: ${{ secrets.GH_PAT_FEATURE_CATALOG_PAGE }} # PAT with access to artifacts from GH Actions
repository: localstack/localstack
run-id: ${{ env.FEATURES_ARTIFACTS_COMMUNITY_RUN_ID }}
- name: Latest run-id from ext repository
run: |
latest_workflow_id=$(curl -s https://api.github.com/repos/localstack/localstack-ext/actions/workflows \
| jq '.workflows[] | select(.name=="Artifact with features files").id')
latest_run_id=$(curl -s \
https://api.github.com/repos/localstack/localstack-ext/actions/workflows/$latest_workflow_id/runs | jq '.workflow_runs[0].id')
echo "Latest run-id: ${latest_run_id}"
echo "FEATURES_ARTIFACTS_EXT_RUN_ID=${latest_run_id}" >> $GITHUB_ENV
- name: Download features files from Collect feature files from PRO (GitHub)
uses: actions/download-artifact@v4
with:
path: features-files-ext
name: features-files-ext
repository: localstack/localstack
github-token: ${{ secrets.GH_PAT_FEATURE_CATALOG_PAGE_PRO }} # PAT with access to artifacts from GH Actions
run-id: ${{ env.FEATURES_ARTIFACTS_EXT_RUN_ID }}
- name: Generate feature catalog page
run: python3 scripts/generate_feature_catalog_page.py
env:
PATH_FEATURE_FILES_COMMUNITY: 'features-files-community'
PATH_FEATURE_FILES_EXT: 'features-files-ext'
PATH_FEATURE_CATALOG_MD: 'content/en/user-guide/aws/feature-coverage.md'
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
title: "Update Feature catalog page"
body: "This PR updates Feature catalog page based on feature catalog YAML files"
branch: "update-feature-catalog"
add-paths: "content/en/user-guide/aws/feature-coverage.md"
author: "LocalStack Bot <[email protected]>"
committer: "LocalStack Bot <[email protected]>"
commit-message: "Upgrade feature catalog"
labels: "documentation"