update gfw list #52
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 gfw list | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
ssh: | |
description: "SSH connection to Actions" | |
required: false | |
default: "false" | |
schedule: | |
- cron: '0 0 */1 * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: token | |
permissions: | |
contents: write | |
packages: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: update rules | |
env: | |
MAIL: ${{ secrets.MAIL }} | |
MY_NAME: ${{ secrets.MY_NAME}} | |
TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
go mod tidy | |
go run main.go | |
git config --local user.email ${MAIL} | |
git config --local user.name ${MY_NAME} | |
git add Rules/* | |
git commit -m "updated `date +%FT%T%z`" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master |