fix: unset empty App Store Connect API key issuer ID - #117
Merged
Conversation
Making the issuer ID optional in 2.4.4 only relaxed the input and secret declarations. Both composite actions still set the env var unconditionally, so an omitted secret reaches fastlane as "" rather than being absent. Ruby treats "" as truthy, so spaceship takes the team-key branch in ConnectAPI::Token#refresh! and signs a JWT with iss: "" instead of the individual-key sub: "user". Apple rejects it with "Authentication credentials are missing or invalid", failing the release on the first App Store Connect call. Unset the variable when it is empty or whitespace-only, so fastlane sees it as absent and signs an individual-key token. Whitespace is stripped first because fastlane's own .strip would collapse a padded value back to "" and hit the same branch. Fixing beta.sh and release.sh covers every affected workflow: ios-selfhosted-release and ios-kmp-selfhosted-release use ios-fastlane-release; ios-selfhosted-nightly-build and ios-selfhosted-on-demand-build use ios-fastlane-beta; ios-kmp-selfhosted-build and kmp-combined-nightly-build reach ios-fastlane-beta through ios-kmp-build; ios-selfhosted-build is a deprecated shim over ios-selfhosted-nightly-build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jmarek41
force-pushed
the
feature/unset-empty-issuer-id
branch
from
August 13, 2026 09:19
6d91b50 to
5c9b0b5
Compare
jmarek41
enabled auto-merge
August 13, 2026 09:27
ssestak
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Releases using an individual App Store Connect API key fail on the first ASC call with
Authentication credentials are missing or invalid.2.4.4 (#115) made the issuer ID optional only in the input/secret declarations — both actions still set the env var unconditionally, so an omitted secret reaches fastlane as
""rather than absent.""is truthy in Ruby, so spaceship takes the team-key branch and signsiss: ""instead of the individual-keysub: "user". Apple rejects that token.Reproduced on fastlane 2.237.0:
Fix
Unset the variable in
beta.shandrelease.shwhen it is empty or whitespace-only (fastlane's own.stripwould collapse a padded value back to"").unsetrather than a conditional export, so a stale value in the self-hosted runner environment can't leak in.These two scripts are the only place the variable reaches fastlane, so this covers all seven affected workflows — the release ones via
ios-fastlane-release, the build/nightly and KMP ones viaios-fastlane-beta(KMP throughios-kmp-build).Tests
Empty / whitespace-only / valid per action, asserting on the environment the mocked
bundle execactually sees. 24 pass; the two negative cases were confirmed to fail without the fix.Note
Necessary regardless, but only sufficient if the key really is an Individual Key (that page in ASC shows no Issuer ID). A Team Key produces the identical 401 and needs the issuer secret supplied instead.
Needs a 2.4.5 tag + ref bump as the usual follow-up.
🤖 Generated with Claude Code