Skip to content

Commit 0cb6223

Browse files
committed
.github/workflows/ucode.yml: add workflow
Upstream-Status: Inappropriate (Dasharo downstream) Change-Id: Ic62b4486c34c89dc1f69af9e2471a5bc3428e137 Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
1 parent de85fb2 commit 0cb6223

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/ucode.yml

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

0 commit comments

Comments
 (0)