Fix Netflify builds from fork PRs

Some absolutely horrenous hacks to upload the context as an artifact
then download it, unzip it and set the PR number as a variable we can
use, because GitHub Actions just doesn't offer any other way of doing
this.

Maybe we'd be better off going back to Netlify...
This commit is contained in:
David Baker 2021-08-11 19:25:17 +01:00
parent eadc94035d
commit cf8ee19e23
2 changed files with 35 additions and 2 deletions

View file

@ -16,4 +16,16 @@ jobs:
path: element-web/webapp
# We'll only use this in a triggered job, then we're done with it
retention-days: 1
- uses: actions/github-script@v3.1.0
with:
script: |
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/context.json', JSON.stringify(context));
- name: Upload Context
uses: actions/upload-artifact@v2
with:
name: context.json
path: context.json
# We'll only use this in a triggered job, then we're done with it
retention-days: 1