Skip to content

Commit 1ded121

Browse files
committed
chore: update pi image script
1 parent 79702be commit 1ded121

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/update-raspbian-image.yml renamed to .github/workflows/update-rpi-os-image.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check for Raspbian image update
1+
name: Check for Raspberry Pi OS image update
22
on:
33
# Allows you to run this workflow manually from the Actions tab
44
workflow_dispatch:
@@ -14,7 +14,7 @@ permissions:
1414
pull-requests: write
1515

1616
jobs:
17-
update-raspbian-image:
17+
update-rpi-os-image:
1818
if: ${{ github.repository_owner == 'bitfocus' }}
1919

2020
runs-on: ubuntu-latest
@@ -39,17 +39,18 @@ jobs:
3939
4040
- name: Run script
4141
run: |
42-
node tools/update_raspbian_image.mjs
42+
node tools/update_rpi_os_image.mjs
4343
4444
- name: Create Pull Request
4545
uses: peter-evans/create-pull-request@v8
4646
with:
47-
commit-message: "chore: update Raspbian image"
48-
title: "chore: update Raspbian image"
49-
body: "This PR updates the Raspbian image."
47+
commit-message: "chore: update Raspberry Pi OS image"
48+
title: "chore: update Raspberry Pi OS image"
49+
body: "This PR updates the Raspberry Pi OS image."
5050
delete-branch: true
51-
branch: "chore/update-raspbian-image"
51+
branch: "chore/update-raspberry-pi-os-image"
5252
committer: "Companion Bot <companion-module-bot@users.noreply.github.com>"
5353
author: "Companion Bot <companion-module-bot@users.noreply.github.com>"
54+
sign-commits: true
5455
add-paths: |
5556
companionpi.pkr.hcl
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const IMAGING_JSON_URL =
66
"https://downloads.raspberrypi.org/os_list_imagingutility_v4.json";
77

88
const hclPath = fileURLToPath(
9-
new URL("../companionpi.pkr.hcl", import.meta.url)
9+
new URL("../companionpi.pkr.hcl", import.meta.url),
1010
);
1111

1212
function normalizeChecksum(raw) {
@@ -90,18 +90,18 @@ function replaceHclValues(hclStr, newUrl, newChecksum) {
9090
return out;
9191
}
9292

93-
// Usage: node tools/update_raspbian_image.mjs [--dry-run|-n] [--help]
93+
// Usage: node tools/update_rpi_os_image.mjs [--dry-run|-n] [--help]
9494
//
9595
// Fetches the Raspberry Pi imaging utility JSON and updates
9696
// `companionpi.pkr.hcl` `iso_url` and `iso_checksum` fields.
9797
// Use --dry-run to preview changes before writing.
9898

9999
if (process.argv.includes("--help") || process.argv.includes("-h")) {
100100
console.log(
101-
"Usage: node tools/update_raspbian_image.mjs [--dry-run|-n] [--help]"
101+
"Usage: node tools/update_rpi_os_image.mjs [--dry-run|-n] [--help]",
102102
);
103103
console.log(
104-
"Fetch imaging JSON and update companionpi.pkr.hcl with latest raspios_lite_arm64 image and checksum."
104+
"Fetch imaging JSON and update companionpi.pkr.hcl with latest raspios_lite_arm64 image and checksum.",
105105
);
106106
process.exit(0);
107107
}
@@ -120,7 +120,7 @@ console.log(`Found ${apiImagesList.length} items in imaging list`);
120120
const chosenImage = await findImage(apiImagesList);
121121
if (!chosenImage)
122122
throw new Error(
123-
"No suitable raspios_lite_arm64 candidates found in imaging JSON"
123+
"No suitable raspios_lite_arm64 candidates found in imaging JSON",
124124
);
125125

126126
console.log("Found image:", chosenImage.url, chosenImage.sha);

0 commit comments

Comments
 (0)