Skip to content

auto-merge-upstream #14672

auto-merge-upstream

auto-merge-upstream #14672

# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
name: auto-merge-upstream-tektoncd-pruner
on:
workflow_dispatch: {}
schedule:
- cron: "*/30 * * * *" # At every 30 minutes
jobs:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout the current repo
uses: actions/checkout@v4
- name: auto-merge-upstream-tektoncd-pruner
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
pr_list=$(gh pr list \
--state open \
--label upstream \
--json number,title,statusCheckRollup \
--jq ' .[]| select((.statusCheckRollup // [])| all(.conclusion == "SUCCESS" or .conclusion == "SKIPPED"))| "\(.number)"')
for p in $pr_list; do
echo "Approving PR $p"
gh pr edit $p --add-label "lgtm,approved" || true
echo "Merging PR $p"
gh pr merge --rebase --delete-branch --auto $p
done
env:
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}