Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add a workflow that can close PRs made from the bot account #156

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/closepr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Close a PR raised by the 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. Example: 'redhat-openshift-ecosystem/community-operators-prod'"
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"}'