Skip to content

Commit 6211ddc

Browse files
add approval argument
1 parent e079db4 commit 6211ddc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ethancedwards_api/nixpkgs/nixpkgs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717

1818
parser = reqparse.RequestParser()
1919
parser.add_argument('pr_num', required=True, type=str, location='args')
20+
parser.add_argument('approve', required=False, type=str, location='args', default=False)
2021

2122
class WorkflowRun(Resource):
2223
def post(self):
2324
args = parser.parse_args()
2425

2526
pr_num = args['pr_num']
27+
approve = args['approve']
2628

2729
req = github.post(GITHUB_API + '/repos/ethancedwards8/nixpkgs-review-gha/actions/workflows/review.yml/dispatches',
28-
json={'ref': 'main', 'inputs': {'pr': str(pr_num) }})
30+
json={'ref': 'main', 'inputs': {'pr': str(pr_num), 'approve-on-success': approve }})
2931

3032
return f"success for {pr_num}", 200

0 commit comments

Comments
 (0)