Skip to content

Commit 8e543d8

Browse files
author
openshift-pipelines-bot
committed
[bot:main] update konflux configuration
1 parent 21be590 commit 8e543d8

4 files changed

+204
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated for Konflux Application openshift-pipelines-core-main by openshift-pipelines/hack. DO NOT EDIT
2+
name: auto-merge-upstream-main
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+
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
13+
permissions:
14+
pull-requests: write
15+
steps:
16+
- name: Checkout the current repo
17+
uses: actions/checkout@v4
18+
- name: auto-merge-upstream-main
19+
run: |
20+
gh auth status
21+
git config user.name openshift-pipelines-bot
22+
git config user.email [email protected]
23+
# Approve and merge pull-request with no reviews
24+
for p in $(gh pr list --search "head:actions/update/sources-main" --json "number" | jq ".[].number"); do
25+
gh pr merge --rebase --delete-branch --auto $p
26+
done
27+
env:
28+
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
29+
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Generated for Konflux Application openshift-pipelines-core-main by openshift-pipelines/hack. DO NOT EDIT
2+
name: update-sources-main
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+
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
steps:
18+
- name: Checkout the current repo
19+
uses: actions/checkout@v4
20+
with:
21+
ref: main
22+
23+
- name: Clone tektoncd/chains
24+
run: |
25+
rm -fR upstream
26+
git clone https://github.com/tektoncd/chains upstream
27+
pushd upstream
28+
git checkout -B main origin/main
29+
popd
30+
31+
32+
- name: Commit new changes
33+
run: |
34+
git config user.name openshift-pipelines-bot
35+
git config user.email [email protected]
36+
git checkout -b actions/update/sources-main
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 main from tektoncd/chains 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/chains/compare/${NEW_COMMIT}..${OLD_COMMIT}
63+
EOF
64+
65+
git push -f origin actions/update/sources-main
66+
67+
if [ "$(gh pr list --base main --head actions/update/sources-main --json url --jq 'length')" = "0" ]; then
68+
echo "creating PR..."
69+
gh pr create -B main -H actions/update/sources-main --label=automated --label=upstream --fill
70+
else
71+
echo "a PR already exists, editing..."
72+
gh pr edit --title "[bot] Update main from tektoncd/chains to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
73+
fi
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Generated for Konflux Application openshift-pipelines-core-main by openshift-pipelines/hack. DO NOT EDIT
2+
apiVersion: tekton.dev/v1
3+
kind: PipelineRun
4+
metadata:
5+
annotations:
6+
#pipelinesascode.tekton.dev/cancel-in-progress: "true" # Cancel in-progress pipelines
7+
pipelinesascode.tekton.dev/pipeline: "https://raw.githubusercontent.com/openshift-pipelines/operator/refs/heads/main/.tekton/docker-build-ta.yaml"
8+
build.appstudio.openshift.io/repo: https://github.com/openshift-pipelines/tektoncd-chains.git?rev={{revision}}
9+
build.appstudio.redhat.com/commit_sha: '{{revision}}'
10+
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
11+
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
12+
pipelinesascode.tekton.dev/max-keep-runs: "3"
13+
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
14+
== "main" &&
15+
("upstream/***".pathChanged() || ".konflux/patches/***".pathChanged() || ".konflux/rpms/***".pathChanged() ||
16+
".konflux/dockerfiles/controller.Dockerfile".pathChanged() ||
17+
".tekton/tektoncd-chains-main-controller-pull-request.yaml".pathChanged())
18+
creationTimestamp: null
19+
labels:
20+
appstudio.openshift.io/application: openshift-pipelines-core-main
21+
appstudio.openshift.io/component: tektoncd-chains-main-controller
22+
pipelines.appstudio.openshift.io/type: build
23+
name: tektoncd-chains-main-controller-on-pull-request
24+
namespace: tekton-ecosystem-tenant
25+
spec:
26+
params:
27+
- name: git-url
28+
value: '{{source_url}}'
29+
- name: revision
30+
value: '{{revision}}'
31+
- name: output-image
32+
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/main/chains-controller-rhel9:on-pr-{{revision}}
33+
- name: image-expires-after
34+
value: 5d
35+
- name: dockerfile
36+
value: .konflux/dockerfiles/controller.Dockerfile
37+
- name: build-platforms
38+
value:
39+
- linux/x86_64
40+
- name: prefetch-input
41+
value: |
42+
{"type": "rpm", "path": ".konflux/rpms"}
43+
pipelineRef:
44+
name: docker-build-ta
45+
taskRunTemplate:
46+
serviceAccountName: build-pipeline-tektoncd-chains-main-controller
47+
workspaces:
48+
- name: git-auth
49+
secret:
50+
secretName: '{{ git_auth_secret }}'
51+
status: {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Generated for Konflux Application openshift-pipelines-core-main by openshift-pipelines/hack. DO NOT EDIT
2+
apiVersion: tekton.dev/v1
3+
kind: PipelineRun
4+
metadata:
5+
annotations:
6+
pipelinesascode.tekton.dev/cancel-in-progress: "true" # Cancel in-progress pipelines
7+
pipelinesascode.tekton.dev/pipeline: "https://raw.githubusercontent.com/openshift-pipelines/operator/refs/heads/main/.tekton/docker-build-ta.yaml"
8+
build.appstudio.openshift.io/repo: https://github.com/openshift-pipelines/tektoncd-chains.git?rev={{revision}}
9+
build.appstudio.redhat.com/commit_sha: '{{revision}}'
10+
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
11+
pipelinesascode.tekton.dev/max-keep-runs: "3"
12+
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
13+
== "main" &&
14+
("upstream/***".pathChanged() || ".konflux/patches/***".pathChanged() || ".konflux/rpms/***".pathChanged() ||
15+
".konflux/dockerfiles/controller.Dockerfile".pathChanged() ||
16+
".tekton/tektoncd-chains-main-controller-push.yaml".pathChanged())
17+
creationTimestamp: null
18+
labels:
19+
appstudio.openshift.io/application: openshift-pipelines-core-main
20+
appstudio.openshift.io/component: tektoncd-chains-main-controller
21+
pipelines.appstudio.openshift.io/type: build
22+
name: tektoncd-chains-main-controller-on-push
23+
namespace: tekton-ecosystem-tenant
24+
spec:
25+
params:
26+
- name: git-url
27+
value: '{{source_url}}'
28+
- name: revision
29+
value: '{{revision}}'
30+
- name: output-image
31+
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/main/chains-controller-rhel9:{{revision}}
32+
- name: dockerfile
33+
value: .konflux/dockerfiles/controller.Dockerfile
34+
- name: build-platforms
35+
value:
36+
- linux/x86_64
37+
- linux-m2xlarge/arm64
38+
- name: prefetch-input
39+
value: |
40+
{"type": "rpm", "path": ".konflux/rpms"}
41+
pipelineRef:
42+
name: docker-build-ta
43+
taskRunTemplate:
44+
serviceAccountName: build-pipeline-tektoncd-chains-main-controller
45+
workspaces:
46+
- name: git-auth
47+
secret:
48+
secretName: '{{ git_auth_secret }}'
49+
status: {}

0 commit comments

Comments
 (0)