Collect IPs #7503
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: "Collect IPs" | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
schedule: | |
- cron: '*/15 * * * *' # Run every 15 minutes | |
env: | |
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
CHAT_ID: ${{ secrets.CHAT_ID }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -e {0} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.23.3' # Specify the Go version (update if needed) | |
- name: Cache Go Modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install Dependencies | |
run: go mod tidy | |
- name: Build Go Project | |
run: go build -o cf2tg . | |
- name: Execute Go Project | |
run: ./cf2tg | |
- name: Configure Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "xigmaDev" | |
- name: Commit changes | |
run: | | |
git add -A | |
git diff --cached --quiet || git commit -m "Automatic update - $(TZ='Asia/Tehran' date '+%Y-%m-%d %H:%M')" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |