Skip to content

Commit b4b73a5

Browse files
openshift-pipelines-botsavitaashture
authored andcommitted
[bot:main] update konflux configuration
1 parent 0cbe94e commit b4b73a5

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Generated for Release 1.14 by openshift-pipelines/hack. DO NOT EDIT.
2+
name: update-sources-release-v1.14.x
3+
4+
on:
5+
workflow_dispatch: {}
6+
schedule:
7+
- cron: "0 1 * * 1" # At 1AM every monday
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.14.x
22+
23+
- name: Clone tektoncd-catalog/git-clone
24+
run: |
25+
rm -fR upstream
26+
git clone https://github.com/tektoncd-catalog/git-clone upstream
27+
pushd upstream
28+
git checkout -B release-v1.0.x origin/release-v1.0.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-v1.14.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
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.14.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.14.x
66+
67+
if [ "$(gh pr list --base release-v1.14.x --head actions/update/sources-release-v1.14.x --json url --jq 'length')" = "0" ]; then
68+
echo "creating PR..."
69+
gh pr create -B release-v1.14.x -H actions/update/sources-release-v1.14.x --label=automated --label=upstream --fill
70+
else
71+
echo "a PR already exists, editing..."
72+
gh pr edit --title "[bot] Update release-v1.14.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 }}

0 commit comments

Comments
 (0)