Skip to content

Commit

Permalink
CI: update PR branch testing instructions on merge (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Jul 12, 2024
1 parent 92d4f03 commit 895ce43
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Request Commenter
name: Node.js Branch Exec

on:
# pull_request_target required for pull-requests:write permission on fork PRs
Expand All @@ -8,6 +8,7 @@ on:
- opened
- reopened
- synchronize # PR's branch was edited (i.e. new commits)
- closed
paths:
- '*'
- 'src/**'
Expand All @@ -19,6 +20,7 @@ concurrency:

jobs:
npm-exec-test:
if: github.event.action != 'closed'
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
Expand All @@ -31,8 +33,11 @@ jobs:
run: npm exec --loglevel verbose --yes -- "github:${{ github.event.pull_request.head.repo.full_name }}#${HEAD_REF}" --help

npm-exec:
if: github.event.action != 'closed'
needs:
- npm-exec-test
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: thollander/actions-comment-pull-request@v2
Expand All @@ -45,3 +50,21 @@ jobs:
```
_Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._
comment_tag: npm-exec

npm-exec-comment-update:
if: github.event.action == 'closed' && github.event.pull_request.merged
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: thollander/actions-comment-pull-request@v2
with:
message: |
## :test_tube: Branch testing instructions
This pull request has been merged, its base branch can be tested locally with the following command:
```shell
npm exec --yes -- "github:${{ github.event.pull_request.base.repo.full_name }}#${{ github.event.pull_request.base.ref }}" [commands..] [options]
```
_Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._
comment_tag: npm-exec
mode: recreate

0 comments on commit 895ce43

Please sign in to comment.