Skip to content

Commit c5a2b13

Browse files
committed
fix(ci): use printf for base64 decoding in appstore workflow
- Prevent trailing newline issues when decoding certificates and profiles - Improve compatibility with macOS base64 -D command
1 parent 1c4c7e1 commit c5a2b13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/appstore-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
security import "$RUNNER_TEMP/AppleWWDRCAG3.cer" -k "$KEYCHAIN_PATH" -T /usr/bin/codesign 2>&1 || true
123123
124124
# Import Mac App Store certificates (Application + Installer, both in the P12)
125-
echo "$APPLE_MAS_CERTIFICATE_P12" | base64 --decode > "$RUNNER_TEMP/mas-cert.p12"
125+
printf '%s' "$APPLE_MAS_CERTIFICATE_P12" | base64 -D > "$RUNNER_TEMP/mas-cert.p12"
126126
security import "$RUNNER_TEMP/mas-cert.p12" \
127127
-k "$KEYCHAIN_PATH" \
128128
-P "$APPLE_MAS_CERTIFICATE_PASSWORD" \
@@ -183,8 +183,9 @@ jobs:
183183
fi
184184
185185
# Decode and install the profile
186+
# printf '%s' avoids the trailing newline echo adds, which breaks macOS base64 -D
186187
PP_PATH="$RUNNER_TEMP/mas.provisionprofile"
187-
echo "$PROFILE_CONTENT" | base64 --decode > "$PP_PATH"
188+
printf '%s' "$PROFILE_CONTENT" | base64 -D > "$PP_PATH"
188189
PP_UUID=$(security cms -D -i "$PP_PATH" | /usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin)
189190
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
190191
cp "$PP_PATH" "$HOME/Library/MobileDevice/Provisioning Profiles/$PP_UUID.provisionprofile"

0 commit comments

Comments
 (0)