Skip to content

auto-merge-release-v1.15.x #12665

auto-merge-release-v1.15.x

auto-merge-release-v1.15.x #12665

name: auto-merge-release-v1.15.x
on:
workflow_dispatch: {}
schedule:
- cron: "10,40 * * * *" # 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-approve-update-references
run: |
gh auth status
git config user.name openshift-pipelines-bot
git config user.email pipelines-extcomm@redhat.com
# Approve and merge pull-request with no reviews
BASE_BRANCH=release-v1.15.x
echo "Base branch is $BASE_BRANCH"
# LGTM pull requests that might have one review but no more lgtm
for p in $(gh pr list --search "author:app/red-hat-konflux base:$BASE_BRANCH" --json "number" | jq ".[].number"); do
echo "Approving PR $p"
gh pr review $p --approve --body "/lgtm"
done
env:
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
- name: auto-approve-upstream
run: |
gh auth status
git config user.name openshift-pipelines-bot
git config user.email pipelines-extcomm@redhat.com
# Approve and merge pull-request with no reviews
BASE_BRANCH=release-v1.15.x
for p in $(gh pr list --search "head:actions/update/sources-$BASE_BRANCH" --json "number" | jq ".[].number"); do
gh pr review $p --approve --body "/lgtm"
done
env:
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}