-
-
Notifications
You must be signed in to change notification settings - Fork 17
Fix preview deployment workflow for variable expansion and fork PRs #987
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
Fix preview deployment workflow for variable expansion and fork PRs #987
Conversation
Co-authored-by: commjoen <[email protected]>
|
@copilot can you fix the following error? |
Co-authored-by: commjoen <[email protected]>
Fixed in commit ca6b0ba. The issue was that |
|
@copilot can you fix the following issue when extenral contributors file a PR? 1 warning found (use docker --debug to expand):
|
Co-authored-by: commjoen <[email protected]>
Fixed in commit 50883c7. The issue occurs because external contributors from forks don't have write permissions to the organization's container registry. The workflow now:
This prevents the "denied: installation not allowed to Write organization package" error while still validating that fork PR changes build successfully. |
🚀 Preview Deployment Ready!Your pull request has been built and is ready for preview deployment. Container Images Built
Quick Deploy with Helm# Add the wrongsecrets helm repository
helm repo add wrongsecrets https://owasp.org/wrongsecrets-ctf-party
helm repo update
# Deploy with preview images
helm install my-preview wrongsecrets/wrongsecrets-ctf-party \
--set balancer.repository=ghcr.io/OWASP/wrongsecrets-balancer \
--set balancer.tag=pr-987 \
--set wrongsecretsCleanup.repository=ghcr.io/OWASP/cleaner \
--set wrongsecretsCleanup.tag=pr-987 \
--set imagePullPolicy=Always
# Port forward to access locally
kubectl port-forward service/wrongsecrets-balancer 3000:3000Deploy with Custom ValuesClick to see preview-values.yamlbalancer:
repository: ghcr.io/OWASP/wrongsecrets-balancer
tag: pr-987
wrongsecretsCleanup:
repository: ghcr.io/OWASP/cleaner
tag: pr-987
# Preview configuration
ingress:
enabled: true
hosts:
- host: >-
preview-pr-987.wrongsecrets.local
paths:
- "/"# Save the above values to preview-values.yaml, then:
helm install my-preview wrongsecrets/wrongsecrets-ctf-party \
-f preview-values.yamlDeploy with Local Build Scripts# Clone this PR
git fetch origin pull/987/head:pr-987
git checkout pr-987
# Use the existing deployment script with custom images
./build-and-deploy.shTest the Changes
Container RegistryThe preview images are available at:
This preview was automatically generated for PR #987 |
Preview Deployment Fixes
Summary
Fixed three issues in the preview deployment workflow:
Issue 1: Variable expansion in PR comments
Issue 2: Empty comment body error
$GITHUB_OUTPUTwas escaped as\$GITHUB_OUTPUT, creating a literal file instead of using the environment variable$GITHUB_OUTPUTto the actual output file pathIssue 3: External contributors can't push to organization's container registry
ghcr.io/owasp/*github.event.pull_request.head.repo.full_name != github.repositorypush: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}The workflow now correctly:
External contributors can now submit PRs without permission errors, while maintainers still get pre-built preview images for internal PRs.
Fixes #986
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.