ci: test workflow_run

This commit is contained in:
marocchino 2021-03-22 10:24:22 +09:00
parent 56ac27318d
commit 58da41abb9
No known key found for this signature in database
GPG key ID: AFF521DBDB122570
3 changed files with 37 additions and 18 deletions

View file

@ -1,17 +0,0 @@
name: Comment on Push
on:
push:
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jwalton/gh-find-current-pr@v1
id: finder
- uses: ./
with:
number: ${{ steps.finder.outputs.pr }}
message: |
Test ${{ github.sha }} is successfully ended.
This is message from push.

View file

@ -0,0 +1,28 @@
name: Comment on PR
on:
workflow_run:
workflows:
- "Test"
types:
- completed
jobs:
exam:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- uses: actions/checkout@v2
- name: on artifact
id: artifact
uses: marocchino/on_artifact@v1
with:
name: all
- uses: ./
with:
header: All
number: ${{ steps.artifact.outputs.number }}
message: |
```
${{ steps.artifact.outputs.all_result }}
```

View file

@ -11,4 +11,12 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: npm ci - run: npm ci
- run: npm run all - run: |
mkdir -p ./pr
echo ${{ github.event.number }} | tee ./pr/number
npm run all | tee ./pr/all_result
- uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'pull_request' }}
with:
name: all
path: pr/