Skip to content

Commit 336629c

Browse files
committed
feat(ci): Check rule version increment
1 parent c0d730f commit 336629c

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ jobs:
247247
with:
248248
name: "fibratus-amd64.msi"
249249
path: .
250-
- name: Install MSI
250+
- name: Install Fibratus
251251
shell: bash
252252
run: |
253253
./make.bat install

.github/workflows/pr.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,14 @@ jobs:
224224
steps:
225225
- name: Checkout
226226
uses: actions/checkout@v4
227+
with:
228+
fetch-depth: 2
227229
- name: Download MSI
228230
uses: actions/download-artifact@v4
229231
with:
230232
name: "fibratus-amd64.msi"
231233
path: .
232-
- name: Install MSI
234+
- name: Install Fibratus
233235
shell: bash
234236
run: |
235237
./make.bat install
@@ -239,3 +241,25 @@ jobs:
239241
export PATH="/c/Program Files/Fibratus/Bin:$PATH"
240242
fibratus rules list
241243
fibratus rules validate
244+
- name: Get changed rules
245+
id: changed-rules
246+
uses: tj-actions/changed-files@v45
247+
with:
248+
files: |
249+
rules/**.yml
250+
- name: Check version increment
251+
if: steps.changed-rules.outputs.any_changed == 'true'
252+
env:
253+
CHANGED_RULES: ${{ steps.changed-rules.outputs.all_changed_files }}
254+
shell: bash
255+
run: |
256+
choco install yq -y
257+
for rule in ${CHANGED_RULES}; do
258+
RULE="${rule//\\//}"
259+
PREV_VERSION=$(git show HEAD~1:$RULE | yq '.version')
260+
NEXT_VERSION=$(yq '.version' $rule)
261+
if [[ "$PREV_VERSION" == "$NEXT_VERSION" ]]; then
262+
echo "$rule changed but the version is not incremented. Head version: $PREV_VERSION"
263+
exit 1
264+
fi
265+
done

rules/credential_access_lsass_memory_dump_preparation_via_silent_process_exit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ references:
2626

2727
condition: >
2828
modify_registry
29-
and
29+
and
3030
registry.path
3131
imatches
3232
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SilentProcessExit\\lsass*'

0 commit comments

Comments
 (0)