element-call-Github/.github/workflows/pr-deploy.yaml

32 lines
986 B
YAML
Raw Normal View History

2024-04-13 04:34:08 +08:00
name: PR Preview Deployments
on:
workflow_run:
workflows: ["Build"]
types:
- completed
jobs:
prdetails:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
runs-on: ubuntu-latest
2024-04-13 04:39:22 +08:00
outputs:
2024-04-13 04:34:08 +08:00
pr_number: ${{ steps.prdetails.outputs.pr_id }}
pr_data_json: ${{ steps.prdetails.outputs.data }}
2024-04-13 04:43:24 +08:00
steps:
- id: prdetails
uses: matrix-org/pr-details-action@v1.3
continue-on-error: true
with:
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
branch: ${{ github.event.workflow_run.head_branch }}
2024-04-13 04:34:08 +08:00
debug:
needs: prdetails
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ needs.prdetails.outputs.pr_number }}
2024-04-13 04:39:22 +08:00
PR_HEAD_REF: ${{ fromJSON(needs.prdetails.outputs.data).head.ref) }}
PR_HEAD_SHA: ${{ fromJSON(needs.prdetails.outputs.data).head.sha) }}
2024-04-13 04:34:08 +08:00
steps:
- run: echo "$PR_NUMBER $PR_HEAD_REF $PR_HEAD_SHA"