Skip to content

Commit

Permalink
ci(create-pr-branch): allow to disable a comment (#1521)
Browse files Browse the repository at this point in the history
* ci(create-pr-branch): allow to disable a comment

* ci: add run-name

* ci: set run-name
  • Loading branch information
suzuki-shunsuke committed Feb 9, 2024
1 parent 402c41c commit ce3c617
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/create-pr-branch.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
---
name: Create Pull Request Branch
run-name: Create Pull Request Branch (${{inputs.pr}})
on:
workflow_dispatch:
inputs:
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 +19,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}}
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Release
run-name: Release ${{inputs.tag}} ${{inputs.ref}}
on:
workflow_dispatch:
inputs:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/wc-create-pr-branch.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
---
name: Create Pull Request Branch
name: wc-create-pr-branch
run-name: wc-create-pr-branch (${{inputs.pr}})
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 +82,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 ce3c617

Please sign in to comment.