List AWS Services (Botocore) #55
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: List AWS Services (Botocore) | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs every day at midnight UTC | |
workflow_dispatch: | |
jobs: | |
list-services: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 # Use latest stable version | |
- name: Install boto3 and botocore | |
run: | | |
pip install --upgrade boto3 botocore | |
- name: Run script to list services | |
run: | | |
python3 .github/workflows/aws.py | |
- name: Commit and push changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
# Only commit if there are changes | |
if git diff --cached --quiet; then | |
echo "No changes to commit." | |
else | |
git commit -m "Automated commit by GitHub Actions" | |
git pull origin main --rebase | |
git push origin main | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |