Generates an rpi-imager.json
based on latest GitHub stable and prereleases, utilizing
attached rpi-imager.json
snippets as e.g. generated by
OctoPi-UpToDate's CustoPiZer workflow.
If a prerelease newer than the latest stable release is available, its snippet will be included
in the generated rpi-imager.json
. Otherwise only the latest stable snippet will be included.
Can be used to automatically generate rpi-imager.json
as part of a static page build.
Required The GitHub token to use, should usually be set to secrets.GITHUB_TOKEN
.
Required The owner of the repository to monitor.
Required The name of the repository to monitor.
Required The name of the output file to write rpi-imager.json
to.
If set, the name to give the stable release. Otherwise the name from the snippet will be used.
If set, the name to give the prerelease. Otherwise the name from the snippet will be used.
If set, the init_format
to set on the entries. Otherwise whatever is in the snippet will be used.
If set and matches either a release's name or description, the release will be ignored.
If set, used to extract version numbers from a release's tag via named groups. These versions will then be used to determine whether prereleases predating the latest stable release are possibly actually still to be included as they contain newer software versions (and are just earlier builds).
.github/workflows/generate.yml
:
name: "Generate rpi-imager.json"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
# ...
- uses: OctoPrint/actions/rpi-imager-json@main
with:
token: "${{ secrets.GITHUB_TOKEN }}"
owner: OctoPrint
repo: OctoPi-UpToDate
ignoreRegex: "mark:untested"
versionRegex: "^(?<octopi>.*?)-(?<octoprint>.*?)-\\d+$"
output: ./files/rpi-imager.json
nameStable: "OctoPi (stable)"
namePrerelease: "OctoPi (prerelease)"
initFormat: systemd
# ...
export INPUT_TOKEN=...
export INPUT_OWNER=...
export INPUT_REPO=...
export INPUT_OUTPUT=...
node src/index.js
npm run build