Skip to content

Commit 6029f1d

Browse files
openshift-pipelines-botsavitaashture
openshift-pipelines-bot
authored andcommitted
[bot:main] update konflux configuration
1 parent cec35bf commit 6029f1d

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated for Konflux Application openshift-pipelines-core-1.16 by openshift-pipelines/hack. DO NOT EDIT
2+
name: auto-merge-upstream-release-v0.16.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-v0.16.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-v0.16.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+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Generated for Konflux Application openshift-pipelines-core-1.16 by openshift-pipelines/hack. DO NOT EDIT
2+
name: update-sources-release-v0.16.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-v0.16.x
22+
23+
- name: Clone tektoncd/results
24+
run: |
25+
rm -fR upstream
26+
git clone https://github.com/tektoncd/results upstream
27+
pushd upstream
28+
git checkout -B release-v0.12.x origin/release-v0.12.x
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-release-v0.16.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-v0.16.x from tektoncd/results 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/results/compare/${NEW_COMMIT}..${OLD_COMMIT}
63+
EOF
64+
65+
git push -f origin actions/update/sources-release-v0.16.x
66+
67+
if [ "$(gh pr list --base release-v0.16.x --head actions/update/sources-release-v0.16.x --json url --jq 'length')" = "0" ]; then
68+
echo "creating PR..."
69+
gh pr create -B release-v0.16.x -H actions/update/sources-release-v0.16.x --label=automated --label=upstream --fill
70+
else
71+
echo "a PR already exists, editing..."
72+
gh pr edit --title "[bot] Update release-v0.16.x from tektoncd/results to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
73+
fi
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)