Skip to content

chore(OVH): fix incorrect event name - #438

Merged
JoergAtGithub merged 2 commits into
mixxxdj:websitefrom
acolombier:chore/fix-pr-deployment
Jul 29, 2026
Merged

chore(OVH): fix incorrect event name#438
JoergAtGithub merged 2 commits into
mixxxdj:websitefrom
acolombier:chore/fix-pr-deployment

Conversation

@acolombier

Copy link
Copy Markdown
Member

This currently prevent PR to deploy their test environment and cleanup upon close/stale. This should fix the issue

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 push vs PR-triggered runs.
  • Fixes cleanup job gating to use pull_request_target instead of pull_request.
Comments suppressed due to low confidence (2)

.github/workflows/deploy.yml:24

  • The cleanup condition will run on any labeled event as long as the PR currently has a stale label. 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 the stale label 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 out github.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 thread .github/workflows/deploy.yml Outdated
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) }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an issue an line 24

@acolombier

Copy link
Copy Markdown
Member Author

Amended the commit directly!

@JoergAtGithub
JoergAtGithub merged commit a17e8f1 into mixxxdj:website Jul 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants