Skip to content

add replicator coverage automation #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/docs-replicator-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Update Replicator Coverage Docs

on:
schedule:
- cron: 0 5 * * MON
workflow_dispatch:
inputs:
targetBranch:
required: false
type: string
default: 'master'

jobs:
update-replicator-docs:
name: Update Replicator Coverage Docs
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@v4
with:
fetch-depth: 0
path: docs
ref: ${{ github.event.inputs.targetBranch || 'master' }}

- name: Set up system wide dependencies
run: |
sudo apt-get install jq

- name: Start LocalStack
uses: LocalStack/[email protected]
with:
image-tag: 'latest'
use-pro: true
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}

- name: Create Replicator Coverage
working-directory: docs
run: |
localstack auth set-token ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
localstack replicator resources | jq --indent 4 . > src/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 master
# 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-coverage-updates src/data/replicator/coverage.json 2>/dev/null || git diff --name-only origin/${{ github.event.inputs.targetBranch || 'master' }} src/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 Coverage Docs"
body: "Automatic updates of replicator supported resources"
branch: "replicator-coverage-updates"
author: "LocalStack Bot <[email protected]>"
committer: "LocalStack Bot <[email protected]>"
commit-message: "update generated replicator coverage file"
token: ${{ secrets.PRO_ACCESS_TOKEN }}
reviewers: cloutierMat,pinzon