From 76955cc01a2abd3523db33e2fff4025ae380f44c Mon Sep 17 00:00:00 2001 From: Thephaseless Date: Sat, 30 Nov 2024 12:45:19 +0000 Subject: [PATCH] update python version in action with base --- renovate.json | 9 ++++++++- update_python_action.sh | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 update_python_action.sh diff --git a/renovate.json b/renovate.json index 420edd7..4309556 100644 --- a/renovate.json +++ b/renovate.json @@ -6,5 +6,12 @@ "automerge": true, "matchUpdateTypes": ["minor", "patch"] } - ] + ], + "postUpgradeTasks": { + "commands": [ + "./scripts/post-upgrade.sh {{{depName}}} {{{currentVersion}}} {{{newVersion}}}" + ], + "executionMode": "update", + "fileFilters": [] + } } diff --git a/update_python_action.sh b/update_python_action.sh new file mode 100755 index 0000000..0b8442d --- /dev/null +++ b/update_python_action.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +action_path=.github/workflows/docker-publish.yml + +# Example usage: +# ./update_python_action.sh python 3.12 3.13 +dependency_name=$1 +current_version=$2 +new_version=$3 + +# If package is not python, skip +if [ "$dependency_name" != "python" ]; then + exit 0 +fi + +# Find and replace python version +# with: +# python-version: "3.13" + +sed -i "s/python-version: \"$current_version\"/python-version: \"$new_version\"/g" $action_path \ No newline at end of file