Skip to content

fix: checkout correct branch for PR deployment #8721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

matifali
Copy link
Member

@matifali matifali commented Jul 25, 2023

@BrunoQuaresma noticed that deploy-pr.yaml was deploying the latest main instead of the PR branch.

By default actions/checkout fetches the current branch of PR, but only if the vent trigger is a PR. Here event trigger is issue_comment or workflow_dispatch so we need to add a branch name specifically.

uses: actions/checkout@v3
with:
+ ref: branch-name
  fetch-depth: 0

Copy link
Member Author

@matifali matifali left a comment

Choose a reason for hiding this comment

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

refactor

@matifali matifali enabled auto-merge (squash) July 25, 2023 16:06
@matifali matifali merged commit 7447bfa into main Jul 25, 2023
@matifali matifali deleted the matifali/pr-deployment-fix branch July 25, 2023 16:08
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants