@fanboynz/network-scanner 1.0.46 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,56 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
1
+ name: Publish to NPM
5
2
 
6
3
  on:
7
- release:
8
- types: [created]
4
+ push:
5
+ branches: [ main, master ]
9
6
 
10
7
  jobs:
11
- build:
8
+ check-version:
12
9
  runs-on: ubuntu-latest
10
+ outputs:
11
+ version-changed: ${{ steps.check.outputs.changed }}
12
+ version: ${{ steps.check.outputs.version }}
13
13
  steps:
14
14
  - uses: actions/checkout@v4
15
- - uses: actions/setup-node@v4
16
15
  with:
17
- node-version: 20
18
- - run: npm ci
19
- - run: npm test
16
+ fetch-depth: 0
17
+
18
+ - name: Check if version changed
19
+ id: check
20
+ run: |
21
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
22
+ echo "Current version: $CURRENT_VERSION"
23
+
24
+ git checkout HEAD~1 -- package.json 2>/dev/null || echo "No previous package.json"
25
+ PREVIOUS_VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "0.0.0")
26
+ echo "Previous version: $PREVIOUS_VERSION"
27
+
28
+ git checkout HEAD -- package.json
29
+
30
+ if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
31
+ echo "changed=true" >> $GITHUB_OUTPUT
32
+ echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
33
+ else
34
+ echo "changed=false" >> $GITHUB_OUTPUT
35
+ fi
20
36
 
21
- publish-npm:
22
- needs: build
37
+ publish:
38
+ needs: check-version
39
+ if: needs.check-version.outputs.version-changed == 'true'
23
40
  runs-on: ubuntu-latest
24
41
  steps:
25
42
  - uses: actions/checkout@v4
26
- - uses: actions/setup-node@v4
43
+
44
+ - name: Setup Node.js
45
+ uses: actions/setup-node@v4
27
46
  with:
28
- node-version: 20
29
- registry-url: https://registry.npmjs.org/
30
- - run: npm ci
31
- - run: npm publish
47
+ node-version: '18'
48
+ registry-url: 'https://registry.npmjs.org'
49
+
50
+ - name: Install dependencies
51
+ run: npm ci
52
+
53
+ - name: Publish to NPM
54
+ run: npm publish
32
55
  env:
33
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
56
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanboynz/network-scanner",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "A Puppeteer-based network scanner for analyzing web traffic, generating adblock filter rules, and identifying third-party requests. Features include fingerprint spoofing, Cloudflare bypass, content analysis with curl/grep, and multiple output formats.",
5
5
  "main": "nwss.js",
6
6
  "scripts": {