From 7f2ed5d0389d95bf00376d7abf1a784d52f890d3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 21 Jul 2020 13:05:07 +0800 Subject: [PATCH] =?UTF-8?q?ci(github):=20=E6=B7=BB=E5=8A=A0=E9=80=9A?= =?UTF-8?q?=E7=94=A8action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/jms-generic-action-handler.yml | 12 +++++ .github/workflows/pr-auto-labels.yml | 45 ------------------- 2 files changed, 12 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/jms-generic-action-handler.yml delete mode 100644 .github/workflows/pr-auto-labels.yml diff --git a/.github/workflows/jms-generic-action-handler.yml b/.github/workflows/jms-generic-action-handler.yml new file mode 100644 index 000000000..3f499cfb9 --- /dev/null +++ b/.github/workflows/jms-generic-action-handler.yml @@ -0,0 +1,12 @@ +on: [push, pull_request, release] + +name: JumpServer repos generic handler + +jobs: + generic_handler: + name: Run generic handler + runs-on: ubuntu-latest + steps: + - uses: jumpserver/action-generic-handler@master + env: + GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }} diff --git a/.github/workflows/pr-auto-labels.yml b/.github/workflows/pr-auto-labels.yml deleted file mode 100644 index e517a2ec2..000000000 --- a/.github/workflows/pr-auto-labels.yml +++ /dev/null @@ -1,45 +0,0 @@ -on: - pull_request: - types: - - opened - - edited - -name: Auto add PR label - -jobs: - add_pr_labels: - name: Auto add pull request labels if need - runs-on: ubuntu-latest - steps: - - name: Add labels - if: ${{ !contains(github.event.pull_request.labels, '无需处理') }} - env: - PR_TITLE: ${{ github.event.pull_request.title }} - PR_ISSUE_URL: ${{ github.event.pull_request.issue_url }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -x - echo ${PR_TITLE} - echo ${PR_ISSUE_URL} - label="" - if [[ ${PR_TITLE} =~ "fix" ]];then - label="fix" - elif [[ ${PR_TITLE} =~ "feat" ]];then - label="新功能" - elif [[ ${PR_TITLE} =~ "perf" || ${PR_TITLE} =~ "refactor" ]];then - label="优化" - elif [[ ${PR_TITLE} =~ "ci" ]];then - label="无需处理" - fi - if [[ -z "${label}" ]];then - exit 0 - fi - data='{"labels":["'"${label}"'"]}' - echo $data - curl \ - --fail \ - -X PATCH \ - --data ${data} \ - -H 'Content-Type: application/json' \ - -H "Authorization: Bearer ${GITHUB_TOKEN}" \ - "${PR_ISSUE_URL}"