From 0770a582cac70cdd886a774dc3245679ab486485 Mon Sep 17 00:00:00 2001 From: gentlyxu <1243610+gentlyxu@users.noreply.github.com> Date: Sat, 29 May 2021 11:22:18 +0800 Subject: [PATCH] Create download-upstream.yml --- .github/workflows/download-upstream.yml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/download-upstream.yml diff --git a/.github/workflows/download-upstream.yml b/.github/workflows/download-upstream.yml new file mode 100644 index 00000000..7d3f32b2 --- /dev/null +++ b/.github/workflows/download-upstream.yml @@ -0,0 +1,35 @@ +# 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"}'