-
Notifications
You must be signed in to change notification settings - Fork 48
feat/github workflow to upload images to S3 bucket #290
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: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying frameworks with
|
| Latest commit: |
f80b14c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://aa8398b3.frameworks-573.pages.dev |
| Branch Preview URL: | https://feat-s3-upload-workflow.frameworks-573.pages.dev |
|
Note: |
|
@mattaereal this is ready for review as the problem with Vercel is solved (it was failing as the new version of vocs we are using needed a higher version of node). Anyway, to make the workflow work we still need to add proper credentials just for this workflow (will ask @davidthegardens to help with this) |
|
Update on this: |
|
I'm reading the code and pair-auditing it with AI. My prompt was: In general terms, leaving aside AI output, I think these three are a way forward:
The following could be bypassed by using something like
The s3 client initialization only has AWS_REGION, which we won't mind if it gets leaked. Then the configuration can be something like this:
Next stepsSince I don't have access to AWS, I asked Codex to explain to me how it would implement OIDC in this context Prereqs: you already have AWS_REGION and AWS_S3_BUCKET secrets set. Keep them. You will add AWS_ROLE_ARN after creating the role. Create (or reuse) the GitHub OIDC IdP in AWS IAM:
Create a least-privilege IAM role for web identity (trusting that IdP):
(PutObjectAcl is needed because the script sets CacheControl/ContentType; if you don’t need ACLs, you can omit it.)
Save the role ARN:
After this, the workflow’s configure-aws-credentials step will assume the role using OIDC, and the Node script will pick up temporary creds automatically. Trigger a test PR comment (/img-bot ) to verify. |
Frameworks PR Checklist
This is the setup to make the github bot upload the assets to our s3 automatically. This is how it works:
Safety checks:
This is an example of URL of an image hosted by github (taken from a comment in a PR - by the time you are reading this it could be expired) and then the URL of that image uploaded on the bucket:
Original URL: https://private-user-images.githubusercontent.com/239174473/510805085-b4c3c3bd-2532-4f9c-857e-8fcfeb79eb56.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjI0NTM2NzEsIm5iZiI6MTc2MjQ1MzM3MSwicGF0aCI6Ii8yMzkxNzQ0NzMvNTEwODA1MDg1LWI0YzNjM2JkLTI1MzItNGY5Yy04NTdlLThmY2ZlYjc5ZWI1Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMTA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTEwNlQxODIyNTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wMTU4YmZmMmY0MjNlOTRiNzhjODZiZjUzNWVmNTEwOWY2ZWJmZjBlYWM5ODBmMDlhZmVjNTczYjQ1OWVlMTM3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.46Qmnjic4xfZgmivXmtQ_JZBw4beM1xt5s7ylAv_FlE
S3 URL: https://{name-bucket}.s3.eu-north-1.amazonaws.com/images/2025-11-06T18-23-31-311Z_44f1ba91_076c7b87_510805085-b4c3c3bd-2532-4f9c-857e-8fcfeb79eb56.png
Describe your changes, substitute this text with the information
If you are touching an existing piece of content, tag current contributors from the attribution list
If there is a steward for that framework, ask the steward to review it
If you're modifying the general outline, make sure to update it in the
vocs.config.tsadding thedev: trueparameterIf you need feedback for your content from the wider community, share the PR in our Discord
Review changes to ensure there are no typos, see instructions below