Fix workflow preview environment repository dispatch (#11739)

This is hard to test without merging PRs unfortunately

Goal of this PR is to replace the action I had introduced since there
was already a similar one in the codebase
This commit is contained in:
Félix Malfait
2025-04-25 15:52:12 +02:00
committed by GitHub
parent 3fc498dba7
commit 535a8d4410
2 changed files with 9 additions and 17 deletions

View File

@ -1,17 +1,8 @@
name: 'Preview Environment Keep Alive'
on:
workflow_dispatch:
inputs:
pr_number:
description: 'PR number'
required: true
pr_head_sha:
description: 'PR head SHA'
required: true
repo_full_name:
description: 'Repository full name (owner/repo)'
required: true
repository_dispatch:
types: [preview-environment]
jobs:
preview-environment:
@ -21,7 +12,7 @@ jobs:
- name: Checkout PR
uses: actions/checkout@v4
with:
ref: ${{ inputs.pr_head_sha }}
ref: ${{ github.event.client_payload.pr_head_sha }}
- name: Run compose setup
run: |
@ -111,7 +102,7 @@ jobs:
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ inputs.pr_number }},
issue_number: ${{ github.event.client_payload.pr_number }},
});
// Find our comment
@ -131,7 +122,7 @@ jobs:
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ inputs.pr_number }},
issue_number: ${{ github.event.client_payload.pr_number }},
body: commentBody
});
console.log('Created new comment');