From 809d83b13f015b20cedad702e99cd3039ad8d98d Mon Sep 17 00:00:00 2001 From: fish9167 <674821954@qq.com> Date: Fri, 29 Oct 2021 15:07:37 +0800 Subject: [PATCH] Add GitHup Action (#9542) * add githtp action automation add label assignment * add githup action mirror gitee * Update mirror_gitee.yml * Update mirror_gitee.yml * Update mirror_gitee.yml * change organization change organization * change token change token --- .github/workflows/automation_labels.yml | 36 +++++++++++++++++++++++++ .github/workflows/mirror_gitee.yml | 17 ++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/automation_labels.yml create mode 100644 .github/workflows/mirror_gitee.yml diff --git a/.github/workflows/automation_labels.yml b/.github/workflows/automation_labels.yml new file mode 100644 index 0000000000..c3528a07c0 --- /dev/null +++ b/.github/workflows/automation_labels.yml @@ -0,0 +1,36 @@ +name: automation-labels + +on: + pull_request_target: + types: [opened] + +jobs: + automate-labels: + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + runs-on: ubuntu-latest + steps: + - name: Check organization + id: get_check_code + run: | + http_code=`curl -s --head -I -H "Authorization: token ${{ secrets.LABEl_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/cocos-creator/members/${{ github.event.pull_request.user.login }} | awk '/HTTP/{print $2}'` + echo "::set-output name=http_code::${http_code}" + - name: Echo username organization + run: | + echo ${{ github.event.pull_request.user.login }} + echo ${{ steps.get_check_code.outputs.http_code }} + - name: Add contribution label + if: | + steps.get_check_code.outputs.http_code == 404 + uses: OperationsYU/labeler@master + with: + add-labels: "contribution" + + - name: assignment + if: | + steps.get_check_code.outputs.http_code == 404 + uses: OperationsYU/auto-assignment@v1 + with: + token: ${{ secrets.LABEl_TOKEN }} + users: '["holycanvas"]' diff --git a/.github/workflows/mirror_gitee.yml b/.github/workflows/mirror_gitee.yml new file mode 100644 index 0000000000..a2f16c42b1 --- /dev/null +++ b/.github/workflows/mirror_gitee.yml @@ -0,0 +1,17 @@ +name: 'GitHub Actions Mirror' + +on: [create, push, delete] + +jobs: + mirror_to_gitee: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v1 + - name: 'Mirror to gitee' + uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitee.com:creator-cocos/engine.git + ssh_private_key: + ${{ secrets.GITEE_KEY }}