generate-lists #8763
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: generate-lists | |
| on: | |
| schedule: | |
| # * is a special character in YAML so you have to quote this string | |
| - cron: '59 4,10,16,22 * * *' | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cleanup | |
| run: rm -rf * | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| # Use the official Bun action to install Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| # Optional: specify a Bun version | |
| bun-version: latest | |
| - name: Install Dependencies | |
| # 'bun install' is significantly faster than 'npm install' | |
| run: bun install --frozen-lockfile | |
| - name: Generate IP Lists | |
| # Run the script directly with Bun | |
| run: bun run index.ts | |
| - name: Commit files | |
| run: | | |
| git config --local user.email "me@brahma.world" | |
| git config --local user.name "Github Action Bot" | |
| git config --local commit.gpgsign false | |
| if [ -z "$(git status --porcelain)" ]; then | |
| git commit -m "No change in the list" --allow-empty -- files | |
| else | |
| git commit -m "Updated List" -- files | |
| fi | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |