File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,19 @@ if [ ! "$(command -v dart)" ] && [ ! "$(command -v flutter)" ]; then
1111 exit 1
1212fi
1313
14- log_group_start () {
15- echo " ::group::${1} "
16- }
17- log_group_end () {
18- echo " ::endgroup::"
19- }
20-
21- echo " Create the OIDC token used for pub.dev publishing..."
2214INPUT_GITHUB_OIDC_AUDIENCE=" https://pub.dev"
15+
16+ # Request the GitHub OIDC token
2317GITHUB_OIDC_RESPONSE=$( curl -s -H " Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN " " $ACTIONS_ID_TOKEN_REQUEST_URL &audience=${INPUT_GITHUB_OIDC_AUDIENCE} " )
18+ if [[ $? -ne 0 ]]; then
19+ echo " ::error::Failed to request the GitHub OIDC token,"
20+ exit 1
21+ fi
22+
23+ # Extract the GitHub OIDC token
2424GITHUB_OIDC_IDTOKEN=$( jq -r ' .value' <<< " ${GITHUB_OIDC_RESPONSE}" )
25+
26+ # Set PUB_TOKEN environment variable
2527export PUB_TOKEN=${GITHUB_OIDC_IDTOKEN}
2628echo " PUB_TOKEN=${GITHUB_OIDC_IDTOKEN} " >> $GITHUB_ENV
2729echo " The Dart CLI successfully authenticated with the GitHub OIDC token,"
You can’t perform that action at this time.
0 commit comments