-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use github/[email protected] to gate the pr comment trigger
- Loading branch information
1 parent
7014fc4
commit d55f178
Showing
1 changed file
with
11 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,7 @@ | |
# It bundles the Desktop App, then creates a PR comment with a link to download the app. | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
types: [created] | ||
workflow_dispatch: | ||
|
||
# permissions needed for reacting to IssueOps commands on issues and PRs | ||
|
@@ -12,31 +11,27 @@ permissions: | |
issues: write | ||
checks: read | ||
|
||
name: Trigger Workflow for Desktop App | ||
name: Workflow to Bundle Desktop App | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
trigger-release: | ||
name: Trigger Release | ||
trigger-on-command: | ||
name: Trigger on "/bundle-desktop" PR comment | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.event.comment.body, '/bundle-desktop') | ||
steps: | ||
- name: Respond to the Comment | ||
uses: actions/github-script@v6 | ||
- uses: github/[email protected] | ||
id: command | ||
with: | ||
script: | | ||
const commentBody = `✅ Workflow started to bundle Desktop App! [View Workflow Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`; | ||
const issueNumber = context.payload.issue.number; | ||
await github.rest.issues.createComment({ | ||
...context.repo, | ||
issue_number: issueNumber, | ||
body: commentBody | ||
}); | ||
command: "/bundle-desktop" | ||
reaction: "rocket" | ||
allowed_contexts: pull_request | ||
|
||
bundle-desktop: | ||
name: Bundle Desktop App on macOS | ||
if: ${{ steps.command.outputs.continue == 'true' }} | ||
# Only run on macOS | ||
runs-on: macos-latest | ||
|
||
|