From 78876f30de1515829f6c906eaef1f03144c51f7d Mon Sep 17 00:00:00 2001 From: thomassth Date: Fri, 2 Aug 2024 01:18:03 -0400 Subject: [PATCH] use env-var instead --- .github/workflows/prerelease.yml | 9 ++------- .github/workflows/release.yml | 10 ++-------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 214ff13f..c9e93d6b 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -42,14 +42,9 @@ jobs: with: script: | let pub_token = await core.getIDToken('https://pub.dev') - github.rest.actions.createOrUpdateRepoSecret({ - owner: context.repo.owner, - repo: context.repo.repo, - secret_name: PUB_TOKEN, - encrypted_value: pub_token - }); + core.exportVariable('PUB_TOKEN', pub_token) - name: 📢 Authenticate - run: flutter pub pub token add https://pub.dev --env-var ${{ secrets.PUB_TOKEN }} + run: flutter pub pub token add https://pub.dev --env-var PUB_TOKEN - name: 📦 Install dependencies run: flutter pub get - name: 🌵 Dry Run diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 529b51d8..36adda6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,15 +31,9 @@ jobs: with: script: | let pub_token = await core.getIDToken('https://pub.dev') - let pub_token = await core.getIDToken('https://pub.dev') - github.rest.actions.createOrUpdateRepoSecret({ - owner: context.repo.owner, - repo: context.repo.repo, - secret_name: PUB_TOKEN, - encrypted_value: pub_token - }); + core.exportVariable('PUB_TOKEN', pub_token) - name: 📢 Authenticate - run: flutter pub pub token add https://pub.dev --env-var ${{ secrets.PUB_TOKEN }} + run: flutter pub pub token add https://pub.dev --env-var PUB_TOKEN - name: 📦 Install dependencies run: flutter pub get - name: 🌵 Dry Run