Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c7560d

Browse files
committed
Update action.yaml
1 parent487d4ca commit3c7560d

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

‎extract-versions/action.yaml‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@ runs:
2626
# Function to extract version from anchor.toml
2727
extract_from_anchor_toml() {
2828
local key=$1
29+
local version=""
2930
# Try both uppercase and lowercase variants
3031
if [ -f "Anchor.toml" ]; then
31-
echo "Found Anchor.toml in current directory"
32+
echo "Found Anchor.toml in current directory" >&2
3233
version=$(grep -i "^${key}_version *= *\".*\"" Anchor.toml | cut -d'"' -f2)
3334
if [ -n "$version" ]; then
3435
echo "$version"
3536
return 0
3637
fi
3738
elif [ -f "anchor.toml" ]; then
38-
echo "Found anchor.toml in current directory"
39+
echo "Found anchor.toml in current directory" >&2
3940
version=$(grep -i "^${key}_version *= *\".*\"" anchor.toml | cut -d'"' -f2)
4041
if [ -n "$version" ]; then
4142
echo "$version"
@@ -45,7 +46,7 @@ runs:
4546
else
4647
anchor_toml=$(find . -iname "anchor.toml" -type f | head -n 1)
4748
if [ -n "$anchor_toml" ]; then
48-
echo "Found anchor.toml at: $anchor_toml"
49+
echo "Found anchor.toml at: $anchor_toml" >&2
4950
version=$(grep -i "^${key}_version *= *\".*\"" "$anchor_toml" | cut -d'"' -f2)
5051
if [ -n "$version" ]; then
5152
echo "$version"
@@ -80,8 +81,14 @@ runs:
8081
fi
8182
fi
8283
fi
83-
echo "solana_version=${SOLANA_VERSION}" >> $GITHUB_OUTPUT
84-
echo "SOLANA_VERSION=${SOLANA_VERSION}" >> $GITHUB_ENV
84+
85+
# Ensure clean version output
86+
if [ -n "${SOLANA_VERSION}" ]; then
87+
# Remove any newlines and ensure we only have the version
88+
SOLANA_VERSION=$(echo "${SOLANA_VERSION}" | tr -d '\n' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
89+
echo "solana_version=${SOLANA_VERSION}" >> $GITHUB_OUTPUT
90+
echo "SOLANA_VERSION=${SOLANA_VERSION}" >> $GITHUB_ENV
91+
fi
8592
8693
# Extract Anchor version
8794
if [ -n "${{ github.event.inputs.anchor_version }}" ]; then
@@ -108,7 +115,10 @@ runs:
108115
fi
109116
fi
110117
118+
# Ensure clean version output
111119
if [ -n "${ANCHOR_VERSION}" ]; then
120+
# Remove any newlines and ensure we only have the version
121+
ANCHOR_VERSION=$(echo "${ANCHOR_VERSION}" | tr -d '\n' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
112122
echo "anchor_version=${ANCHOR_VERSION}" >> $GITHUB_OUTPUT
113123
echo "ANCHOR_VERSION=${ANCHOR_VERSION}" >> $GITHUB_ENV
114124
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp