Preprocessor #950
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: Preprocessor | |
| on: | |
| push: | |
| branches: ['main'] | |
| paths: | |
| - '**/preprocessor.*' | |
| - 'sub/*.json' | |
| schedule: | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| dummy: ['single'] | |
| defaults: | |
| run: | |
| shell: bash -e {0} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| - name: Run preprocessor.php | |
| run: php edge/preprocessor.php || exit 1 | |
| - name: Configure Git | |
| run: | | |
| git config --local user.name "BotFather" | |
| git config --local user.email "BotFather.REvil@proton.me" | |
| - name: Commit changes with timestamp | |
| run: | | |
| git add -A | |
| if ! git diff --cached --quiet; then | |
| git commit -m "Cloudflare IPs Refreshed at: $(TZ='Asia/Tehran' date '+%H:%M:%S')" \ | |
| -m "The list of Cloudflare IPs has been updated" \ | |
| --author="Diana-Cl <135276904+Diana-Cl@users.noreply.github.com>" | |
| else | |
| echo "No changes detected. Skipping commit." | |
| fi | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # Step 6: Push changes | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} |