|
1 | 1 | # Generated for Konflux Application openshift-pipelines-operator by openshift-pipelines/hack. DO NOT EDIT |
2 | | -name: auto-merge-upstream-tektoncd/operator |
| 2 | +name: auto-merge-upstream-operator |
3 | 3 |
|
4 | 4 | on: |
5 | 5 | workflow_dispatch: {} |
| 6 | + schedule: |
| 7 | + - cron: "*/30 * * * *" # At every 30 minutes |
6 | 8 |
|
7 | 9 | jobs: |
8 | | - auto-approve-and-merge: |
| 10 | + auto-approve: |
9 | 11 | runs-on: ubuntu-latest |
10 | 12 | permissions: |
11 | 13 | pull-requests: write |
12 | 14 | steps: |
13 | | - - id: Checkout the current repo |
14 | | - uses: actions/checkout@v5 |
15 | | - - id: list-prs |
| 15 | + - name: Checkout the current repo |
| 16 | + uses: actions/checkout@v4 |
| 17 | + - name: auto-merge-upstream-operator |
16 | 18 | run: | |
17 | | - echo "Listing PRs" |
18 | 19 | gh auth status |
19 | 20 | git config user.name openshift-pipelines-bot |
20 | 21 | git config user.email [email protected] |
21 | 22 | # Approve and merge pull-request with no reviews |
22 | | -
|
23 | | - pr_list=$(gh pr list \ |
24 | | - --state open \ |
25 | | - --label upstream \ |
26 | | - --json number,title,statusCheckRollup \ |
27 | | - --jq ' .[]| select((.statusCheckRollup // [])| all(.conclusion == "SUCCESS" or .conclusion == "SKIPPED"))| "\(.number)"') |
28 | | - |
29 | | - echo "pr_list=$pr_list" >> "$GITHUB_OUTPUT" |
30 | | - env: |
31 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
32 | | - |
33 | | - - id: add LGTM Label |
34 | | - run: | |
35 | | - # Approve and merge pull-request with no reviews |
36 | | - for p in $pr_list; do |
37 | | - echo "Adding lgtm label to PR $p" |
38 | | - gh pr edit $p --add-label "lgtm" || true |
39 | | - done |
40 | | - env: |
41 | | - pr_list: ${{ steps.list-prs.outputs.pr_list }} |
42 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
43 | | - - id: Merging PRs |
44 | | - run: | |
45 | | - # Approve and merge pull-request with no reviews |
46 | | - for p in $pr_list; do |
47 | | - echo "Merging PR $p" |
| 23 | + for p in $(gh pr list --search "head:actions/update/sources-operator" --json "number" | jq ".[].number"); do |
48 | 24 | gh pr merge --rebase --delete-branch --auto $p |
49 | 25 | done |
50 | 26 | env: |
51 | | - pr_list: ${{ steps.list-prs.outputs.pr_list }} |
52 | 27 | GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} |
| 28 | + |
0 commit comments