Download the private API key from App Store Connect in .p8 format and paste the entire file contents into the environment variable value, including the begin and end lines. A truncated or reformatted key is the usual cause. Re-encrypt the variable after fixing it and re-run the build.

Context: Stack Overflow #69510841 (accepted answer, 7 votes): the iOS signing step fails with APP_STORE_CONNECT_PRIVATE_KEY Provided value is not valid even though the key identifier and issuer ID are set. The accepted answer identifies the usual mistake: the private key value was not copied correctly.