feat(query): add identifier function from session variable #26385
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "PR Assistant" | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- edited | |
- ready_for_review | |
- converted_to_draft | |
permissions: | |
pull-requests: write | |
contents: read | |
jobs: | |
title: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check PR title if not sematic | |
uses: actions/github-script@v7 | |
id: check | |
with: | |
script: | | |
const script = require('./.github/scripts/check_pr_title.js') | |
await script({ github, context, core }) | |
- name: Delete Comment | |
if: always() && 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: always() && steps.check.outputs.title == 'not-semantic' | |
uses: everpcpc/comment-on-pr-action@v1 | |
with: | |
token: ${{ github.token }} | |
identifier: "pr-assistant-title" | |
body: | | |
This pull request's title is not fulfill the requirements. @${{ github.event.pull_request.user.login }} please update it 🙏. | |
Valid format: | |
``` | |
fix(query): fix group by string bug | |
^ ^---------------------^ | |
| | | |
| +-> Summary in present tense. | |
| | |
+-------> Type: rfc, feat, fix, refactor, ci, docs, chore | |
``` | |
Valid types: | |
- `rfc`: this PR proposes a new RFC | |
- `feat`: this PR introduces a new feature to the codebase | |
- `fix`: this PR patches a bug in codebase | |
- `refactor`: this PR changes the code base without new features or bugfix | |
- `ci`: this PR changes build/testing/ci steps | |
- `docs`: this PR changes the documents or websites | |
- `chore`: this PR only has small changes that no need to record | |
cla: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check CLA if not signed | |
uses: actions/github-script@v7 | |
id: check | |
with: | |
script: | | |
const body = context.payload.pull_request.body; | |
const regex = /I hereby agree to the terms of the CLA available at: https:\/\/docs.databend.com\/dev\/policies\/cla\//; | |
if (!regex.test(body)) { | |
core.setFailed('CLA is not signed'); | |
core.setOutput('cla', 'not-signed'); | |
} else { | |
core.setOutput('cla', 'signed'); | |
} | |
- name: Delete Comment | |
if: always() && 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: always() && steps.check.outputs.cla == 'not-signed' | |
uses: everpcpc/comment-on-pr-action@v1 | |
with: | |
token: ${{ github.token }} | |
identifier: "pr-assistant-cla" | |
body: | | |
Pull request description must contain [CLA](https://docs.databend.com/dev/policies/cla/) like the following: | |
``` | |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/ | |
## Summary | |
Summary about this PR | |
- Close #issue | |
``` | |
description: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check PR description checkbox | |
uses: actions/github-script@v7 | |
id: check | |
with: | |
script: | | |
const script = require('./.github/scripts/check_pr_description.js') | |
await script({ context, core }) | |
- name: Delete Comment for Tests | |
if: always() && steps.check.outputs.tests == 'checked' | |
uses: everpcpc/comment-on-pr-action@v1 | |
with: | |
token: ${{ github.token }} | |
identifier: "pr-assistant-description-tests" | |
delete: true | |
- name: Delete Comment for Changes | |
if: always() && steps.check.outputs.changes == 'checked' | |
uses: everpcpc/comment-on-pr-action@v1 | |
with: | |
token: ${{ github.token }} | |
identifier: "pr-assistant-description-changes" | |
delete: true | |
- name: Comment on PR for Tests | |
if: always() && steps.check.outputs.tests != 'checked' | |
uses: everpcpc/comment-on-pr-action@v1 | |
with: | |
token: ${{ github.token }} | |
identifier: "pr-assistant-description-tests" | |
body: | | |
At least one test kind must be checked in the PR description. | |
@${{ github.event.pull_request.user.login }} please update it 🙏. | |
- name: Comment on PR for Changes | |
if: always() && steps.check.outputs.changes != 'checked' | |
uses: everpcpc/comment-on-pr-action@v1 | |
with: | |
token: ${{ github.token }} | |
identifier: "pr-assistant-description-changes" | |
body: | | |
At least one type of change must be checked in the PR description. | |
@${{ github.event.pull_request.user.login }} please update it 🙏. |