Skip to content

Commit

Permalink
ci: add a workflow to close the pull requests opened by our Move2Kube…
Browse files Browse the repository at this point in the history
… bot account and CI/CD pipeline (#78)

* ci: add a workflow to close the pull requests opened by our Move2Kube bot account and CI/CD pipeline

Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>

* fixup! ci: add a workflow to close the pull requests opened by our Move2Kube bot account and CI/CD pipeline

Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>

---------

Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
  • Loading branch information
HarikrishnanBalagopal authored Aug 31, 2023
1 parent d128f98 commit b8f727b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/closepr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Close a PR raised by Move2Kube bot account

on:
workflow_dispatch:
inputs:
pr_number:
description: "The id of the pull request to close. Example: 3143 for https://github.com/k8s-operatorhub/community-operators/pull/3143"
required: true
repo_owner_and_name:
description: "The repo on which to close the pull request."
required: false
default: 'k8s-operatorhub/community-operators'

jobs:
close_pr:
name: Close an existing PR created by the bot account
runs-on: ubuntu-latest
steps:
- name: close-a-pull-request
run: |
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H 'Authorization: Bearer ${{ secrets.MOVE2KUBE_PATOKEN }}' \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.event.inputs.repo_owner_and_name }}/pulls/${{ github.event.inputs.pr_number }} \
-d '{"state":"closed"}'

0 comments on commit b8f727b

Please sign in to comment.