use the_crawl-based package reviewer #128
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: Package test | |
| on: | |
| pull_request: | |
| issue_comment: | |
| types: [created] # run when comment added with "📦" | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| jobs: | |
| package: | |
| if: ${{ github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && github.event.issue.pull_request != null && contains(github.event.comment.body, '📦')) }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ format('refs/pull/{0}/merge', github.event.pull_request.number || github.event.issue.number) }} | |
| - id: get_pr | |
| if: ${{ github.event_name == 'issue_comment' }} | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.payload.issue.number | |
| }); | |
| core.setOutput('base_sha', pr.data.base.sha); | |
| core.setOutput('head_sha', pr.data.head.sha); | |
| # latest version on simplify branch see #5 | |
| # https://github.com/packagecontrol/st-package-reviewer-action/pull/5 | |
| - uses: packagecontrol/st-package-reviewer-action@de58167cfca93775fcbf5061cce6e452b51ce7b6 | |
| with: | |
| base-sha: ${{ github.event.pull_request.base.sha || steps.get_pr.outputs.base_sha }} | |
| current-sha: ${{ github.event.pull_request.head.sha || steps.get_pr.outputs.head_sha }} | |
| crawl_package: | |
| if: ${{ github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && github.event.issue.pull_request != null && contains(github.event.comment.body, '📦')) }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Diff and review changed/added packages | |
| uses: kaste/st_package_reviewer/gh_action@a459dc54df6b50c8073b3a3c2a3d5d41a85b1146 | |
| with: | |
| pr: ${{ github.event.pull_request.html_url }} | |
| file: repository.json | |