Update SS Configs #992
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 SS Configs | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
workflow_dispatch: | |
jobs: | |
update-configs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Run config fetcher | |
run: | | |
python fetch_configs.py | |
continue-on-error: false | |
- name: Check if configs.txt exists | |
run: | | |
if [ ! -f configs.txt ]; then | |
echo "configs.txt was not created!" | |
exit 1 | |
fi | |
- name: Commit and push if changes | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add configs.txt | |
if git diff --staged --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -m "Update configs [skip ci]" | |
git push | |
fi |