Skip to content

Commit

Permalink
chore(ci): fix pr check for merge group (#13186)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Oct 11, 2023
1 parent d8451a1 commit f239699
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,23 @@ permissions:
jobs:
title:
runs-on: ubuntu-latest
if: '!github.event.pull_request.draft'
steps:
- name: Check PR title if not sematic
uses: actions/github-script@v6
id: check
with:
script: |
if (!context.payload.pull_request) {
core.info('PR payload is null');
core.setOutput('title', 'ignore');
return;
}
const title = context.payload.pull_request.title;
const regex = /^(rfc|feat|fix|refactor|ci|docs|chore)(\([a-z0-9-]+\))?:/;
const m = title.match(regex);
if (!m) {
core.setFailed('PR title is not semantic');
core.error('PR title is not semantic');
core.setOutput('title', 'not-semantic');
return;
}
const prType = m[1];
Expand Down Expand Up @@ -64,15 +70,16 @@ jobs:
issue_number: context.issue.number,
labels: [label],
});
core.setOutput('title', 'semantic');
- name: Delete Comment
if: success()
if: steps.check.outputs.title == 'semantic'
uses: everpcpc/comment-on-pr-action@v1
with:
token: ${{ github.token }}
identifier: 'pr-assistant-title'
delete: true
- name: Comment on PR
if: failure()
if: steps.check.outputs.title == 'not-semantic'
uses: everpcpc/comment-on-pr-action@v1
with:
token: ${{ github.token }}
Expand Down Expand Up @@ -103,26 +110,34 @@ jobs:
cla:
runs-on: ubuntu-latest
if: '!github.event.pull_request.draft'
steps:
- name: Check CLA if not signed
uses: actions/github-script@v6
id: check
with:
script: |
if (!context.payload.pull_request) {
core.info('PR payload is null');
core.setOutput('cla', 'ignore');
return;
}
const body = context.payload.pull_request.body;
const regex = /I hereby agree to the terms of the CLA available at: https:\/\/databend\.rs\/dev\/policies\/cla\//;
if (!regex.test(body)) {
core.setFailed('CLA is not signed');
core.error('CLA is not signed');
core.setOutput('cla', 'not-signed');
} else {
core.setOutput('cla', 'signed');
}
- name: Delete Comment
if: success()
if: steps.check.outputs.cla == 'signed'
uses: everpcpc/comment-on-pr-action@v1
with:
token: ${{ github.token }}
identifier: 'pr-assistant-cla'
delete: true
- name: Comment on PR
if: failure()
if: steps.check.outputs.cla == 'not-signed'
uses: everpcpc/comment-on-pr-action@v1
with:
token: ${{ github.token }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/reuse.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ jobs:
dirs:
- "ydb"
- "tpcds"
- "tpch"
# FIXME: flaky
# - "tpch"
- "cluster"
steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions scripts/setup/rust-tools.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cargo-audit@0.17.6
cargo-machete@0.5.0
[email protected].58
cargo-audit@0.18.2
cargo-machete@0.6.0
[email protected].59
[email protected]
[email protected].3
[email protected].18

1 comment on commit f239699

@vercel
Copy link

@vercel vercel bot commented on f239699 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.