mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-23 22:15:49 +00:00
chore(root): GA fixes
This commit is contained in:
parent
cc7cab4555
commit
543d771369
28
.github/workflows/publish-dashboard.yaml
vendored
28
.github/workflows/publish-dashboard.yaml
vendored
@ -64,43 +64,27 @@ jobs:
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: pages deploy ./packages/dashboard/build --project-name=pockethost --branch=${{ github.event.pull_request.head.ref || github.ref_name }}
|
||||
|
||||
- name: Find related pull request
|
||||
id: find_pr
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const { owner, repo } = context.repo
|
||||
const branch = (context.payload.pull_request && context.payload.pull_request.head && context.payload.pull_request.head.ref)
|
||||
|| process.env.GITHUB_HEAD_REF
|
||||
|| process.env.GITHUB_REF_NAME
|
||||
const prs = await github.rest.pulls.list({ owner, repo, state: 'open', head: `${owner}:${branch}` })
|
||||
if (prs.data.length > 0) {
|
||||
return String(prs.data[0].number)
|
||||
}
|
||||
return ''
|
||||
|
||||
- name: Comment preview URL on PR
|
||||
if: steps.find_pr.outputs.result != ''
|
||||
if: github.event_name == 'pull_request_target'
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ steps.find_pr.outputs.result }}
|
||||
number: ${{ github.event.pull_request.number }}
|
||||
header: pockethost-dashboard-preview
|
||||
message: |
|
||||
✅ Preview available: ${{ steps.deployment.outputs.deployment-url }}
|
||||
Triggered by @${{ github.actor }} on `${{ github.ref_name }}`.
|
||||
Triggered by @${{ github.actor }} on `${{ github.event.pull_request.head.ref }}`.
|
||||
|
||||
- name: Discord feature branch notification
|
||||
if: github.ref_name != env.MAIN_BRANCH
|
||||
if: github.event_name == 'pull_request_target' || (github.event_name == 'push' && github.ref_name != env.MAIN_BRANCH)
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: '**DASHBOARD PREVIEW** ${{ steps.deployment.outputs.deployment-url }} was generated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}) with memo `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'
|
||||
args: '**DASHBOARD PREVIEW** ${{ steps.deployment.outputs.deployment-url }} was generated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.event.pull_request.head.ref || github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.event.pull_request.head.ref || github.ref_name }}) with memo `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'
|
||||
|
||||
- name: Discord live branch notification
|
||||
if: github.ref_name == env.MAIN_BRANCH
|
||||
if: github.event_name == 'push' && github.ref_name == env.MAIN_BRANCH
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
uses: Ilshidur/action-discord@master
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user