-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (31 loc) · 1.2 KB
/
deploy-complete.yml
File metadata and controls
37 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: 'Post Deploy Comment'
on:
repository_dispatch:
types: [deploy-complete]
jobs:
post-comment:
runs-on: ubuntu-latest
steps:
- name: 💬 Post deploy info to PR
uses: actions/github-script@v7
with:
script: |
const prNumber = '${{ github.event.client_payload.pr_number }}';
const deployUrl = '${{ github.event.client_payload.deploy_url }}';
const slotNumber = '${{ github.event.client_payload.slot_number }}';
const appName = '${{ github.event.client_payload.app_name }}';
const namespace = '${{ github.event.client_payload.namespace }}';
const body = `## 🚀 Deploy Complete!
| Property | Value |
|----------|-------|
| **App** | \`${appName}\` |
| **Slot** | \`${slotNumber}\` |
| **URL** | [${deployUrl}](${deployUrl}) |
| **Namespace** | \`${namespace}\` |
*(Environment ready for testing)*`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: parseInt(prNumber),
body: body
});