Skip to content

Commit 638fbe4

Browse files
committed
.github/workflows/ucode.yml: add workflow
Upstream-Status: Inappropriate (Dasharo downstream) Change-Id: Ic62b4486c34c89dc1f69af9e2471a5bc3428e137 Signed-off-by: Michał Kopeć <[email protected]>
1 parent de85fb2 commit 638fbe4

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/ucode.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Refresh Intel µcode submodule
2+
3+
on:
4+
schedule:
5+
# At 23:35 on every day-of-week from Sunday through Saturday
6+
# https://crontab.guru/#35_23_*_*_0-6
7+
- cron: '35 23 * * 0-6'
8+
workflow_dispatch:
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v4
17+
18+
- name: Check if µcode submodule is up to date
19+
run: |
20+
git submodule update --init --checkout 3rdparty/intel-microcode
21+
pushd 3rdparty/intel-microcode
22+
current=$(git log -1 --pretty=format:"%H")
23+
git checkout main
24+
new=$(git log -1 --pretty=format:"%H")
25+
popd
26+
if [[ $current == $new ]]; then
27+
echo "Intel µcode submodule is up-to-date."
28+
else
29+
echo "Intel µcode submodule is out of date!"
30+
exit 1
31+
fi
32+
33+
update:
34+
runs-on: ubuntu-latest
35+
needs: check
36+
if: |
37+
always() && needs.check.result == 'failure'
38+
39+
steps:
40+
- name: Checkout Code
41+
uses: actions/checkout@v4
42+
43+
- name: Update µcode submodule
44+
run: |
45+
git submodule update --init --checkout 3rdparty/intel-microcode
46+
pushd 3rdparty/intel-microcode
47+
git checkout main
48+
popd
49+
50+
- name: Set current date
51+
run: |
52+
pushd 3rdparty/intel-microcode
53+
echo "RELEASE_DATE=$(git log -1 --pretty='format:%cs')" >> ${GITHUB_ENV}
54+
popd
55+
56+
- name: Submit pull request
57+
uses: peter-evans/[email protected]
58+
with:
59+
base: dasharo
60+
branch: update_ucode_${{ env.RELEASE_DATE }}
61+
title: Update µcode ${{ env.RELEASE_DATE }}
62+
commit-message: "[automated change] Update µcode ${{ env.RELEASE_DATE }}\n\nUpstream-Status: Inappropriate (Dasharo automation)"

0 commit comments

Comments
 (0)