Skip to content

Commit 2ac3672

Browse files
committed
ci: add Github Action to automatically update compatibility table
1 parent 865cf5e commit 2ac3672

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/compatibility.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ jobs:
2323
with:
2424
path: dependency
2525

26+
- name: Get dependency tags
27+
working-directory: ./dependency
28+
run: git fetch --tags origin
29+
2630
- name: Setup Python
2731
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.13'
2834

29-
- run: python ./source/compatibility-table.py --source-version ${{ needs.versioning.outputs.next-version }} -d ./dependency -r ./source/README.md
35+
- name: Update compatibility table
36+
run: python ./source/compatibility-table.py --source-version v${{ needs.versioning.outputs.next-version }} -d ./dependency -r ./source/README.md
3037

3138
- name: Commit changes
3239
working-directory: ./source

compatibility-table.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
parser.add_argument('-s', '--source-repo',
1717
help="Source git repository, probably the repository of the Readme file (mutually exclusive with --source-version)")
1818
parser.add_argument('--source-version', help="Source version (mutually exclusive with -s)")
19-
parser.add_argument('-r', '--readme', nargs=1, help="Readme file that needs to be updated", default="README.md")
19+
parser.add_argument('-r', '--readme', help="Readme file that needs to be updated", default="README.md")
2020
parser.add_argument('-d', '--dependency-repo',
2121
help="Dependency git repository: the one's whose version you want to know (mutually exclusive with --dependency-version)")
2222
parser.add_argument('--dependency-version', help="Dependency version (mutually exclusive with -d)")
@@ -50,6 +50,7 @@ def get_version_from_git_repo(path: str) -> str:
5050
if p.returncode != 0 or not out[0]:
5151
print('Getting latest tag from git repo "{}" failed with exit code {}:'.format(path, p.returncode))
5252
print(out)
53+
sys.exit(1)
5354

5455
out = out[0].strip()
5556
return out

0 commit comments

Comments
 (0)