mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
Merge commit from fork
[skip-ci] Tighten version match
This commit is contained in:
13
.github/workflows/machine-os-pr.yml
vendored
13
.github/workflows/machine-os-pr.yml
vendored
@ -27,9 +27,12 @@ jobs:
|
|||||||
- name: Get version
|
- name: Get version
|
||||||
id: getversion
|
id: getversion
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(curl "https://raw.githubusercontent.com/$PODMAN_REPO/$SHA/version/rawversion/version.go" | sed -n 's/^const RawVersion = \"\(.*\)\"$/\1/p')
|
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')
|
||||||
# ignore -dev version bumps unless on main
|
# ignore -dev version bumps unless on main
|
||||||
if [[ $VERSION == *-dev ]] ; then
|
if [[ -z "$VERSION" ]] ; then
|
||||||
|
echo "::error:: Invalid version string"
|
||||||
|
exit 1
|
||||||
|
elif [[ $VERSION == *-dev ]] ; then
|
||||||
echo "::warning:: SKIPPING: dev bump"
|
echo "::warning:: SKIPPING: dev bump"
|
||||||
elif [[ ${{github.base_ref}} == "main" ]] ; then
|
elif [[ ${{github.base_ref}} == "main" ]] ; then
|
||||||
echo "::warning:: SKIPPING: main branch"
|
echo "::warning:: SKIPPING: main branch"
|
||||||
@ -72,9 +75,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Bump version
|
- name: Bump version
|
||||||
if: steps.getversion.outputs.update == 'true'
|
if: steps.getversion.outputs.update == 'true'
|
||||||
|
env:
|
||||||
|
VERS: ${{steps.getversion.outputs.version}}
|
||||||
run: |
|
run: |
|
||||||
echo ${{steps.getversion.outputs.version}}
|
update=$(printf 's/export PODMAN_VERSION=".*"/export PODMAN_VERSION="%s"/g\n' "$VERS")
|
||||||
sed -i 's/export PODMAN_VERSION=".*"/export PODMAN_VERSION="${{steps.getversion.outputs.version}}"/g' podman-rpm-info-vars.sh
|
sed -i "$update" podman-rpm-info-vars.sh
|
||||||
sed -i 's/export PODMAN_PR_NUM=".*"/export PODMAN_PR_NUM="${{github.event.number}}"/g' podman-rpm-info-vars.sh
|
sed -i 's/export PODMAN_PR_NUM=".*"/export PODMAN_PR_NUM="${{github.event.number}}"/g' podman-rpm-info-vars.sh
|
||||||
echo "Updated file:"
|
echo "Updated file:"
|
||||||
cat podman-rpm-info-vars.sh
|
cat podman-rpm-info-vars.sh
|
||||||
|
Reference in New Issue
Block a user