Skip to content

Commit 744b34a

Browse files
committed
Do not run auto-merge each 45 minutes but on request.
Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent 9701f44 commit 744b34a

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/auto-merge-on-demand.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Auto Merge Scheduled / On Demand
1+
name: Auto Merge On Demand
22
on:
3-
schedule:
4-
# Workflow runs every 45 minutes
5-
- cron: '*/45 * * * *'
3+
issue_comment:
4+
types:
5+
- created
66
workflow_dispatch:
77
inputs:
88
pr-number:
@@ -16,7 +16,10 @@ permissions:
1616
jobs:
1717
# Get all open PRs
1818
gather-pull-requests:
19-
if: github.repository_owner == 'sclorg'
19+
if: |
20+
github.repository_owner == 'sclorg'
21+
|| (contains(github.event.comment.body, '/auto-merge')
22+
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association))
2023
runs-on: ubuntu-latest
2124

2225
outputs:
@@ -44,7 +47,7 @@ jobs:
4447
name: Parse manual input
4548
run: |
4649
# shellcheck disable=SC2086
47-
echo "result="[ ${{ inputs.pr-number }} ]"" >> $GITHUB_OUTPUT
50+
echo "result="[ ${{ github.event.issue.number }} ]"" >> $GITHUB_OUTPUT
4851
shell: bash
4952

5053
validate-pr:

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ repos:
1818
hooks:
1919
- id: mypy
2020
args: [--strict, --ignore-missing-imports, --install-types, --non-interactive]
21+
additional_dependencies:
22+
- types-PyYAML

0 commit comments

Comments
 (0)