-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add optional preprod preview URL to PR comments #73
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,11 @@ on: | |||||||||||||||||
| description: If provided, downloads a previously uploaded artifact (has to be in the same workflow). Both artifactPath and artifactName have to be passed. | ||||||||||||||||||
| default: "" | ||||||||||||||||||
| type: string | ||||||||||||||||||
| PREPROD_PREVIEW_ENABLED: | ||||||||||||||||||
| description: Whether to include preprod preview URL in comment (for apps with preprod preview environments) | ||||||||||||||||||
| required: false | ||||||||||||||||||
| type: boolean | ||||||||||||||||||
| default: false | ||||||||||||||||||
| secrets: | ||||||||||||||||||
| AWS_ROLE_TO_ASSUME: | ||||||||||||||||||
| required: true | ||||||||||||||||||
|
|
@@ -87,9 +92,22 @@ jobs: | |||||||||||||||||
| if: ${{ inputs.GHA_TRIGGER_EVENT != 'synchronize' }} | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Build comment message | ||||||||||||||||||
| id: build-message | ||||||||||||||||||
| run: | | ||||||||||||||||||
| MESSAGE="Preview URL: https://${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev" | ||||||||||||||||||
| if [ "${{ inputs.PREPROD_PREVIEW_ENABLED }}" == "true" ]; then | ||||||||||||||||||
|
||||||||||||||||||
| MESSAGE="${MESSAGE} | ||||||||||||||||||
| Preview URL (preprod): https://${{ inputs.APPLICATION_NAME }}-preprod-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev" | ||||||||||||||||||
| fi | ||||||||||||||||||
| MESSAGE="${MESSAGE} | ||||||||||||||||||
| Preview Argo App: https://argocd.staging.parcellab.dev/applications/argocd/${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}" | ||||||||||||||||||
|
Comment on lines
+100
to
+104
|
||||||||||||||||||
| MESSAGE="${MESSAGE} | |
| Preview URL (preprod): https://${{ inputs.APPLICATION_NAME }}-preprod-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev" | |
| fi | |
| MESSAGE="${MESSAGE} | |
| Preview Argo App: https://argocd.staging.parcellab.dev/applications/argocd/${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}" | |
| MESSAGE="${MESSAGE}"$'\n'"Preview URL (preprod): https://${{ inputs.APPLICATION_NAME }}-preprod-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev" | |
| fi | |
| MESSAGE="${MESSAGE}"$'\n'"Preview Argo App: https://argocd.staging.parcellab.dev/applications/argocd/${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment-pr job is missing required permissions to comment on pull requests. The thollander/actions-comment-pull-request action requires pull-requests: write permission. Add a permissions block to this job similar to what exists in other workflows (e.g., pr.yaml:21-23).