-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (47 loc) · 1.75 KB
/
ci.yml
File metadata and controls
61 lines (47 loc) · 1.75 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build & Release
on:
push:
branches: [master]
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Typecheck
run: npx tsc --noEmit
- name: Build
run: npm run build
- name: Verify userscript header
run: head -1 dist/sentinel-userscript.user.js | grep -q '// ==UserScript=='
- name: Generate release tag
id: tag
run: |
TAG="build-$(date -u +'%Y.%m.%d-%H%M%S')"
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
echo "DATE=$(date -u +'%B %d, %Y at %H:%M:%S UTC')" >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.TAG }}
name: Build - ${{ steps.tag.outputs.DATE }}
body: |
## Microsoft Sentinel & Defender: Threat Hunting Queries
**Built from** `${{ github.sha }}` on ${{ steps.tag.outputs.DATE }}
### Installation
1. Install [Tampermonkey](https://www.tampermonkey.net/) in your browser
2. Click **sentinel-userscript.user.js** below to auto-install in Tampermonkey
3. Open Tampermonkey dashboard → Utilities → Import from file
4. Select the downloaded `.js` file
Or install directly from the raw URL:
```
https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG }}/sentinel-userscript.user.js
```
files: dist/sentinel-userscript.user.js
generate_release_notes: true