Skip to content

Commit

Permalink
Add support for versionRegex
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
foosel committed Mar 24, 2022
1 parent 0de2159 commit bffb377
Show file tree
Hide file tree
Showing 7 changed files with 5,841 additions and 338 deletions.
1 change: 1 addition & 0 deletions rpi-imager-json/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.vscode
.env
13 changes: 11 additions & 2 deletions rpi-imager-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ If set, the `init_format` to set on the entries. Otherwise whatever is in the sn

If set and matches either a release's name or description, the release will be ignored.

### `versionRegex`

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).

## Usage

`.github/workflows/issue-cleanup.yml`:
`.github/workflows/generate.yml`:

```yaml
name: "Generate rpi-imager.json"
Expand All @@ -64,9 +70,12 @@ jobs:
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
# ...
```

Expand All @@ -86,4 +95,4 @@ node src/index.js

```
npm run build
```
```
2 changes: 2 additions & 0 deletions rpi-imager-json/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ inputs:
description: "What init_format to set on the entries"
ignoreRegex:
description: "An ignore regex to scan for in the release name & description"
versionRegex:
description: "A regex to extract versions from the tag to compare when looking for newer prereleases published before latest stable"
runs:
using: "node12"
main: "dist/index.js"
Loading

0 comments on commit bffb377

Please sign in to comment.