From 2514e7074a36e968b25985c172e472f7213605e3 Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Mon, 8 Aug 2022 18:26:42 +0800 Subject: [PATCH] Merge action jobs --- .github/workflows/ci-bot.yml | 54 ++++++++++++------------------------ examples/ci-bot.yml | 45 ++++++++++++------------------ 2 files changed, 35 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci-bot.yml b/.github/workflows/ci-bot.yml index 8495df0..709755c 100644 --- a/.github/workflows/ci-bot.yml +++ b/.github/workflows/ci-bot.yml @@ -92,14 +92,16 @@ permissions: jobs: - issue_opened: - name: Issue Opened - if: ${{ github.event_name == 'issues' }} + bot: + name: Bot runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v3 - - uses: ./ + + - name: Issue Opened + uses: ./ + if: ${{ github.event_name == 'issues' }} env: LOGIN: ${{ github.event.issue.user.login }} MESSAGE: ${{ github.event.issue.body }} @@ -112,14 +114,9 @@ jobs: Thanks for opening an issue! We will look into it as soon as possible. - pr_opened: - name: PR Opened - if: ${{ github.event_name == 'pull_request_target' }} - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v3 - - uses: ./ + - name: PR Opened + uses: ./ + if: ${{ github.event_name == 'pull_request_target' }} env: LOGIN: ${{ github.event.pull_request.user.login }} MESSAGE: ${{ github.event.pull_request.body }} @@ -133,14 +130,9 @@ jobs: If the PR is ready, use the `/auto-cc` command to assign Reviewer to Review. We will review it shortly. - issue_commented: - name: Issue Commented - if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request }} - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v3 - - uses: ./ + - name: Issue Commented + uses: ./ + if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request }} env: LOGIN: ${{ github.event.comment.user.login }} MESSAGE: ${{ github.event.comment.body }} @@ -149,14 +141,9 @@ jobs: ISSUE_KIND: issue TYPE: comment - pr_review_commented: - name: PR Review Commented - if: ${{ github.event_name == 'pull_request_review_comment' }} - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v3 - - uses: ./ + - name: PR Review Commented + uses: ./ + if: ${{ github.event_name == 'pull_request_review_comment' }} env: LOGIN: ${{ github.event.comment.user.login }} MESSAGE: ${{ github.event.comment.body }} @@ -165,14 +152,9 @@ jobs: ISSUE_KIND: pr TYPE: comment - pr_commented: - name: PR Commented - if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }} - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v3 - - uses: ./ + - name: PR Commented + uses: ./ + if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }} env: LOGIN: ${{ github.event.comment.user.login }} MESSAGE: ${{ github.event.comment.body }} diff --git a/examples/ci-bot.yml b/examples/ci-bot.yml index 3368cb2..4498ae4 100644 --- a/examples/ci-bot.yml +++ b/examples/ci-bot.yml @@ -92,12 +92,13 @@ permissions: jobs: - issue_opened: - name: Issue Opened - if: ${{ github.event_name == 'issues' }} + bot: + name: Bot runs-on: ubuntu-latest steps: - - uses: wzshiming/gh-ci-bot@master + - name: Issue Opened + uses: wzshiming/gh-ci-bot@master + if: ${{ github.event_name == 'issues' }} env: LOGIN: ${{ github.event.issue.user.login }} MESSAGE: ${{ github.event.issue.body }} @@ -110,12 +111,9 @@ jobs: Thanks for opening an issue! We will look into it as soon as possible. - pr_opened: - name: PR Opened - if: ${{ github.event_name == 'pull_request_target' }} - runs-on: ubuntu-latest - steps: - - uses: wzshiming/gh-ci-bot@master + - name: PR Opened + uses: wzshiming/gh-ci-bot@master + if: ${{ github.event_name == 'pull_request_target' }} env: LOGIN: ${{ github.event.pull_request.user.login }} MESSAGE: ${{ github.event.pull_request.body }} @@ -129,12 +127,9 @@ jobs: If the PR is ready, use the `/auto-cc` command to assign Reviewer to Review. We will review it shortly. - issue_commented: - name: Issue Commented - if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request }} - runs-on: ubuntu-latest - steps: - - uses: wzshiming/gh-ci-bot@master + - name: Issue Commented + uses: wzshiming/gh-ci-bot@master + if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request }} env: LOGIN: ${{ github.event.comment.user.login }} MESSAGE: ${{ github.event.comment.body }} @@ -143,12 +138,9 @@ jobs: ISSUE_KIND: issue TYPE: comment - pr_review_commented: - name: PR Review Commented - if: ${{ github.event_name == 'pull_request_review_comment' }} - runs-on: ubuntu-latest - steps: - - uses: wzshiming/gh-ci-bot@master + - name: PR Review Commented + uses: wzshiming/gh-ci-bot@master + if: ${{ github.event_name == 'pull_request_review_comment' }} env: LOGIN: ${{ github.event.comment.user.login }} MESSAGE: ${{ github.event.comment.body }} @@ -157,12 +149,9 @@ jobs: ISSUE_KIND: pr TYPE: comment - pr_commented: - name: PR Commented - if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }} - runs-on: ubuntu-latest - steps: - - uses: wzshiming/gh-ci-bot@master + - name: PR Commented + uses: wzshiming/gh-ci-bot@master + if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }} env: LOGIN: ${{ github.event.comment.user.login }} MESSAGE: ${{ github.event.comment.body }}