aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-12-16 13:53:41 +0100
committerGravatar Sebastiaan Zeeff <[email protected]>2020-12-16 13:53:41 +0100
commit75cfaacbde6a57f19ca62629d0525eb29c0d1cce (patch)
tree0593f97f71a183a952c96158a63879d57b7e0502 /.github/workflows
parentAdd enhanced status embed workflow (diff)
Upload artifact with pull request payload
To access information about the PR in the status embed workflow, we need to upload an artifact whenever the forms-backend.yml workflow runs for a `pull_request` trigger. This artifact will be downloaded in the workflow that sends the status embed.
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/forms-backend.yml26
1 files changed, 24 insertions, 2 deletions
diff --git a/.github/workflows/forms-backend.yml b/.github/workflows/forms-backend.yml
index f7d93d2..1d7502b 100644
--- a/.github/workflows/forms-backend.yml
+++ b/.github/workflows/forms-backend.yml
@@ -2,7 +2,7 @@ name: Forms Backend
on:
push:
- branches:
+ branches:
- main
pull_request:
@@ -20,7 +20,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.9'
-
+
- name: Setup Poetry
uses: snok/[email protected]
with:
@@ -45,6 +45,28 @@ jobs:
- name: Run flake8
run: "poetry run flake8 --format='::error file=%(path)s,line=%(row)d,col=%(col)d::[flake8] %(code)s: %(text)s'"
+ # Prepare the Pull Request Payload artifact. If this fails, we
+ # we fail silently using the `continue-on-error` option. It's
+ # nice if this succeeds, but if it fails for any reason, it
+ # does not mean that our lint-test checks failed.
+ - name: Prepare Pull Request Payload artifact
+ id: prepare-artifact
+ if: always() && github.event_name == 'pull_request'
+ continue-on-error: true
+ run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json
+
+ # This only makes sense if the previous step succeeded. To
+ # get the original outcome of the previous step before the
+ # `continue-on-error` conclusion is applied, we use the
+ # `.outcome` value. This step also fails silently.
+ - name: Upload a Build Artifact
+ if: always() && steps.prepare-artifact.outcome == 'success'
+ continue-on-error: true
+ uses: actions/upload-artifact@v2
+ with:
+ name: pull-request-payload
+ path: pull_request_payload.json
+
build:
name: Build & Push
runs-on: ubuntu-latest