diff --git a/.github/workflows/comment_on_push.yml b/.github/workflows/comment_on_push.yml deleted file mode 100644 index 6105fc5..0000000 --- a/.github/workflows/comment_on_push.yml +++ /dev/null @@ -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. diff --git a/.github/workflows/comment_on_workflow_run.yml b/.github/workflows/comment_on_workflow_run.yml new file mode 100644 index 0000000..e0a2b29 --- /dev/null +++ b/.github/workflows/comment_on_workflow_run.yml @@ -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 }} + ``` diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd79d73..45f7bab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,4 +11,12 @@ jobs: steps: - uses: actions/checkout@v2 - 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/