Skip to content
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

Add a PR comment when a preview environment is created #3198

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Conversation

balanza
Copy link
Member

@balanza balanza commented Dec 10, 2024

Description

To help us notice when the preview environment is created, a comment is added to the PR with the URL of the created environment.

Key feature:

  • the message is added only when the environment has been deployed and seeded
  • the message is not duplicated on multiple deploys
  • the message is deleted on pr close

@balanza balanza added the env Create an ephimeral environment for the pr branch label Dec 10, 2024
@balanza balanza marked this pull request as draft December 10, 2024 18:54
@balanza balanza force-pushed the action-comment branch 2 times, most recently from 808cfc6 to 87d2438 Compare December 11, 2024 13:53
Copy link

The preview environment for this pull request is ready at 3198.prenv.trento.suse.com.

@balanza balanza force-pushed the action-comment branch 6 times, most recently from ca2e304 to 40ec429 Compare December 11, 2024 15:02
@balanza balanza marked this pull request as ready for review December 11, 2024 15:16
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

Brilliant @balanza! Thanks a lot!

@@ -20,6 +20,21 @@ jobs:
- id: check
run: echo "create_env=${{ contains(github.event.pull_request.labels.*.name, env.PR_ENV_LABEL) }}" >> "$GITHUB_OUTPUT"

comment-pr:
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: ‏we might emphasize in step name and description we're cleaning up the pr from a comment.

@balanza balanza enabled auto-merge (squash) December 11, 2024 16:32
@balanza balanza merged commit 501f79d into main Dec 11, 2024
28 checks passed
@balanza balanza deleted the action-comment branch December 11, 2024 16:42
@balanza balanza mentioned this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env Create an ephimeral environment for the pr branch
Development

Successfully merging this pull request may close these issues.

2 participants