Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Cmiel <[email protected]>
  • Loading branch information
chmeliik committed Sep 13, 2024
1 parent 220e5df commit 185c619
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
16 changes: 15 additions & 1 deletion .tekton/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: build-definitions-pull-request
annotations:
pipelinesascode.tekton.dev/on-cel-expression: (event == "pull_request" && target_branch == "main" && ( !has(body.pull_request) || !body.pull_request.draft) ) || (event == "push" && target_branch.startsWith("gh-readonly-queue/main/"))
pipelinesascode.tekton.dev/task: "[task/git-clone/0.1/git-clone.yaml, .tekton/tasks/buildah.yaml, .tekton/tasks/yaml-lint.yaml, .tekton/tasks/e2e-test.yaml, task/sast-snyk-check/0.2/sast-snyk-check.yaml]"
pipelinesascode.tekton.dev/task: "[task/update-infra-deployments/0.1/update-infra-deployments.yaml, task/git-clone/0.1/git-clone.yaml, .tekton/tasks/buildah.yaml, .tekton/tasks/yaml-lint.yaml, .tekton/tasks/e2e-test.yaml, task/sast-snyk-check/0.2/sast-snyk-check.yaml]"
pipelinesascode.tekton.dev/task-2: "yaml-lint"
pipelinesascode.tekton.dev/max-keep-runs: "5"
spec:
Expand All @@ -24,6 +24,20 @@ spec:
workspaces:
- name: workspace
tasks:
- name: update-infra-repo
params:
- name: ORIGIN_REPO
value: $(params.repo_url)
- name: REVISION
value: $(params.revision)
- name: SCRIPT
value: |
#!/bin/bash
ts=$(date '+%s')
sed -i -E "s/[0-9a-f]{40}/test-$ts/g" components/build-service/base/build-pipeline-config/build-pipeline-config.yaml
taskRef:
name: update-infra-deployments

- name: fetch-repository
taskRef:
name: git-clone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,16 @@ spec:
data={
"head": repo_name,
"base": "main",
"title": f"{repo_name} update",
"title": f"test: {repo_name} update",
"draft": True,
"maintainer_can_modify": False
})
json_output = req.json()
print(json_output)
return json_output
def create_reset_branch(self):
branch = ORIGIN_REPO.split('/')[-1]
branch = "acmiel-test"
target_branch = self._request("GET", f"/repos/{TARGET_GH_REPO}/git/refs/heads/{branch}").json()
main_branch_sha = self._request("GET", f"/repos/{TARGET_GH_REPO}/git/refs/heads/main").json()['object']['sha']
if "ref" in target_branch:
Expand Down

0 comments on commit 185c619

Please sign in to comment.