This repository was archived by the owner on Aug 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
Automate replicator coverage #1724
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
855157e
create workflow
cloutierMat ad7b83b
update pr
cloutierMat 55079e8
update dependencies and env
cloutierMat b980611
use pro
cloutierMat 031f920
debug
cloutierMat e78058f
more debug
cloutierMat a98ca45
fix steps and add set auth to explicitly fail if auth is not found
cloutierMat b6615f3
remove push trigger
cloutierMat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Update Replicator Coverage Docs | ||
| on: | ||
| schedule: | ||
| - cron: 0 5 * * MON | ||
| workflow_dispatch: | ||
| inputs: | ||
| targetBranch: | ||
| required: false | ||
| type: string | ||
| default: 'main' | ||
| 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 || 'main' }} | ||
|
|
||
| - name: Set up system wide dependencies | ||
| run: | | ||
| sudo apt-get install jq | ||
|
|
||
| - name: Start LocalStack | ||
| uses: LocalStack/setup-localstack@v0.2.3 | ||
| 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 . > 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-coverage-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 Coverage Docs" | ||
| body: "Automatic updates of replicator supported resources" | ||
| branch: "replicator-coverage-updates" | ||
| author: "LocalStack Bot <localstack-bot@users.noreply.github.com>" | ||
| committer: "LocalStack Bot <localstack-bot@users.noreply.github.com>" | ||
| commit-message: "update generated replicator coverage file" | ||
| token: ${{ secrets.PRO_ACCESS_TOKEN }} | ||
| reviewers: cloutierMat,pinzon | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HarshCasper, @simonrw Do you want to be added as reviewers?