-
Notifications
You must be signed in to change notification settings - Fork 724
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
Create manually triggered Github Action for running CI on behalf of forks #6399
base: main
Are you sure you want to change the base?
Conversation
|
- name: Check user for team affiliation | ||
uses: tspascoal/get-user-teams-membership@v2 | ||
id: teamAffiliation | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} |
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.
Is it safe to pass this token to a third-party action?
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.
This is a good point. The source code is "obfuscated" in some sense because dist
is built and committed to the repo, so there is a security issue there.
We might look instead at copy/pasting the source into our own source code and calling it directly.
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.
We could also create a read:org only token https://github.com/tspascoal/get-user-teams-membership/blob/master/README.md?plain=1#L23
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.
But forking that repo into our org might be the safest option
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-wrangler-6399 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6399/npm-package-wrangler-6399 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-wrangler-6399 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-create-cloudflare-6399 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-cloudflare-kv-asset-handler-6399 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-miniflare-6399 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-cloudflare-pages-shared-6399 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-cloudflare-vitest-pool-workers-6399 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-cloudflare-workers-editor-shared-6399 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-cloudflare-workers-shared-6399 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11939308871/npm-package-cloudflare-workflows-shared-6399 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
username: ${{ github.actor }} | ||
team: wrangler | ||
- name: Stop workflow if user is no member |
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.
- name: Stop workflow if user is no member | |
- name: Stop workflow if user is not a "wrangler" team member |
?
run: gh pr checkout ${{ inputs.pr-number }} | ||
|
||
- name: "Create Draft PR" | ||
run: git checkout -b run-ci-on-hehalf-of-${{ 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.
Should we run a branch -D
on this branch first? Unlikely conflict, but possible.
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.
Yeah I was considering this needs to be repeatable. I was thinking a force push or something once I confirmed this all worked but branch -D
would also work – do we need to delete the remote branch too? and close the existing PR?
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.
If that's possible then it seems like a good idea, to avoid needing any potential manual cleanup.
One more thing we might consider is to update this section of |
bb43eb0
to
122e8be
Compare
122e8be
to
f00298a
Compare
This PR introduces a GIthub Action which can be triggered manually to clone a fork to a new branch and open a draft PR with the "e2e" label which will (hopefully) run the e2e jobs.
Inputs:
type: string
(the PR to clone from)type: boolean
(to confirm the user has reviewed the PR for usage/leakage of secrets)Also:
wrangler
team