Skip to content

Update function coverage docs #17

Update function coverage docs

Update function coverage docs #17

name: Update function coverage docs
on:
schedule:
# “At 00:00 on Sunday.”
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
update-function-coverage:
name: Update function coverage docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: localstack-docs
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Checkout private tools
uses: actions/checkout@v4
with:
repository: localstack/snowflake
path: snowflake
token: ${{ secrets.GH_TOKEN }}
- name: Run the script
run: |
cd localstack-docs
pip install localstack lxml requests
python ../snowflake/etc/coverage.py
- name: Move the generated files
run: |
cd localstack-docs
mv coverage-features.md src/content/docs/snowflake/features/index.md
mv coverage-functions.md src/content/docs/snowflake/sql-functions.md
- name: Check for changes
id: check-for-changes
working-directory: localstack-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/snowflake-feature-coverage-updates src/content/docs/snowflake/features/index.md src/content/docs/snowflake/sql-functions.md 2>/dev/null || git diff --name-only origin/${{ github.event.inputs.targetBranch || 'main' }} src/content/docs/snowflake/features/index.md src/content/docs/snowflake/sql-functions.md 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@v7
if: ${{ success() && steps.check-for-changes.outputs.diff-count != '0' && steps.check-for-changes.outputs.diff-count != '' }}
with:
path: localstack-docs
title: "Update function coverage documentation"
body: "Automated update of snowflake feature coverage docs"
branch: "snowflake-feature-coverage-updates"
author: "LocalStack Bot <[email protected]>"
committer: "LocalStack Bot <[email protected]>"
commit-message: "automated update of snowflake feature coverage docs"
token: ${{ secrets.PRO_ACCESS_TOKEN }}
reviewers: hovaesco, harshcasper