This repository was archived by the owner on Aug 7, 2025. It is now read-only.
update pr #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Parity Docs | |
| on: | |
| schedule: | |
| - cron: 0 5 * * MON | |
| push: | |
| branches: | |
| - automate-replicator-coverage | |
| workflow_dispatch: | |
| inputs: | |
| targetBranch: | |
| required: false | |
| type: string | |
| default: 'main' | |
| jobs: | |
| update-replicator-docs: | |
| name: Update Replicator Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout docs | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| path: docs | |
| ref: ${{ github.event.inputs.targetBranch || 'main' }} | |
| - name: Set up Python 3.11 | |
| id: setup-python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Start LocalStack | |
| uses: LocalStack/setup-localstack@v0.2.3 | |
| with: | |
| image-tag: 'latest' | |
| env: | |
| LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} | |
| - name: Create Replicator Docs | |
| working-directory: docs | |
| run: localstack replicator resource | jq --indent 4 . > data/replicator/coverage.json | |
| - name: Check for changes | |
| id: check-for-changes | |
| working-directory: docs | |
| run: | | |
| # Check if there are changed files and store the result in resources/diff-check.log | |
| # Check against the PR branch if it exists, otherwise against the main | |
| # Store the result in resources/diff-check.log and store the diff count in the GitHub Action output "diff-count" | |
| mkdir -p resources | |
| (git diff --name-only origin/replicator-auto-updates data/replicator/coverage.json 2>/dev/null || git diff --name-only origin/${{ github.event.inputs.targetBranch || 'main' }} data/replicator/coverage.json 2>/dev/null) | tee resources/diff-check.log | |
| echo "diff-count=$(cat resources/diff-check.log | wc -l)" >> $GITHUB_OUTPUT | |
| - name: Create PR | |
| uses: peter-evans/create-pull-request@v7 | |
| if: ${{ success() && steps.check-for-changes.outputs.diff-count != '0' && steps.check-for-changes.outputs.diff-count != '' }} | |
| with: | |
| path: docs | |
| title: "Update Replicator Docs" | |
| body: "Automatic updates of replicator supported resources" | |
| branch: "replicator-auto-updates" | |
| author: "LocalStack Bot <localstack-bot@users.noreply.github.com>" | |
| committer: "LocalStack Bot <localstack-bot@users.noreply.github.com>" | |
| commit-message: "update generated replicator docs" | |
| token: ${{ secrets.PRO_ACCESS_TOKEN }} | |
| reviewers: cloutierMat,pinzon |