chore(OVH): fix incorrect event name - #438
Merged
JoergAtGithub merged 2 commits intoJul 29, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes GitHub Actions event-name mismatches so PR preview deploys and teardown can run when PRs are closed or marked stale, aligning the workflow logic with the pull_request_target trigger used by the pipeline.
Changes:
- Updates deploy URL/target selection logic to key off
pushvs PR-triggered runs. - Fixes cleanup job gating to use
pull_request_targetinstead ofpull_request.
Comments suppressed due to low confidence (2)
.github/workflows/deploy.yml:24
- The cleanup condition will run on any
labeledevent as long as the PR currently has astalelabel. This means adding an unrelated label to an already-stale PR will trigger teardown again, which can cause noisy failures if the target directory has already been removed. To make cleanup run only when thestalelabel is applied (or when the PR is closed), gate the label check on the event’s label name.
github.event_name == 'pull_request_target' && (github.event.action == 'closed' || contains(github.event.pull_request.labels.*.name, 'stale'))
.github/workflows/deploy.yml:18
- This workflow uses
pull_request_target(and the called reusable workflow checks out the repository without specifying a PR ref). That combination typically builds the base branch revision rather than the PR’s head commit, so the preview URL/target can point to a PR environment that doesn’t actually include the PR changes. If the goal is “deploy PR test environments”, you may need to explicitly check outgithub.event.pull_request.head.sha(and add safeguards so secrets aren’t exposed to untrusted forks).
url: ${{ github.event_name == 'push' && 'production' && format('https://{0}', vars.MAIN_WEBSITE) || format('https://{0}/pr/{1}', vars.PREVIEW_WEBSITE, github.event.pull_request.number) }}
target: ${{ github.event_name == 'push' && 'production' && 'www' || format('pulls/pr/{0}', github.event.pull_request.number) }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+14
to
+18
| uses: ./.github/workflows/ovh.yaml | ||
| with: | ||
| environment_name: ${{ github.event_name == 'push' && 'production' || format('pull/{0}', github.event.pull_request.number) }} | ||
| url: ${{ github.event_name == 'pull_request' && format('https://{0}/pr/{1}', vars.PREVIEW_WEBSITE, github.event.pull_request.number) || format('https://{0}', vars.MAIN_WEBSITE) }} | ||
| target: ${{ github.event_name == 'pull_request' && format('pulls/pr/{0}', github.event.pull_request.number) || 'www' }} | ||
| url: ${{ github.event_name == 'push' && 'production' && format('https://{0}', vars.MAIN_WEBSITE) || format('https://{0}/pr/{1}', vars.PREVIEW_WEBSITE, github.event.pull_request.number) }} | ||
| target: ${{ github.event_name == 'push' && 'production' && 'www' || format('pulls/pr/{0}', github.event.pull_request.number) }} |
Member
Author
There was a problem hiding this comment.
Not an issue an line 24
acolombier
force-pushed
the
chore/fix-pr-deployment
branch
from
July 28, 2026 20:46
dfb60fe to
9cf8057
Compare
Member
Author
|
Amended the commit directly! |
JoergAtGithub
approved these changes
Jul 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This currently prevent PR to deploy their test environment and cleanup upon close/stale. This should fix the issue