Skip to content

Commit aa10c82

Browse files
author
openshift-pipelines-bot
committed
[bot:release-v1.22.x] update konflux configuration
1 parent f544fb5 commit aa10c82

File tree

4 files changed

+127
-21
lines changed

4 files changed

+127
-21
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
2+
name: auto-merge-upstream-tektoncd-git-clone
3+
4+
on:
5+
workflow_dispatch: {}
6+
schedule:
7+
- cron: "*/30 * * * *" # At every 30 minutes
8+
9+
jobs:
10+
auto-approve:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
steps:
15+
- name: Checkout the current repo
16+
uses: actions/checkout@v4
17+
- name: auto-merge-upstream-tektoncd-git-clone
18+
run: |
19+
gh auth status
20+
git config user.name openshift-pipelines-bot
21+
git config user.email [email protected]
22+
# Approve and merge pull-request with no reviews
23+
for p in $(gh pr list --search "head:actions/update/sources-tektoncd-git-clone" --json "number" | jq ".[].number"); do
24+
gh pr merge --rebase --delete-branch --auto $p
25+
done
26+
env:
27+
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
28+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
2+
name: update-sources-tektoncd-git-clone
3+
4+
on:
5+
workflow_dispatch: {}
6+
schedule:
7+
- cron: "0 1 * * *" # At 1AM everyday
8+
9+
jobs:
10+
11+
update-sources:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
steps:
17+
- name: Checkout the current repo
18+
uses: actions/checkout@v4
19+
with:
20+
ref: release-v1.22.x
21+
22+
- name: Clone tektoncd-catalog/git-clone
23+
run: |
24+
rm -fR upstream
25+
git clone https://github.com/tektoncd-catalog/git-clone upstream
26+
pushd upstream
27+
git checkout -B release-v1.2.x origin/release-v1.2.x
28+
popd
29+
- name: Commit new changes
30+
run: |
31+
32+
set -x
33+
34+
git config user.name openshift-pipelines-bot
35+
git config user.email [email protected]
36+
git checkout -b actions/update/sources-release-v1.22.x
37+
touch head
38+
pushd upstream
39+
OLD_COMMIT=$(cat ../head)
40+
NEW_COMMIT=$(git rev-parse HEAD)
41+
echo Previous commit: ${OLD_COMMIT}
42+
git show --stat ${OLD_COMMIT}
43+
echo New commit: ${NEW_COMMIT}
44+
git show --stat ${NEW_COMMIT}
45+
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
46+
git rev-parse HEAD > ../head
47+
popd
48+
rm -rf upstream/.git
49+
git add -f upstream head .konflux
50+
51+
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
52+
echo "No change, exiting"
53+
exit 0
54+
fi
55+
56+
git commit -F- <<EOF
57+
[bot] Update release-v1.22.x from tektoncd-catalog/git-clone to ${NEW_COMMIT}
58+
59+
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
60+
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)
61+
62+
https://github.com/tektoncd-catalog/git-clone/compare/${NEW_COMMIT}..${OLD_COMMIT}
63+
EOF
64+
65+
git push -f origin actions/update/sources-release-v1.22.x
66+
67+
if [ "$(gh pr list --base release-v1.22.x --head actions/update/sources-release-v1.22.x --json url --jq 'length')" = "0" ]; then
68+
echo "creating PR..."
69+
gh pr create -B release-v1.22.x -H actions/update/sources-release-v1.22.x --label=automated --label=upstream --fill
70+
else
71+
echo "a PR already exists, editing..."
72+
gh pr edit --title "[bot] Update release-v1.22.x from tektoncd-catalog/git-clone to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
73+
fi
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.tekton/tektoncd-git-clone-next-git-init-pull-request.yaml renamed to .tekton/tektoncd-git-clone-1-22-git-init-pull-request.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated for Konflux Application openshift-pipelines-core-next by openshift-pipelines/hack. DO NOT EDIT
1+
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
22
apiVersion: tekton.dev/v1
33
kind: PipelineRun
44
metadata:
@@ -11,31 +11,32 @@ metadata:
1111
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
1212
pipelinesascode.tekton.dev/max-keep-runs: "3"
1313
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
14-
== "next" &&
14+
== "release-v1.22.x" &&
1515
("upstream/***".pathChanged() || ".konflux/patches/***".pathChanged() || ".konflux/rpms/***".pathChanged() ||
1616
".konflux/dockerfiles/git-init.Dockerfile".pathChanged() ||
17-
".tekton/tektoncd-git-clone-next-git-init-pull-request.yaml".pathChanged())
18-
creationTimestamp: null
17+
".tekton/tektoncd-git-clone-1-22-git-init-pull-request.yaml".pathChanged())
1918
labels:
20-
appstudio.openshift.io/application: openshift-pipelines-core-next
21-
appstudio.openshift.io/component: tektoncd-git-clone-next-git-init
19+
appstudio.openshift.io/application: openshift-pipelines-core-1-22
20+
appstudio.openshift.io/component: tektoncd-git-clone-git-init-1-22
2221
pipelines.appstudio.openshift.io/type: build
23-
name: tektoncd-git-clone-next-git-init-on-pull-request
22+
name: tektoncd-git-clone-1-22-git-init-on-pull-request
2423
namespace: tekton-ecosystem-tenant
2524
spec:
2625
params:
2726
- name: git-url
2827
value: '{{source_url}}'
29-
- name: upstream-git-url
30-
value: 'https://github.com/tektoncd-catalog/git-clone'
3128
- name: revision
3229
value: '{{revision}}'
3330
- name: output-image
34-
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/next/git-init-rhel9:on-pr-{{revision}}
31+
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/git-init-rhel9:on-pr-{{revision}}
3532
- name: image-expires-after
3633
value: 5d
3734
- name: dockerfile
3835
value: .konflux/dockerfiles/git-init.Dockerfile
36+
- name: additional-tags
37+
value:
38+
- "on-pr-1.22"
39+
- "on-pr-1.22.0"
3940
- name: build-platforms
4041
value:
4142
- linux/x86_64
@@ -45,7 +46,7 @@ spec:
4546
pipelineRef:
4647
name: docker-build-ta
4748
taskRunTemplate:
48-
serviceAccountName: build-pipeline-tektoncd-git-clone-next-git-init
49+
serviceAccountName: build-pipeline-tektoncd-git-clone-git-init-1-22
4950
workspaces:
5051
- name: git-auth
5152
secret:

.tekton/tektoncd-git-clone-next-git-init-push.yaml renamed to .tekton/tektoncd-git-clone-1-22-git-init-push.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated for Konflux Application openshift-pipelines-core-next by openshift-pipelines/hack. DO NOT EDIT
1+
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
22
apiVersion: tekton.dev/v1
33
kind: PipelineRun
44
metadata:
@@ -10,36 +10,38 @@ metadata:
1010
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
1111
pipelinesascode.tekton.dev/max-keep-runs: "3"
1212
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
13-
== "next" &&
13+
== "release-v1.22.x" &&
1414
("upstream/***".pathChanged() || ".konflux/patches/***".pathChanged() || ".konflux/rpms/***".pathChanged() ||
1515
".konflux/dockerfiles/git-init.Dockerfile".pathChanged() ||
16-
".tekton/tektoncd-git-clone-next-git-init-push.yaml".pathChanged())
16+
".tekton/tektoncd-git-clone-1-22-git-init-push.yaml".pathChanged())
1717
creationTimestamp: null
1818
labels:
19-
appstudio.openshift.io/application: openshift-pipelines-core-next
20-
appstudio.openshift.io/component: tektoncd-git-clone-next-git-init
19+
appstudio.openshift.io/application: openshift-pipelines-core-1-22
20+
appstudio.openshift.io/component: tektoncd-git-clone-git-init-1-22
2121
pipelines.appstudio.openshift.io/type: build
22-
name: tektoncd-git-clone-next-git-init-on-push
22+
name: tektoncd-git-clone-1-22-git-init-on-push
2323
namespace: tekton-ecosystem-tenant
2424
spec:
2525
params:
2626
- name: git-url
2727
value: '{{source_url}}'
2828
- name: revision
2929
value: '{{revision}}'
30-
- name: upstream-git-url
31-
value: 'https://github.com/tektoncd-catalog/git-clone'
3230
- name: output-image
33-
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/next/git-init-rhel9:{{revision}}
31+
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/git-init-rhel9:{{revision}}
3432
- name: dockerfile
3533
value: .konflux/dockerfiles/git-init.Dockerfile
34+
- name: additional-tags
35+
value:
36+
- "1.22"
37+
- "1.22.0"
3638
- name: prefetch-input
3739
value: |
3840
{"type": "rpm", "path": ".konflux/rpms"}
3941
pipelineRef:
4042
name: docker-build-ta
4143
taskRunTemplate:
42-
serviceAccountName: build-pipeline-tektoncd-git-clone-next-git-init
44+
serviceAccountName: build-pipeline-tektoncd-git-clone-git-init-1-22
4345
workspaces:
4446
- name: git-auth
4547
secret:

0 commit comments

Comments
 (0)