Skip to content

Commit 88a957c

Browse files
bugfix: mask threads access token (#43)
Signed-off-by: Tsung-Ju Lii <[email protected]>
1 parent 2871432 commit 88a957c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/update_threads_access_token.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,18 @@ jobs:
2020
RESPONSE=$(curl -i -X GET "https://graph.threads.net/access_token?grant_type=th_exchange_token&client_secret=$APP_SECRET&access_token=$SHORT_LIVED_TOKEN")
2121
2222
# Extract the long-lived access token from the response
23-
LONG_LIVED_TOKEN=$(echo "$RESPONSE" | grep -oP '(?<=access_token":")[^"]*')
23+
THREADS_ACCESS_TOKEN=$(echo "$RESPONSE" | grep -oP '(?<=access_token":")[^"]*')
2424
25-
if [ -z "$LONG_LIVED_TOKEN" ]; then
25+
if [ -z "$THREADS_ACCESS_TOKEN" ]; then
2626
echo "Failed to retrieve long-lived token"
2727
exit 1 # Fail fast if the token isn't found
2828
fi
2929
3030
echo "Long-lived access token retrieved successfully."
3131
3232
# Save the long-lived token as a GitHub secret
33-
echo "THREADS_ACCESS_TOKEN=$LONG_LIVED_TOKEN" >> $GITHUB_ENV
33+
echo "::add-mask::$THREADS_ACCESS_TOKEN"
34+
echo "THREADS_ACCESS_TOKEN=$THREADS_ACCESS_TOKEN" >> $GITHUB_ENV
3435
- uses: actions/setup-node@v3
3536
with:
3637
node-version: 20

0 commit comments

Comments
 (0)