Update AWS Event Names #60
This file contains 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: Update AWS Event Names | |
on: | |
schedule: | |
- cron: '0 */6 * * *' #Runs every 15 minutes | |
workflow_dispatch: | |
jobs: | |
check_for_changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout self | |
uses: actions/checkout@v2 | |
- name: Run Python script | |
run: | | |
echo "Running update script" | |
python3 update.py | |
- name: Configure Git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Check if branch is up to date | |
id: branch_status | |
run: | | |
git fetch | |
LOCAL=$(git rev-parse @) | |
REMOTE=$(git rev-parse @{u}) | |
if [ $LOCAL != $REMOTE ]; then | |
echo "::set-output name=branch_status::out_of_date" | |
else | |
echo "::set-output name=branch_status::up_to_date" | |
fi | |
- name: Commit and push changes | |
if: steps.branch_status.outputs.branch_status == 'out_of_date' | |
run: | | |
git add . | |
git commit -m "Update all-aws-events.txt with new AWS events" | |
git push origin main |