Update README.md #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PullRequestGradleTest | |
| on: | |
| pull_request_target: | |
| branches: | |
| - master | |
| jobs: | |
| test: | |
| name: GradleTest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{github.event.pull_request.head.repo.full_name }} | |
| - name: Setup JDK 1.8 | |
| uses: actions/setup-java@v2 | |
| with: | |
| java-version: '8' | |
| distribution: 'adopt' | |
| - name: Grant Permissions to gradlew | |
| run: chmod +x gradlew | |
| - name: Test | |
| run: ./gradlew test | |
| - name: Test Success | |
| if: success() | |
| uses: actions/github-script@0.2.0 | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| const pull_number = "${{github.event.number}}" | |
| await github.pulls.createReview({ | |
| ...context.repo, | |
| pull_number, | |
| body: "테스트 모두 통과!", | |
| event: "APPROVE" | |
| }) | |
| - name: Test Fail | |
| if: failure() | |
| uses: actions/github-script@0.2.0 | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| const pull_number = "${{github.event.number}}" | |
| await github.pulls.createReview({ | |
| ...context.repo, | |
| pull_number, | |
| body: "테스트 코드 실패.. 다시 작성해 주세요.", | |
| event: "REQUEST_CHANGES" | |
| }) | |
| await github.pulls.update({ | |
| ...context.repo, | |
| pull_number, | |
| state: "closed" | |
| }) |