Skip to content

Commit

Permalink
Merge pull request #19 from wzshiming/feat/merge-action-jobs
Browse files Browse the repository at this point in the history
Merge action jobs
  • Loading branch information
wzshiming authored Aug 8, 2022
2 parents b2360d4 + 2514e70 commit 45f03db
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 64 deletions.
54 changes: 18 additions & 36 deletions .github/workflows/ci-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
45 changes: 17 additions & 28 deletions examples/ci-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down

0 comments on commit 45f03db

Please sign in to comment.