diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index 1de589f..4c2508e 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -7,9 +7,9 @@ on: jobs: missing-final-newline: runs-on: ubuntu-latest - outputs: - missing: ${{ steps.missing-final-newline.outputs.missing }} - missing-files: ${{ steps.missing-final-newline.outputs.missing-files }} + permissions: + contents: read + pull-requests: write steps: - uses: hakadoriya/github-actions-missing-final-newline@develop id: missing-final-newline @@ -19,14 +19,22 @@ jobs: paths: |- ^action.yml ^missing-final-newline.md - # > Note: A job that is skipped will report its status as "Success". - # > It will not prevent a pull request from merging, even if it is a required check. - # ref. https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution#overview - missing: - runs-on: ubuntu-latest - needs: missing-final-newline - if: ${{ needs.missing-final-newline.outputs.missing == 'true' }} - steps: - - name: "missing final newline detected" + - name: Submit PR comment if missing final newline + if: ${{ steps.missing-final-newline.outputs.missing == 'true' }} + env: + GH_TOKEN: ${{ github.token }} run: | - echo "needs.missing-final-newline.outputs.missing-files: ${{ needs.missing-final-newline.outputs.missing-files }}" + # Create comment body + cat < Note: A job that is skipped will report its status as "Success". - # > It will not prevent a pull request from merging, even if it is a required check. - # ref. https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution#overview - missing: - runs-on: ubuntu-latest - needs: missing-final-newline - if: ${{ needs.missing-final-newline.outputs.missing == 'true' }} - steps: - - name: "missing final newline detected" + - name: Submit PR comment if missing final newline + if: ${{ steps.missing-final-newline.outputs.missing == 'true' }} + env: + GH_TOKEN: ${{ github.token }} run: | - echo "needs.missing-final-newline.outputs.missing-files: ${{ needs.missing-final-newline.outputs.missing-files }}" + # Create comment body + cat <