|
| 1 | +name: Update feature catalog page |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: 0 10 * * TUE |
| 5 | + workflow_dispatch: |
| 6 | +jobs: |
| 7 | + generate-feature-catalog-file: |
| 8 | + name: Generate feature catalog page |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - name: Checkout docs repository |
| 12 | + uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - name: Latest run-id from community repository |
| 15 | + run: | |
| 16 | + latest_workflow_id=$(curl -s https://api.github.com/repos/localstack/localstack/actions/workflows \ |
| 17 | + | jq '.workflows[] | select(.name=="AWS / Archive feature files").id') |
| 18 | + latest_run_id=$(curl -s \ |
| 19 | + https://api.github.com/repos/localstack/localstack/actions/workflows/$latest_workflow_id/runs | jq '.workflow_runs[0].id') |
| 20 | + echo "Latest run-id: ${latest_run_id}" |
| 21 | + echo "FEATURES_ARTIFACTS_COMMUNITY_RUN_ID=${latest_run_id}" >> $GITHUB_ENV |
| 22 | +
|
| 23 | + - name: Download features files from Collect feature files (GitHub) |
| 24 | + uses: actions/download-artifact@v4 |
| 25 | + with: |
| 26 | + path: features-files-community |
| 27 | + name: features-files |
| 28 | + github-token: ${{ secrets.GH_PAT_FEATURE_CATALOG_PAGE }} # PAT with access to artifacts from GH Actions |
| 29 | + repository: localstack/localstack |
| 30 | + run-id: ${{ env.FEATURES_ARTIFACTS_COMMUNITY_RUN_ID }} |
| 31 | + |
| 32 | + - name: Latest run-id from ext repository |
| 33 | + run: | |
| 34 | + latest_workflow_id=$(curl -s https://api.github.com/repos/localstack/localstack-ext/actions/workflows \ |
| 35 | + | jq '.workflows[] | select(.name=="AWS / Archive feature files").id') |
| 36 | + latest_run_id=$(curl -s \ |
| 37 | + https://api.github.com/repos/localstack/localstack-ext/actions/workflows/$latest_workflow_id/runs | jq '.workflow_runs[0].id') |
| 38 | + echo "Latest run-id: ${latest_run_id}" |
| 39 | + echo "FEATURES_ARTIFACTS_EXT_RUN_ID=${latest_run_id}" >> $GITHUB_ENV |
| 40 | +
|
| 41 | + - name: Download features files from Collect feature files from PRO (GitHub) |
| 42 | + uses: actions/download-artifact@v4 |
| 43 | + with: |
| 44 | + path: features-files-ext |
| 45 | + name: features-files-ext |
| 46 | + repository: localstack/localstack |
| 47 | + github-token: ${{ secrets.GH_PAT_FEATURE_CATALOG_PAGE_PRO }} # PAT with access to artifacts from GH Actions |
| 48 | + run-id: ${{ env.FEATURES_ARTIFACTS_EXT_RUN_ID }} |
| 49 | + |
| 50 | + - name: Generate feature catalog page |
| 51 | + run: python3 scripts/generate_feature_catalog_page.py |
| 52 | + env: |
| 53 | + PATH_FEATURE_FILES_COMMUNITY: 'features-files-community' |
| 54 | + PATH_FEATURE_FILES_EXT: 'features-files-ext' |
| 55 | + PATH_FEATURE_CATALOG_MD: 'content/en/user-guide/aws/feature-coverage.md' |
| 56 | + |
| 57 | + - name: Create PR |
| 58 | + uses: peter-evans/create-pull-request@v7 |
| 59 | + with: |
| 60 | + title: "Update Feature catalog page" |
| 61 | + body: "This PR updates Feature catalog page based on feature catalog YAML files" |
| 62 | + branch: "update-feature-catalog" |
| 63 | + add-paths: "content/en/user-guide/aws/feature-coverage.md" |
| 64 | + author: "LocalStack Bot <localstack-bot@users.noreply.github.com>" |
| 65 | + committer: "LocalStack Bot <localstack-bot@users.noreply.github.com>" |
| 66 | + commit-message: "Upgrade feature catalog" |
| 67 | + labels: "documentation" |
0 commit comments