Skip to content

Weekly AWS Documentation Check #6

Weekly AWS Documentation Check

Weekly AWS Documentation Check #6

name: Weekly AWS Documentation Check
on:
schedule:
# Run every Monday at 9 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch:
inputs:
force_check:
description: 'Force check all feeds (ignore last_check timestamp)'
required: false
default: 'false'
type: boolean
permissions:
contents: write
issues: write
pull-requests: write
jobs:
check-updates:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Reset last check timestamp (if forced)
if: ${{ inputs.force_check }}
run: |
echo '{"last_check": "1970-01-01T00:00:00+00:00", "services_checked": []}' > tracking/last-check.json
- name: Check for AWS documentation updates
id: check
run: python scripts/check-aws-updates.py
- name: Commit tracking updates via PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add tracking/
# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No tracking changes to commit"
exit 0
fi
# Create a unique branch for the tracking update
BRANCH_NAME="chore/update-tracking-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH_NAME"
git commit -m "chore: update tracking data"
git push -u origin "$BRANCH_NAME"
# Create a PR and auto-merge it
PR_URL=$(gh pr create \
--title "chore: update AWS doc check tracking data" \
--body "Automated update of tracking data from weekly AWS documentation check." \
--base main \
--head "$BRANCH_NAME")
echo "Created PR: $PR_URL"
# Enable auto-merge if the repo allows it
gh pr merge "$PR_URL" --auto --squash || echo "Auto-merge not enabled or not allowed"
- name: Create GitHub issues for updates
if: steps.check.outputs.updates_found == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python scripts/generate-update-issues.py
- name: Summary
run: |
echo "## AWS Documentation Check Complete" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.check.outputs.updates_found }}" == "true" ]; then
echo "Found ${{ steps.check.outputs.update_count }} significant updates." >> $GITHUB_STEP_SUMMARY
echo "GitHub issues have been created for review." >> $GITHUB_STEP_SUMMARY
else
echo "No significant updates found." >> $GITHUB_STEP_SUMMARY
fi