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
11
11
exit 1
12
12
fi
13
13
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..."
22
14
INPUT_GITHUB_OIDC_AUDIENCE=" https://pub.dev"
15
+
16
+ # Request the GitHub OIDC token
23
17
GITHUB_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
24
24
GITHUB_OIDC_IDTOKEN=$( jq -r ' .value' <<< " ${GITHUB_OIDC_RESPONSE}" )
25
+
26
+ # Set PUB_TOKEN environment variable
25
27
export PUB_TOKEN=${GITHUB_OIDC_IDTOKEN}
26
28
echo " PUB_TOKEN=${GITHUB_OIDC_IDTOKEN} " >> $GITHUB_ENV
27
29
echo " The Dart CLI successfully authenticated with the GitHub OIDC token,"
You can’t perform that action at this time.
0 commit comments