deploy-complete #3
This file contains hidden or 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
| 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 | |
| }); |