Skip to content

Commit 0473680

Browse files
committed
Allow skipping some versions
1 parent 1bb2891 commit 0473680

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/docker-publish-all.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Publish all multi-arch Docker image versions
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
last_good_version:
7+
description: 'Last version to skip'
8+
required: false
9+
type: string
510

611
jobs:
712
fetch_versions:
@@ -12,7 +17,10 @@ jobs:
1217
- name: Check out the repository to the runner
1318
uses: actions/checkout@v6
1419
- id: versions
15-
run: echo matrix=$(python update.py ) >> "$GITHUB_OUTPUT"
20+
run: |
21+
VERSIONS=$(python update.py ${{ inputs.last_good_version }} )
22+
echo $VERSIONS
23+
echo matrix=$VERSIONS >> "$GITHUB_OUTPUT"
1624
1725
call_build:
1826
needs:

update.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import html.parser
22
import urllib.request
33
import json
4+
import sys
45

56
url = "http://dev.overpass-api.de/releases/"
67
skip_prefixes = (
@@ -32,16 +33,20 @@ def versions_to_build():
3233
data = response.read().decode(response.headers.get_content_charset())
3334
parser.feed(data)
3435

35-
return [
36+
return list(sorted([
3637
version for version in parser.versions
3738
if version != 'v0.7'
3839
and not any(version.startswith(skip_prefix) for skip_prefix in skip_prefixes)
39-
]
40+
]))
4041

4142

4243
if __name__ == '__main__':
4344
versions = versions_to_build()
45+
if len(sys.argv) > 1 and sys.argv[1]:
46+
filter_predicate = lambda x: x > sys.argv[1]
47+
else:
48+
filter_predicate = lambda x: True
4449
github_matrix = {
45-
"include": [{"version": v} for v in versions]
50+
"include": [{"version": v} for v in versions if filter_predicate(v)]
4651
}
4752
print(json.dumps(github_matrix, indent=None))

0 commit comments

Comments
 (0)