Skip to content

Commit

Permalink
ci(create-pr-branch): allow to disable a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Feb 9, 2024
1 parent bbfae9e commit f65d90e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/create-pr-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pr:
description: "Pull Request Number"
required: true
is_comment:
description: Whether a comment is posted
type: boolean
required: true
jobs:
create-pr-branch:
uses: ./.github/workflows/wc-create-pr-branch.yaml
Expand All @@ -14,6 +18,7 @@ jobs:
pull-requests: write
with:
pr: ${{fromJSON(inputs.pr)}}
is_comment: ${{inputs.is_comment}}
secrets:
gh_app_id: ${{secrets.APP_ID}}
gh_app_private_key: ${{secrets.APP_PRIVATE_KEY}}
9 changes: 7 additions & 2 deletions .github/workflows/wc-create-pr-branch.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
name: Create Pull Request Branch
name: wc-create-pr-branch
on:
workflow_call:
inputs:
pr:
description: "Pull Request Number"
required: true
type: number
is_comment:
description: If the comment is posted
required: false
default: false
type: boolean
secrets:
gh_app_id:
required: true
Expand Down Expand Up @@ -76,6 +81,6 @@ jobs:
- run: echo "[Pull Request](https://github.com/suzuki-shunsuke/tfaction/pull/$PR_NUMBER)" >> "$GITHUB_STEP_SUMMARY"

- run: github-comment post -pr "$PR_NUMBER" -k create-pr-branch
if: github.event_name == 'workflow_dispatch'
if: inputs.is_comment
env:
GITHUB_TOKEN: ${{github.token}}

0 comments on commit f65d90e

Please sign in to comment.