Skip to content

Commit 73e50ee

Browse files
openshift-pipelines-botmbpavan
authored andcommitted
[bot:main] update konflux configuration
1 parent d2e8d69 commit 73e50ee

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated for Konflux Application openshift-pipelines-core-1.20 by openshift-pipelines/hack. DO NOT EDIT
2+
name: auto-merge-upstream-release-v1.20.x
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-release-v1.20.x
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-release-v1.20.x" --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+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Generated for Konflux Application openshift-pipelines-core-1.20 by openshift-pipelines/hack. DO NOT EDIT
2+
name: update-sources-release-v1.20.x
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: release-v1.20.x
22+
23+
- name: Clone tektoncd/pipeline
24+
run: |
25+
rm -fR upstream
26+
git clone https://github.com/tektoncd/pipeline upstream
27+
pushd upstream
28+
git checkout -B release-v1.3.x origin/release-v1.3.x
29+
popd
30+
- name: Commit new changes
31+
run: |
32+
git config user.name openshift-pipelines-bot
33+
git config user.email [email protected]
34+
git checkout -b actions/update/sources-release-v1.20.x
35+
touch head
36+
pushd upstream
37+
OLD_COMMIT=$(cat ../head)
38+
NEW_COMMIT=$(git rev-parse HEAD)
39+
echo Previous commit: ${OLD_COMMIT}
40+
git show --stat ${OLD_COMMIT}
41+
echo New commit: ${NEW_COMMIT}
42+
git show --stat ${NEW_COMMIT}
43+
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
44+
git rev-parse HEAD > ../head
45+
popd
46+
rm -rf upstream/.git
47+
git add -f upstream head .konflux
48+
49+
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
50+
echo "No change, exiting"
51+
exit 0
52+
fi
53+
54+
git commit -F- <<EOF
55+
[bot] Update release-v1.20.x from tektoncd/pipeline to ${NEW_COMMIT}
56+
57+
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
58+
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)
59+
60+
https://github.com/tektoncd/pipeline/compare/${NEW_COMMIT}..${OLD_COMMIT}
61+
EOF
62+
63+
git push -f origin actions/update/sources-release-v1.20.x
64+
65+
if [ "$(gh pr list --base release-v1.20.x --head actions/update/sources-release-v1.20.x --json url --jq 'length')" = "0" ]; then
66+
echo "creating PR..."
67+
gh pr create -B release-v1.20.x -H actions/update/sources-release-v1.20.x --label=automated --label=upstream --fill
68+
else
69+
echo "a PR already exists, editing..."
70+
gh pr edit --title "[bot] Update release-v1.20.x from tektoncd/pipeline to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
71+
fi
72+
env:
73+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)