anti-AD/.github/workflows/download-upstream.yml
2021-05-29 11:30:13 +08:00

36 lines
1.3 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: download-upstream
# Controls when the action will run.
on:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: prepare upstream list
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action[bot]"
sudo update-alternatives --set php /usr/bin/php7.4
/bin/bash ./scripts/prepare-upstream.sh
git add *
git commit -am "download upstream."
- name: push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PERSON_TOKEN }}
- name: sync
run: |
curl -s -m 30 -X POST "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/workflows/auto-rebuild.yml/dispatches" -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.PERSON_TOKEN }}" -d '{"ref":"adlist-maker"}'