Skip to content

Commit f489d78

Browse files
committed
delete-on-pr-close
1 parent 7685e2b commit f489d78

File tree

2 files changed

+5
-60
lines changed

2 files changed

+5
-60
lines changed

.github/workflows/deploy-to-control-plane.yml

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -270,66 +270,6 @@ jobs:
270270
body: isSuccess ? successMessage : failureMessage
271271
});
272272
273-
debug-help:
274-
if: always()
275-
runs-on: ubuntu-latest
276-
steps:
277-
- name: Debug Trigger Conditions
278-
env:
279-
EVENT_NAME: ${{ github.event_name }}
280-
IS_PR: ${{ toJSON(github.event.issue.pull_request) }}
281-
COMMENT: ${{ github.event.comment.body }}
282-
run: |
283-
echo "Debug information for help command:"
284-
echo "Event name: $EVENT_NAME"
285-
echo "Is PR (raw): $IS_PR"
286-
echo "Comment body: $COMMENT"
287-
echo "Raw event payload:"
288-
echo '${{ toJSON(github.event) }}'
289-
290-
show-help:
291-
needs: debug-help
292-
if: |
293-
github.event_name == 'issue_comment' &&
294-
github.event.issue.pull_request &&
295-
github.event.comment.body == '/help'
296-
runs-on: ubuntu-latest
297-
298-
steps:
299-
- name: Show Available Commands
300-
uses: actions/github-script@v7
301-
with:
302-
script: |
303-
const helpMessage = [
304-
'## Available Commands',
305-
'',
306-
'### `/deploy`',
307-
'Deploys your PR branch to a review environment on Control Plane.',
308-
'- Creates a new review app if one doesn\'t exist',
309-
'- Updates the existing review app if it already exists',
310-
'- Provides a unique URL to preview your changes',
311-
'- Shows build and deployment progress in real-time',
312-
'',
313-
'### `/delete-review-app`',
314-
'Deletes the review app associated with this PR.',
315-
'- Removes all resources from Control Plane',
316-
'- Helpful for cleaning up when you\'re done testing',
317-
'- Can be re-deployed later using `/deploy`',
318-
'',
319-
'### `/help`',
320-
'Shows this help message explaining available commands.',
321-
'',
322-
'---',
323-
'_Note: These commands only work in pull request comments._'
324-
].join('\n');
325-
326-
await github.rest.issues.createComment({
327-
owner: context.repo.owner,
328-
repo: context.repo.repo,
329-
issue_number: context.payload.issue.number,
330-
body: helpMessage
331-
});
332-
333273
debug-delete:
334274
if: always()
335275
runs-on: ubuntu-latest

.github/workflows/help-command.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
issue_comment:
55
types: [created]
66

7+
# Use concurrency to prevent duplicate runs
8+
concurrency:
9+
group: help-${{ github.event.issue.number }}
10+
cancel-in-progress: true
11+
712
permissions:
813
issues: write
914
pull-requests: write

0 commit comments

Comments
 (0)