-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 1.06 KB
/
example.yml
File metadata and controls
42 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Example Usage
on:
pull_request:
paths:
- 'package-lock.json'
permissions:
contents: read
pull-requests: write
jobs:
npm-diff:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate npm lockfile diff
id: npm_diff
uses: ./
with:
base-ref: ${{ github.event.pull_request.base.ref || 'main' }}
- name: Comment PR with diff
if: steps.npm_diff.outputs.has_changes == 'true'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: npm-diff
message: |
## 📦 NPM Dependency Changes
**Summary:** ${{ steps.npm_diff.outputs.added_count }} added, ${{ steps.npm_diff.outputs.removed_count }} removed, ${{ steps.npm_diff.outputs.updated_count }} upgraded
<details open>
<summary>View details</summary>
${{ steps.npm_diff.outputs.diff }}
</details>