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

Trigger deploy of whatwg.org on changes #131

Merged
merged 4 commits into from
Jun 17, 2020
Merged

Trigger deploy of whatwg.org on changes #131

merged 4 commits into from
Jun 17, 2020

Conversation

foolip
Copy link
Member

@foolip foolip commented Jun 17, 2020

Fixes #110.

@foolip
Copy link
Member Author

foolip commented Jun 17, 2020

@foolip foolip requested a review from annevk June 17, 2020 15:02
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

So the risks here are that if peter-evans/repository-dispatch@v1 goes rogue the DISPATCH_TOKEN is compromised but that cannot really be used for much anyway?

name: Dispatch
runs-on: ubuntu-20.04
steps:
- uses: peter-evans/repository-dispatch@v1
Copy link
Member

Choose a reason for hiding this comment

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

I guess Dependabot monitors these too?

Copy link
Member Author

Choose a reason for hiding this comment

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

One can configure Dependabot to bump GitHub Actions, yes. I haven't tried it, though.

@foolip
Copy link
Member Author

foolip commented Jun 17, 2020

So the risks here are that if peter-evans/repository-dispatch@v1 goes rogue the DISPATCH_TOKEN is compromised but that cannot really be used for much anyway?

An attacker would get write access to the whatwg/whatwg.org repo. From there they should be able to extract the deploy keys to marquee and SSH into it, at which point we'd be pretty thoroughly compromised.

That's a fair bit of trust to place in a nice-to-have wrapper. We could pin it to an exact commit, but reviewing changes to https://github.com/peter-evans/repository-dispatch/blob/v1/dist/index.js isn't going to be easy.

I'll try to craft the curl command line for this instead.

@foolip
Copy link
Member Author

foolip commented Jun 17, 2020

OK, after some flailing about I got it to work, https://github.com/whatwg/sg/runs/781040423 triggered https://github.com/whatwg/whatwg.org/actions/runs/138597128. @annevk r?

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Nice! Still pretty heavy for a fetch, but I guess that's what computing is these days. 😊

@foolip
Copy link
Member Author

foolip commented Jun 17, 2020

FWIW, Azure Pipelines has something lighter-weight where no agent at all is required:
https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#server-jobs

But GitHub Actions does not, AFAICT.

@foolip foolip merged commit 0edf1ef into master Jun 17, 2020
@foolip foolip deleted the dispatch-to-deploy branch June 17, 2020 16:45
@foolip
Copy link
Member Author

foolip commented Jun 17, 2020

Alright, this all seems to work: https://github.com/whatwg/whatwg.org/runs/781299300

@foolip
Copy link
Member Author

foolip commented Jun 17, 2020

I did accidentally rebase all the junk commits onto master, though. Disabled branch protection and force pushed to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Deploy changes to policy files to whatwg.org
2 participants