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(create-pr-branch): allow to disable a comment #1521

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
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
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}}
Loading