Skip to content

Commit e703486

Browse files
committed
warn if latest release and rules are not compatible
1 parent 1fd0d8e commit e703486

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

.github/workflows/tests.yml

+7-15
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master, 'v[0-9]+' ]
5+
branches: [ master ]
66
pull_request:
7-
branches: [ master, 'v[0-9]+' ]
7+
branches: [ master ]
88
# trigger workflow on edited as well (opened and synchronize are default)
99
types: [opened, edited, synchronize]
1010
workflow_dispatch:
@@ -95,35 +95,27 @@ jobs:
9595
done
9696
continue-on-error: true
9797

98-
# On update of version branch, ensure that branch rules are compatible with latest respective release
99-
# assume we only update the branch that corresponds to the latest release
98+
# warn if new rules are not compatible with latest release
10099
rules_latest_release:
101-
# e.g. v4
102-
if: startsWith(github.base_ref, 'v')
103100
runs-on: ubuntu-20.04
101+
continue-on-error: true
104102
steps:
105-
- name: Get latest release executable name and version
106-
run: |
107-
v=$(curl -s https://api.github.com/repos/mandiant/capa/releases/latest | jq .name | tr -d '"')
108-
echo "zip_name=capa-$v-linux.zip" >> $GITHUB_ENV
109-
echo "major_version=$(echo $v | cut -d. -f1)" >> $GITHUB_ENV
110103
- name: Checkout capa-rules
111104
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
112105
with:
113-
ref: ${{ env.major_version }}
114106
path: rules
115107
- name: Checkout capa-testfiles
116108
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
117109
with:
118110
repository: mandiant/capa-testfiles
119111
path: tests/data
120112
- name: Fetch latest capa release executable
121-
uses: robinraju/release-downloader@v1
113+
uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2 # v1.11
122114
with:
123115
repository: "mandiant/capa"
124116
latest: true
125-
fileName: ${{ env.zip_name }}
117+
fileName: "latest.zip"
126118
- name: Unzip
127-
run: unzip ${{ env.zip_name }} -d latest-release
119+
run: unzip latest.zip -d latest-release
128120
- name: Run latest release with current rules
129121
run: latest-release/capa -r rules/ tests/data/9324d1a8ae37a36ae560c37448c9705a.exe_

0 commit comments

Comments
 (0)