huntr-cli 1.0.9

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.
Files changed (117) hide show
  1. package/.env.example +7 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +43 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +29 -0
  5. package/.github/labels.json +92 -0
  6. package/.github/pull_request_template.md +64 -0
  7. package/.github/workflows/ci.yml +87 -0
  8. package/.github/workflows/labels.yml +27 -0
  9. package/.github/workflows/manual-publish.yml +105 -0
  10. package/.github/workflows/publish.yml +57 -0
  11. package/.github/workflows/release.yml +124 -0
  12. package/.github/workflows/security-audit.yml +44 -0
  13. package/.husky/pre-commit +12 -0
  14. package/.husky/pre-push +27 -0
  15. package/.lintstagedrc.json +3 -0
  16. package/AGENTS.md +449 -0
  17. package/CHANGELOG.md +38 -0
  18. package/CHANGES.md +259 -0
  19. package/LICENSE +15 -0
  20. package/PUBLISHING.md +191 -0
  21. package/README.md +385 -0
  22. package/ROADMAP.md +158 -0
  23. package/SETUP-COMPLETE.md +446 -0
  24. package/WORKFLOW-SUMMARY.md +368 -0
  25. package/completions/_huntr +168 -0
  26. package/completions/huntr.1 +266 -0
  27. package/completions/huntr.bash +91 -0
  28. package/dist/api/client.d.ts +14 -0
  29. package/dist/api/client.d.ts.map +1 -0
  30. package/dist/api/client.js +74 -0
  31. package/dist/api/client.js.map +1 -0
  32. package/dist/api/personal/activities.d.ts +20 -0
  33. package/dist/api/personal/activities.d.ts.map +1 -0
  34. package/dist/api/personal/activities.js +50 -0
  35. package/dist/api/personal/activities.js.map +1 -0
  36. package/dist/api/personal/boards.d.ts +9 -0
  37. package/dist/api/personal/boards.d.ts.map +1 -0
  38. package/dist/api/personal/boards.js +16 -0
  39. package/dist/api/personal/boards.js.map +1 -0
  40. package/dist/api/personal/index.d.ts +17 -0
  41. package/dist/api/personal/index.d.ts.map +1 -0
  42. package/dist/api/personal/index.js +37 -0
  43. package/dist/api/personal/index.js.map +1 -0
  44. package/dist/api/personal/jobs.d.ts +13 -0
  45. package/dist/api/personal/jobs.d.ts.map +1 -0
  46. package/dist/api/personal/jobs.js +31 -0
  47. package/dist/api/personal/jobs.js.map +1 -0
  48. package/dist/api/personal/user.d.ts +8 -0
  49. package/dist/api/personal/user.d.ts.map +1 -0
  50. package/dist/api/personal/user.js +13 -0
  51. package/dist/api/personal/user.js.map +1 -0
  52. package/dist/cli.d.ts +3 -0
  53. package/dist/cli.d.ts.map +1 -0
  54. package/dist/cli.js +501 -0
  55. package/dist/cli.js.map +1 -0
  56. package/dist/commands/capture-session.d.ts +10 -0
  57. package/dist/commands/capture-session.d.ts.map +1 -0
  58. package/dist/commands/capture-session.js +478 -0
  59. package/dist/commands/capture-session.js.map +1 -0
  60. package/dist/config/clerk-session-manager.d.ts +44 -0
  61. package/dist/config/clerk-session-manager.d.ts.map +1 -0
  62. package/dist/config/clerk-session-manager.js +232 -0
  63. package/dist/config/clerk-session-manager.js.map +1 -0
  64. package/dist/config/config-manager.d.ts +15 -0
  65. package/dist/config/config-manager.d.ts.map +1 -0
  66. package/dist/config/config-manager.js +51 -0
  67. package/dist/config/config-manager.js.map +1 -0
  68. package/dist/config/keychain-manager.d.ts +6 -0
  69. package/dist/config/keychain-manager.d.ts.map +1 -0
  70. package/dist/config/keychain-manager.js +37 -0
  71. package/dist/config/keychain-manager.js.map +1 -0
  72. package/dist/config/token-capture.d.ts +11 -0
  73. package/dist/config/token-capture.d.ts.map +1 -0
  74. package/dist/config/token-capture.js +252 -0
  75. package/dist/config/token-capture.js.map +1 -0
  76. package/dist/config/token-manager.d.ts +38 -0
  77. package/dist/config/token-manager.d.ts.map +1 -0
  78. package/dist/config/token-manager.js +153 -0
  79. package/dist/config/token-manager.js.map +1 -0
  80. package/dist/lib/list-options.d.ts +69 -0
  81. package/dist/lib/list-options.d.ts.map +1 -0
  82. package/dist/lib/list-options.js +299 -0
  83. package/dist/lib/list-options.js.map +1 -0
  84. package/dist/types/personal.d.ts +113 -0
  85. package/dist/types/personal.d.ts.map +1 -0
  86. package/dist/types/personal.js +4 -0
  87. package/dist/types/personal.js.map +1 -0
  88. package/docs/AUTOMATIC-PUBLISHING.md +520 -0
  89. package/docs/CHANGELOG-AUTOMATION.md +418 -0
  90. package/docs/CI-CD-SETUP.md +582 -0
  91. package/docs/DEV-SETUP.md +512 -0
  92. package/docs/ENHANCEMENT-PLAN.md +204 -0
  93. package/docs/ENTITY-TYPES.md +462 -0
  94. package/docs/GITHUB-ACTIONS-GUIDE.md +367 -0
  95. package/docs/NPM-PUBLISHING.md +324 -0
  96. package/docs/OUTPUT-EXAMPLES.md +414 -0
  97. package/docs/OUTPUT-FORMATS.md +299 -0
  98. package/docs/TESTING.md +216 -0
  99. package/eslint.config.js +68 -0
  100. package/package.json +64 -0
  101. package/src/api/client.ts +88 -0
  102. package/src/api/personal/activities.ts +66 -0
  103. package/src/api/personal/boards.ts +14 -0
  104. package/src/api/personal/index.ts +25 -0
  105. package/src/api/personal/jobs.ts +33 -0
  106. package/src/api/personal/user.ts +10 -0
  107. package/src/cli.ts +487 -0
  108. package/src/commands/capture-session.ts +582 -0
  109. package/src/config/clerk-session-manager.ts +263 -0
  110. package/src/config/config-manager.ts +56 -0
  111. package/src/config/keychain-manager.ts +30 -0
  112. package/src/config/token-capture.ts +233 -0
  113. package/src/config/token-manager.ts +139 -0
  114. package/src/lib/list-options.ts +370 -0
  115. package/src/types/personal.ts +114 -0
  116. package/tests/example.test.ts +130 -0
  117. package/tsconfig.json +19 -0
package/.env.example ADDED
@@ -0,0 +1,7 @@
1
+ # Huntr CLI Environment Variables
2
+ # Copy this to .env and fill in your values
3
+ # NOTE: .env is in .gitignore and will NOT be committed to version control
4
+
5
+ # Your Huntr API token (obtained from DevTools console: await window.Clerk.session.getToken())
6
+ # This is used for cross-platform authentication (macOS, Linux, Windows)
7
+ HUNTR_API_TOKEN=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug or issue with huntr-cli
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Description
11
+ A clear and concise description of what the bug is.
12
+
13
+ ## Environment
14
+ - **OS:** macOS / Linux / Windows
15
+ - **Node version:** (run `node --version`)
16
+ - **CLI version:** (run `huntr --version`)
17
+ - **Installation method:** npm global / local / npx
18
+
19
+ ## Steps to Reproduce
20
+ Steps to reproduce the behavior:
21
+ 1. Run `huntr ...`
22
+ 2. Expected behavior...
23
+ 3. Actual behavior...
24
+
25
+ ## Expected Behavior
26
+ What should happen?
27
+
28
+ ## Actual Behavior
29
+ What actually happens?
30
+
31
+ ## Error Message
32
+ ```
33
+ Paste any error messages or stack traces here
34
+ ```
35
+
36
+ ## Screenshots / Terminal Output
37
+ If applicable, add screenshots or terminal output.
38
+
39
+ ## Additional Context
40
+ Add any other context about the problem here.
41
+
42
+ ## Workaround (if any)
43
+ If you found a workaround, describe it here.
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Huntr Community
4
+ url: https://huntr.co
5
+ about: Visit Huntr's main site
6
+ - name: GitHub Discussions
7
+ url: https://github.com/mattmck/huntr-cli/discussions
8
+ about: Join discussions about huntr-cli
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for huntr-cli
4
+ title: "[FEATURE] "
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Description
11
+ A clear and concise description of the feature request.
12
+
13
+ ## Problem Statement
14
+ Is your feature request related to a problem? Describe it.
15
+
16
+ ## Proposed Solution
17
+ Describe how you'd like the feature to work.
18
+
19
+ ## Example Usage
20
+ How would a user use this feature? Provide an example command or workflow.
21
+
22
+ ## Alternative Solutions
23
+ Are there alternative ways to accomplish this?
24
+
25
+ ## Additional Context
26
+ Add any other context, screenshots, or information.
27
+
28
+ ## Related Issues
29
+ Link any related issues or discussions.
@@ -0,0 +1,92 @@
1
+ [
2
+ {
3
+ "name": "type/bug",
4
+ "color": "d73a49",
5
+ "description": "Something isn't working"
6
+ },
7
+ {
8
+ "name": "type/feature",
9
+ "color": "a2eeef",
10
+ "description": "New feature or enhancement"
11
+ },
12
+ {
13
+ "name": "type/docs",
14
+ "color": "0075ca",
15
+ "description": "Documentation improvements"
16
+ },
17
+ {
18
+ "name": "type/chore",
19
+ "color": "ffc274",
20
+ "description": "Build, dependencies, or tooling"
21
+ },
22
+ {
23
+ "name": "type/refactor",
24
+ "color": "cccccc",
25
+ "description": "Code restructuring without functional change"
26
+ },
27
+ {
28
+ "name": "type/test",
29
+ "color": "5319e7",
30
+ "description": "Test improvements or fixes"
31
+ },
32
+ {
33
+ "name": "type/perf",
34
+ "color": "fbca04",
35
+ "description": "Performance improvements"
36
+ },
37
+ {
38
+ "name": "priority/critical",
39
+ "color": "b60205",
40
+ "description": "Blocking issue, needs immediate attention"
41
+ },
42
+ {
43
+ "name": "priority/high",
44
+ "color": "ff6b6b",
45
+ "description": "High priority, should be addressed soon"
46
+ },
47
+ {
48
+ "name": "priority/low",
49
+ "color": "e4e669",
50
+ "description": "Low priority, nice-to-have"
51
+ },
52
+ {
53
+ "name": "status/in-progress",
54
+ "color": "1f883d",
55
+ "description": "Currently being worked on"
56
+ },
57
+ {
58
+ "name": "status/blocked",
59
+ "color": "b60205",
60
+ "description": "Blocked by another issue or PR"
61
+ },
62
+ {
63
+ "name": "status/needs-review",
64
+ "color": "d4c5f9",
65
+ "description": "Waiting for code review"
66
+ },
67
+ {
68
+ "name": "status/needs-testing",
69
+ "color": "ffc274",
70
+ "description": "Ready for testing"
71
+ },
72
+ {
73
+ "name": "scope/cli",
74
+ "color": "c2e0c6",
75
+ "description": "Core CLI commands and features"
76
+ },
77
+ {
78
+ "name": "scope/auth",
79
+ "color": "c2e0c6",
80
+ "description": "Authentication and token management"
81
+ },
82
+ {
83
+ "name": "scope/output",
84
+ "color": "c2e0c6",
85
+ "description": "Output formatting (PDF, Excel, CSV, JSON, etc.)"
86
+ },
87
+ {
88
+ "name": "scope/infra",
89
+ "color": "c2e0c6",
90
+ "description": "CI/CD, GitHub Actions, build tooling"
91
+ }
92
+ ]
@@ -0,0 +1,64 @@
1
+ ## Description
2
+ <!-- A concise description of the changes in this PR -->
3
+
4
+ Closes # (issue number if applicable)
5
+
6
+ ## Type of Change
7
+ <!-- Mark the relevant option(s) with an "x" -->
8
+
9
+ - [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
10
+ - [ ] ✨ New feature (non-breaking change that adds functionality)
11
+ - [ ] 📚 Documentation (docs-only changes)
12
+ - [ ] 🔄 Refactor (code restructuring without behavior changes)
13
+ - [ ] 🎨 Style (code style, linting, formatting)
14
+ - [ ] ⚡ Performance (performance improvement)
15
+ - [ ] 🔐 Security (security fix)
16
+ - [ ] 🧪 Test (test-related changes)
17
+ - [ ] 🔧 Chore (build, dependencies, CI/CD)
18
+ - [ ] 💥 Breaking change (change that breaks backward compatibility)
19
+
20
+ ## Changes
21
+ <!-- List the specific changes made in this PR -->
22
+
23
+ - Change 1
24
+ - Change 2
25
+ - Change 3
26
+
27
+ ## Testing
28
+ <!-- Describe how you tested these changes -->
29
+
30
+ - [ ] Unit tests added/updated
31
+ - [ ] Manual testing performed
32
+ - [ ] No new testing needed
33
+
34
+ **Test plan:**
35
+ 1. Step 1
36
+ 2. Step 2
37
+ 3. Verify result
38
+
39
+ ## Checklist
40
+ <!-- Ensure all items are checked before submitting -->
41
+
42
+ - [ ] Code follows project style guidelines
43
+ - [ ] Self-review completed
44
+ - [ ] Comments added for complex logic
45
+ - [ ] Documentation updated if needed
46
+ - [ ] No new warnings generated
47
+ - [ ] Commit messages follow conventional commits
48
+ - [ ] Tested locally with `npm run build && npm run lint && npm run typecheck`
49
+ - [ ] No breaking changes (or documented)
50
+
51
+ ## Screenshots / Examples
52
+ <!-- If applicable, add screenshots or examples of the change -->
53
+
54
+ ## Deployment Notes
55
+ <!-- Any notes for deploying this change -->
56
+
57
+ ## Related Issues
58
+ <!-- Link related issues -->
59
+
60
+ Closes #
61
+ Related to #
62
+
63
+ ## Additional Context
64
+ <!-- Add any other context or information here -->
@@ -0,0 +1,87 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Lint
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Setup Node.js
17
+ uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '18'
20
+ cache: 'npm'
21
+
22
+ - name: Install dependencies
23
+ run: npm ci
24
+
25
+ - name: Lint code
26
+ run: npm run lint
27
+
28
+ typecheck:
29
+ name: Typecheck
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+
34
+ - name: Setup Node.js
35
+ uses: actions/setup-node@v4
36
+ with:
37
+ node-version: '18'
38
+ cache: 'npm'
39
+
40
+ - name: Install dependencies
41
+ run: npm ci
42
+
43
+ - name: Typecheck
44
+ run: npm run typecheck
45
+
46
+ build:
47
+ name: Build
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+
52
+ - name: Setup Node.js
53
+ uses: actions/setup-node@v4
54
+ with:
55
+ node-version: '18'
56
+ cache: 'npm'
57
+
58
+ - name: Install dependencies
59
+ run: npm ci
60
+
61
+ - name: Build
62
+ run: npm run build
63
+
64
+ - name: Upload build artifacts
65
+ uses: actions/upload-artifact@v4
66
+ with:
67
+ name: dist
68
+ path: dist/
69
+ retention-days: 1
70
+
71
+ test:
72
+ name: Test
73
+ runs-on: ubuntu-latest
74
+ steps:
75
+ - uses: actions/checkout@v4
76
+
77
+ - name: Setup Node.js
78
+ uses: actions/setup-node@v4
79
+ with:
80
+ node-version: '18'
81
+ cache: 'npm'
82
+
83
+ - name: Install dependencies
84
+ run: npm ci
85
+
86
+ - name: Run tests
87
+ run: npm test
@@ -0,0 +1,27 @@
1
+ name: Sync Labels
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - .github/labels.json
7
+ branches:
8
+ - main
9
+ workflow_dispatch:
10
+ schedule:
11
+ - cron: '0 0 * * 0' # Weekly on Sundays at midnight UTC
12
+
13
+ jobs:
14
+ sync-labels:
15
+ name: Sync GitHub Labels
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: read
19
+ issues: write
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Sync labels
24
+ uses: crazy-max/ghaction-github-labeler@v4
25
+ with:
26
+ github-token: ${{ secrets.GITHUB_TOKEN }}
27
+ yaml-file: .github/labels.json
@@ -0,0 +1,105 @@
1
+ name: Manual Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: 'Version to publish (e.g., 1.1.0)'
8
+ required: true
9
+ type: string
10
+ npm_tag:
11
+ description: 'npm tag (e.g., latest, beta, next)'
12
+ required: false
13
+ default: 'latest'
14
+ type: choice
15
+ options:
16
+ - latest
17
+ - beta
18
+ - next
19
+ - rc
20
+
21
+ jobs:
22
+ publish:
23
+ name: Manual npm Publish
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ with:
28
+ token: ${{ secrets.GITHUB_TOKEN }}
29
+
30
+ - name: Setup Node.js
31
+ uses: actions/setup-node@v4
32
+ with:
33
+ node-version: '18'
34
+ cache: 'npm'
35
+ registry-url: 'https://registry.npmjs.org'
36
+
37
+ - name: Verify version format
38
+ run: |
39
+ if ! [[ "${{ github.event.inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9]+)?$ ]]; then
40
+ echo "❌ Invalid version format: ${{ github.event.inputs.version }}"
41
+ exit 1
42
+ fi
43
+ echo "✓ Valid version format"
44
+
45
+ - name: Install dependencies
46
+ run: npm ci
47
+
48
+ - name: Update package.json version
49
+ run: npm version "${{ github.event.inputs.version }}" --no-git-tag-version
50
+
51
+ - name: Lint
52
+ run: npm run lint
53
+
54
+ - name: Typecheck
55
+ run: npm run typecheck
56
+
57
+ - name: Build
58
+ run: npm run build
59
+
60
+ - name: Publish to npm
61
+ run: npm publish --tag "${{ github.event.inputs.npm_tag }}"
62
+ env:
63
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64
+
65
+ - name: Create git tag
66
+ run: |
67
+ git config user.name "github-actions[bot]"
68
+ git config user.email "github-actions[bot]@users.noreply.github.com"
69
+ git tag -a "v${{ github.event.inputs.version }}" -m "Version ${{ github.event.inputs.version }}"
70
+ git push origin "v${{ github.event.inputs.version }}"
71
+
72
+ - name: Create GitHub Release
73
+ uses: actions/create-release@v1
74
+ env:
75
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76
+ with:
77
+ tag_name: v${{ github.event.inputs.version }}
78
+ release_name: Version ${{ github.event.inputs.version }}
79
+ body: |
80
+ Published to npm: https://www.npmjs.com/package/huntr-cli
81
+ Tag: ${{ github.event.inputs.npm_tag }}
82
+ draft: false
83
+ prerelease: ${{ github.event.inputs.npm_tag != 'latest' }}
84
+
85
+ - name: Slack notification (success)
86
+ if: success()
87
+ uses: slackapi/slack-github-action@v1.24.0
88
+ with:
89
+ payload: |
90
+ {
91
+ "text": "✅ huntr-cli v${{ github.event.inputs.version }} published to npm"
92
+ }
93
+ env:
94
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
95
+
96
+ - name: Slack notification (failure)
97
+ if: failure()
98
+ uses: slackapi/slack-github-action@v1.24.0
99
+ with:
100
+ payload: |
101
+ {
102
+ "text": "❌ huntr-cli v${{ github.event.inputs.version }} publish failed"
103
+ }
104
+ env:
105
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -0,0 +1,57 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ publish:
10
+ name: Publish npm Package
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Setup Node.js
16
+ uses: actions/setup-node@v4
17
+ with:
18
+ node-version: '18'
19
+ cache: 'npm'
20
+ registry-url: 'https://registry.npmjs.org'
21
+
22
+ - name: Install dependencies
23
+ run: npm ci
24
+
25
+ - name: Lint
26
+ run: npm run lint
27
+
28
+ - name: Typecheck
29
+ run: npm run typecheck
30
+
31
+ - name: Build
32
+ run: npm run build
33
+
34
+ - name: Publish to npm
35
+ run: npm publish
36
+ env:
37
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38
+
39
+ - name: Create GitHub release comment
40
+ if: success() && github.event_name == 'release'
41
+ uses: actions/github-script@v7
42
+ with:
43
+ script: |
44
+ github.rest.repos.createRelease({
45
+ owner: context.repo.owner,
46
+ repo: context.repo.repo,
47
+ tag_name: '${{ github.event.release.tag_name }}',
48
+ body: `✅ Published to npm: https://www.npmjs.com/package/huntr-cli@${{ github.event.release.tag_name }}`
49
+ })
50
+
51
+ - name: Notify success
52
+ if: success()
53
+ run: echo "✅ Published huntr-cli@${{ github.event.release.tag_name || 'latest' }} to npm"
54
+
55
+ - name: Notify on failure
56
+ if: failure()
57
+ run: echo "❌ npm publish failed. Check workflow logs at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
@@ -0,0 +1,124 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - 'package.json'
9
+ - 'src/**'
10
+ - '.github/workflows/release.yml'
11
+
12
+ jobs:
13
+ release:
14
+ name: Create Release & Artifacts
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: write
18
+ actions: write
19
+ # The 'paths' filter above ensures this only runs on package.json changes
20
+ # Tag existence check prevents duplicate releases
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ with:
25
+ token: ${{ secrets.GITHUB_TOKEN }}
26
+
27
+ - name: Setup Node.js
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: '18'
31
+ cache: 'npm'
32
+
33
+ - name: Get version from package.json
34
+ id: package
35
+ run: |
36
+ VERSION=$(jq -r '.version' package.json)
37
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
38
+ echo "tag=v$VERSION" >> $GITHUB_OUTPUT
39
+
40
+ - name: Check if tag exists
41
+ id: check_tag
42
+ run: |
43
+ if git rev-parse "refs/tags/${{ steps.package.outputs.tag }}" >/dev/null 2>&1; then
44
+ echo "exists=true" >> $GITHUB_OUTPUT
45
+ else
46
+ echo "exists=false" >> $GITHUB_OUTPUT
47
+ fi
48
+
49
+ - name: Install dependencies
50
+ run: npm ci
51
+
52
+ - name: Lint
53
+ run: npm run lint
54
+
55
+ - name: Typecheck
56
+ run: npm run typecheck
57
+
58
+ - name: Build
59
+ run: npm run build
60
+
61
+ - name: Create distribution archives
62
+ run: |
63
+ mkdir -p dist-archives
64
+ cd dist
65
+ tar -czf ../dist-archives/huntr-cli-${{ steps.package.outputs.version }}.tar.gz .
66
+ zip -r ../dist-archives/huntr-cli-${{ steps.package.outputs.version }}.zip .
67
+ cd ..
68
+
69
+ - name: Generate changelog
70
+ id: changelog
71
+ run: |
72
+ # Get commits since last tag
73
+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
74
+ if [ -z "$LAST_TAG" ]; then
75
+ COMMITS=$(git log --oneline --format="- %s")
76
+ else
77
+ COMMITS=$(git log "$LAST_TAG..HEAD" --oneline --format="- %s")
78
+ fi
79
+
80
+ # Save to file for use in release body
81
+ echo "$COMMITS" > changelog.txt
82
+
83
+ - name: Create GitHub Release
84
+ if: steps.check_tag.outputs.exists == 'false'
85
+ uses: ncipollo/release-action@v1
86
+ with:
87
+ tag: ${{ steps.package.outputs.tag }}
88
+ name: Version ${{ steps.package.outputs.version }}
89
+ bodyFile: changelog.txt
90
+ draft: false
91
+ prerelease: ${{ contains(steps.package.outputs.version, '-') }}
92
+ token: ${{ secrets.GITHUB_TOKEN }}
93
+
94
+ - name: Upload release assets
95
+ if: steps.check_tag.outputs.exists == 'false'
96
+ uses: actions/upload-artifact@v4
97
+ with:
98
+ name: release-artifacts-${{ steps.package.outputs.version }}
99
+ path: dist-archives/
100
+ retention-days: 90
101
+
102
+ - name: Notify release created
103
+ if: steps.check_tag.outputs.exists == 'false'
104
+ run: |
105
+ echo "✅ Release v${{ steps.package.outputs.version }} created!"
106
+ echo " Tag: ${{ steps.package.outputs.tag }}"
107
+ echo " Artifacts uploaded"
108
+ echo " Publishing to npm will start automatically..."
109
+
110
+ - name: Sleep before npm publish
111
+ if: steps.check_tag.outputs.exists == 'false'
112
+ run: sleep 10 # Give GitHub time to create release
113
+
114
+ - name: Trigger publish workflow
115
+ if: steps.check_tag.outputs.exists == 'false'
116
+ uses: actions/github-script@v7
117
+ with:
118
+ script: |
119
+ github.rest.actions.createWorkflowDispatch({
120
+ owner: context.repo.owner,
121
+ repo: context.repo.repo,
122
+ workflow_id: 'publish.yml',
123
+ ref: 'main'
124
+ })
@@ -0,0 +1,44 @@
1
+ name: Security Audit
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ schedule:
7
+ # Run daily at midnight UTC
8
+ - cron: '0 0 * * *'
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ audit:
13
+ name: Audit Dependencies
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Setup Node.js
19
+ uses: actions/setup-node@v4
20
+ with:
21
+ node-version: '18'
22
+ cache: 'npm'
23
+
24
+ - name: Install dependencies
25
+ run: npm ci
26
+
27
+ - name: Run npm audit
28
+ run: npm audit --audit-level=moderate
29
+ continue-on-error: true
30
+
31
+ - name: Report vulnerabilities
32
+ if: failure()
33
+ run: |
34
+ echo "⚠️ Vulnerabilities found. Run 'npm audit' locally for details."
35
+ npm audit --json > audit-report.json || true
36
+ cat audit-report.json
37
+
38
+ - name: Upload audit report
39
+ if: always()
40
+ uses: actions/upload-artifact@v4
41
+ with:
42
+ name: npm-audit-report
43
+ path: audit-report.json
44
+ retention-days: 30