Skip to content

[bot:openshift-pipelines-core:main] update konflux configuration #1043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/auto-merge-upstream-release-v1.20.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated for Konflux Application openshift-pipelines-core-1.20 by openshift-pipelines/hack. DO NOT EDIT
name: auto-merge-upstream-release-v1.20.x

on:
workflow_dispatch: {}
schedule:
- cron: "*/30 * * * *" # At every 30 minutes

jobs:
auto-approve:
runs-on: ubuntu-latest
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
permissions:
pull-requests: write
steps:
- name: Checkout the current repo
uses: actions/checkout@v4
- name: auto-merge-upstream-release-v1.20.x
run: |
gh auth status
git config user.name openshift-pipelines-bot
git config user.email [email protected]
# Approve and merge pull-request with no reviews
for p in $(gh pr list --search "head:actions/update/sources-release-v1.20.x" --json "number" | jq ".[].number"); do
gh pr merge --rebase --delete-branch --auto $p
done
env:
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}

73 changes: 73 additions & 0 deletions .github/workflows/update-sources-release-v1.20.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Generated for Konflux Application openshift-pipelines-core-1.20 by openshift-pipelines/hack. DO NOT EDIT
name: update-sources-release-v1.20.x

on:
workflow_dispatch: {}
schedule:
- cron: "0 1 * * *" # At 1AM everyday

jobs:

update-sources:
runs-on: ubuntu-latest
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the current repo
uses: actions/checkout@v4
with:
ref: release-v1.20.x

- name: Clone tektoncd/pipeline
run: |
rm -fR upstream
git clone https://github.com/tektoncd/pipeline upstream
pushd upstream
git checkout -B release-v1.3.x origin/release-v1.3.x
popd
- name: Commit new changes
run: |
git config user.name openshift-pipelines-bot
git config user.email [email protected]
git checkout -b actions/update/sources-release-v1.20.x
touch head
pushd upstream
OLD_COMMIT=$(cat ../head)
NEW_COMMIT=$(git rev-parse HEAD)
echo Previous commit: ${OLD_COMMIT}
git show --stat ${OLD_COMMIT}
echo New commit: ${NEW_COMMIT}
git show --stat ${NEW_COMMIT}
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
git rev-parse HEAD > ../head
popd
rm -rf upstream/.git
git add -f upstream head .konflux

if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
echo "No change, exiting"
exit 0
fi

git commit -F- <<EOF
[bot] Update release-v1.20.x from tektoncd/pipeline to ${NEW_COMMIT}

$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)

https://github.com/tektoncd/pipeline/compare/${NEW_COMMIT}..${OLD_COMMIT}
EOF

git push -f origin actions/update/sources-release-v1.20.x

if [ "$(gh pr list --base release-v1.20.x --head actions/update/sources-release-v1.20.x --json url --jq 'length')" = "0" ]; then
echo "creating PR..."
gh pr create -B release-v1.20.x -H actions/update/sources-release-v1.20.x --label=automated --label=upstream --fill
else
echo "a PR already exists, editing..."
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)"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}