Skip to content

Update LocalStack Extensions Docs #2

Update LocalStack Extensions Docs

Update LocalStack Extensions Docs #2

name: Update LocalStack Extensions Docs
on:
schedule:
# Run on the 1st of every month at 00:00 UTC
- cron: "0 0 1 * *"
workflow_dispatch:
inputs:
targetBranch:
description: 'Target branch to create the PR against'
required: false
type: string
default: 'main'
env:
TARGET_BRANCH: ${{ github.event.inputs.targetBranch || 'main' }}
jobs:
update-extensions-docs:
name: Update LocalStack Extensions Docs
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
path: docs
ref: ${{ env.TARGET_BRANCH }}
- name: Set up Python 3.11
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Generate Extensions documentation
working-directory: docs
run: |
python3 scripts/generate_extensions_docs.py
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
- name: Check for changes
id: check-for-changes
working-directory: docs
env:
TARGET_BRANCH: ${{ env.TARGET_BRANCH }}
run: |
# Check if there are changed files
# Check against the PR branch if it exists, otherwise against the target branch
mkdir -p resources
FILE_TO_CHECK="src/content/docs/aws/customization/integrations/extensions/official-extensions.md"
(git diff --name-only origin/extensions-docs-auto-updates "$FILE_TO_CHECK" 2>/dev/null || git diff --name-only "origin/$TARGET_BRANCH" "$FILE_TO_CHECK" 2>/dev/null) | tee resources/diff-check.log
echo "diff-count=$(cat resources/diff-check.log | wc -l)" >> $GITHUB_OUTPUT
cat resources/diff-check.log
- name: Create PR
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
if: ${{ success() && steps.check-for-changes.outputs.diff-count != '0' && steps.check-for-changes.outputs.diff-count != '' }}
with:
path: docs
title: "Update LocalStack Extensions Documentation"
body: |
Automated update of the LocalStack Official Extensions documentation.
This PR was auto-generated by the `update-extensions-docs` workflow which runs on the 1st of every month.
**Changes include:**
- Updated list of official and community extensions available on the marketplace
branch: "extensions-docs-auto-updates"
author: "LocalStack Bot <localstack-bot@users.noreply.github.com>"
committer: "LocalStack Bot <localstack-bot@users.noreply.github.com>"
commit-message: "update generated LocalStack Extensions docs"
token: ${{ secrets.PRO_ACCESS_TOKEN }}