From c4b411b081fa7c8a9a37e33f02029c19aa4dbd10 Mon Sep 17 00:00:00 2001 From: Zhichun Wu Date: Mon, 25 Oct 2021 20:21:06 +0800 Subject: [PATCH] Drop for no usage and security reason --- .github/workflows/verify.yml | 158 ----------------------------------- 1 file changed, 158 deletions(-) delete mode 100644 .github/workflows/verify.yml diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml deleted file mode 100644 index 91725e5fb..000000000 --- a/.github/workflows/verify.yml +++ /dev/null @@ -1,158 +0,0 @@ -name: Verify - -on: - workflow_dispatch: - inputs: - clickhouse: - description: "ClickHouse version" - required: true - default: "latest" - java: - description: "Java version" - required: true - default: "8" - chTz: - description: "ClickHouse timezone" - required: true - default: "Asia/Chongqing" - javaTz: - description: "Java timezone" - required: true - default: "America/Los_Angeles" - pr: - description: "Pull request#" - required: false - pull_request: - types: - - opened - - synchronize - - reopened - paths-ignore: - - "**.md" - - "docs/**" - - "**/CHANGELOG" - issue_comment: - types: - - created - - edited - -jobs: - verify-commented-pr: - runs-on: ubuntu-latest - name: Verify commented PR - if: github.event_name == 'issue_comment' && github.event.issue.pull_request - steps: - - uses: zhicwu/pull-request-comment-trigger@master - id: check - with: - trigger: '@verify' - reaction: rocket - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - name: Extra parameters from PR comment - if: steps.check.outputs.triggered == 'true' - uses: actions/github-script@v3 - id: commented - env: - COMMENT_BODY: '${{ github.event.comment.body }}' - with: - script: | - const keyword = '@verify'; - let buildArgs = process.env.COMMENT_BODY; - core.info(`Got commented body: ${buildArgs}`); - buildArgs = buildArgs.substring(buildArgs.lastIndexOf(keyword) + keyword.length); - const args = buildArgs.match(/[^\s]+/g); - core.info(`Got commented arguments: ${args}`); - - return { - pr: context.issue.number, - clickhouse: args && args.length > 0 ? args[0] : "latest", - java: args && args.length > 1 ? args[1] : "8" - }; - - name: Check out repository - uses: actions/checkout@v2 - - name: Check out commented PR - if: steps.check.outputs.triggered == 'true' - run: | - git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \ - origin pull/${{ fromJSON(steps.commented.outputs.result).pr }}/merge:merged-pr && git checkout merged-pr - - name: Set up JDK - if: steps.check.outputs.triggered == 'true' - uses: actions/setup-java@v1 - with: - java-version: ${{ fromJSON(steps.commented.outputs.result).java }} - continue-on-error: true - - name: Verify with Maven - if: steps.check.outputs.triggered == 'true' - run: | - mvn --batch-mode --update-snapshots \ - -DclickhouseVersion=${{ fromJSON(steps.commented.outputs.result).clickhouse }} \ - -DclickhouseTimezone=Asia/Chongqing \ - -Duser.timezone=America/Los_Angeles verify - id: maven - continue-on-error: true - - name: Comment PR - uses: actions/github-script@v3 - if: steps.check.outputs.triggered == 'true' - env: - CLICKHOUSE_VERSION: ${{ fromJSON(steps.commented.outputs.result).clickhouse }} - JAVA_VERSION: ${{ fromJSON(steps.commented.outputs.result).java }} - PREV_STEP_RESULT: '${{ steps.maven.outcome }}' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { issue: { number: issue_number }, repo: { owner, repo } } = context; - const result = process.env.PREV_STEP_RESULT; - const buildUrl = `https://github.com/${owner}/${repo}/actions/runs/${context.runId}`; - const flag = result === 'success' - ? ':green_circle:' - : (result === 'failure' ? ':red_circle:' : ':yellow_circle:'); - const msg = `${flag} verify using JDK [${process.env.JAVA_VERSION}] and ClickHouse [${process.env.CLICKHOUSE_VERSION}]: [${result}](${buildUrl})`; - github.issues.createComment({ issue_number, owner, repo, body: msg }); - - verify-on-demand: - runs-on: ubuntu-latest - name: Verify on demand - if: github.event_name == 'workflow_dispatch' - steps: - - name: Check out repository - uses: actions/checkout@v2 - - name: Check out PR - run: | - git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr - if: github.event.inputs.pr != '' - - name: Set up JDK ${{ github.event.inputs.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ github.event.inputs.java }} - continue-on-error: true - - name: Verify with Maven - run: | - mvn --batch-mode --update-snapshots \ - -DclickhouseVersion=${{ github.event.inputs.clickhouse }} \ - -DclickhouseTimezone=${{ github.event.inputs.chTz }} \ - -Duser.timezone=${{ github.event.inputs.javaTz }} verify - id: maven - continue-on-error: true - - name: Comment PR - uses: actions/github-script@v3 - if: github.event.inputs.pr != '' - env: - PR_NO: ${{ github.event.inputs.pr }} - CLICKHOUSE_TIMEZONE: ${{ github.event.inputs.chTz }} - CLICKHOUSE_VERSION: ${{ github.event.inputs.clickhouse }} - JAVA_TIMEZONE: ${{ github.event.inputs.javaTz }} - JAVA_VERSION: ${{ github.event.inputs.java }} - PREV_STEP_RESULT: '${{ steps.maven.outcome }}' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issue_number = process.env.PR_NO; - const { repo: { owner, repo } } = context; - const result = process.env.PREV_STEP_RESULT; - const buildUrl = `https://github.com/${owner}/${repo}/actions/runs/${context.runId}`; - const flag = result === 'success' - ? ':green_circle:' - : (result === 'failure' ? ':red_circle:' : ':yellow_circle:'); - const msg = `${flag} verify using JDK [${process.env.JAVA_VERSION}, timezone=${process.env.JAVA_TIMEZONE}] and ClickHouse [${process.env.CLICKHOUSE_VERSION}, timezone=${process.env.CLICKHOUSE_TIMEZONE}]: [${result}](${buildUrl})`; - github.issues.createComment({ issue_number, owner, repo, body: msg });