File tree 1 file changed +9
-4
lines changed 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 27
27
- name : Get version
28
28
id : getversion
29
29
run : |
30
- VERSION=$(curl "https://raw.githubusercontent.com/$PODMAN_REPO/$SHA/version/rawversion/version.go" | sed -n 's/^const RawVersion = \"\(.*\)\ "$/\1/p')
30
+ VERSION=$(curl "https://raw.githubusercontent.com/$PODMAN_REPO/$SHA/version/rawversion/version.go" | sed -n 's/^const RawVersion = \"\([0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\|-dev\)\?\) "$/\1/p')
31
31
# ignore -dev version bumps unless on main
32
- if [[ $VERSION == *-dev ]] ; then
32
+ if [[ -z "$VERSION" ]] ; then
33
+ echo "::error:: Invalid version string"
34
+ exit 1
35
+ elif [[ $VERSION == *-dev ]] ; then
33
36
echo "::warning:: SKIPPING: dev bump"
34
37
elif [[ ${{github.base_ref}} == "main" ]] ; then
35
38
echo "::warning:: SKIPPING: main branch"
72
75
73
76
- name : Bump version
74
77
if : steps.getversion.outputs.update == 'true'
78
+ env :
79
+ VERS : ${{steps.getversion.outputs.version}}
75
80
run : |
76
- echo ${{steps.getversion.outputs.version}}
77
- sed -i 's/export PODMAN_VERSION=".*"/export PODMAN_VERSION="${{steps.getversion.outputs.version}}"/g' podman-rpm-info-vars.sh
81
+ update=$(printf 's/export PODMAN_VERSION=".*"/export PODMAN_VERSION="%s"/g\n' "$VERS")
82
+ sed -i "$update" podman-rpm-info-vars.sh
78
83
sed -i 's/export PODMAN_PR_NUM=".*"/export PODMAN_PR_NUM="${{github.event.number}}"/g' podman-rpm-info-vars.sh
79
84
echo "Updated file:"
80
85
cat podman-rpm-info-vars.sh
You can’t perform that action at this time.
0 commit comments