fix PUB_TOKEN request
This commit is contained in:
@@ -14,39 +14,17 @@ runs:
|
||||
- name: 🐦 Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
|
||||
# Future<void> createPubOIDCToken() async {
|
||||
# final tokenRequestUrl = process.env('ACTIONS_ID_TOKEN_REQUEST_URL');
|
||||
# final tokenRequestToken = process.env('ACTIONS_ID_TOKEN_REQUEST_TOKEN');
|
||||
|
||||
# if (tokenRequestUrl == null || tokenRequestToken == null) {
|
||||
# return;
|
||||
# }
|
||||
|
||||
# final token =
|
||||
# await promiseToFuture<String>(core.getIDToken('https://pub.dev'));
|
||||
|
||||
# core.exportVariable('PUB_TOKEN', token);
|
||||
|
||||
# await promiseToFuture<void>(exec.exec(
|
||||
# 'dart',
|
||||
# [
|
||||
# 'pub'.toJS,
|
||||
# 'token'.toJS,
|
||||
# 'add'.toJS,
|
||||
# 'https://pub.dev'.toJS,
|
||||
# '--env-var'.toJS,
|
||||
# 'PUB_TOKEN'.toJS,
|
||||
# ].toJS,
|
||||
# ));
|
||||
# }
|
||||
# Get the token and put it in the PUB_TOKEN environment variable
|
||||
# curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://pub.dev/"
|
||||
# flutter pub pub token add --host https://pub.dev --env-var PUB_TOKEN
|
||||
|
||||
- name: Get OIDC token
|
||||
- name: ☎️ Install OIDC Client from Core Package
|
||||
shell: ${{ inputs.shell }}
|
||||
run: |
|
||||
curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://pub.dev/"
|
||||
run: npm install @actions/core@1.6.0 @actions/http-client
|
||||
|
||||
- name: 🪪 Get Id Token
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const core = require('@actions/core')
|
||||
let pub_token = await core.getIDToken('https://pub.dev/')
|
||||
core.setOutput('PUB_TOKEN', pub_token)
|
||||
|
||||
- name: 📢 Authenticate
|
||||
shell: ${{ inputs.shell }}
|
||||
|
||||
Reference in New Issue
Block a user