Skip to content

Commit

Permalink
feat(apps/prod/tekton/configs): update trigger for ci-helper-for-pr
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo committed Nov 11, 2024
1 parent 1025c93 commit 92d22c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
23 changes: 17 additions & 6 deletions apps/prod/tekton/configs/tasks/ci/ci-helper-for-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,23 @@ spec:
description: pull request number
steps:
- name: create-pull-request
image: denoland/deno:1.45.5
image: bitnami/git:2.43.0
script: |
echo "owner: $(params.owner)"
echo "repo: $(params.repo)"
echo "number: $(params.number)"
#!/usr/bin/env bash
set -exo pipefail
# install `gh` tool
type -p curl >/dev/null || ( apt update && apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
# truct the pull request
echo "pull request url: https://github.com/$(params.owner)/$(params.repo)/pull/$(params.number)"
gh auth login --with-token < $(workspaces.github.path)/token
gh pr edit --add-label ok-to-test --remove-label needs-ok-to-test https://github.com/$(params.owner)/$(params.repo)/pull/$(params.number)
workspaces:
- name: github
description: Must includes a key `token`
mountPath: /etc/github
description: Must includes a key `token`
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ spec:
&&
body.label.name in ['needs-ok-to-test']
&&
body.repository.owner.login in ['pingcap', 'tikv', "PingCAP-QE"]
body.repository.owner.login in ["PingCAP-QE", "pingcap", "tikv"]
&&
body.pull_request.user.login in ["wuhuizuo", "purelind", "VelocityLight"]
bindings:
- ref: github-pr
template:
Expand Down

0 comments on commit 92d22c9

Please sign in to comment.