diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index a815f9fbb44..16adc7621ed 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -43,8 +43,14 @@ runs: - name: Configure Turborepo id: turbo uses: actions/github-script@v6 + env: + ENABLED: ${{ inputs.turbo-enabled }} + CACHE_DIR: ${{ inputs.turbo-cache-dir }} + SIGNATURE: ${{ inputs.turbo-signature }} + REMOTE_ONLY: ${{ inputs.turbo-remote-only }} + TEAM: ${{ inputs.turbo-team }} + TOKEN: ${{ inputs.turbo-token }} with: - result-encoding: string script: | const os = require('os') const cpus = @@ -52,36 +58,32 @@ runs: ? os.availableParallelism() : os.cpus().length; - const turbo = { - enabled: core.getInput('turbo-enabled') === 'true', - cacheDir: core.getInput('turbo-cache-dir'), - signature: core.getInput('turbo-signature'), - remoteOnly: core.getInput('turbo-remote-only'), - team: core.getInput('turbo-team', { required: true }), - token: core.getInput('turbo-token', { required: true }), - } + const { ENABLED, CACHE_DIR, SIGNATURE, REMOTE_ONLY, TURBO_TEAM, TOKEN } = process.env const turboArgs = [ '--output-logs=new-only', - `--cache-dir=${turbo.cacheDir}`, + `--cache-dir=${CACHE_DIR}`, `--concurrency=${cpus}` ]; - if (turbo.enabled) { - turboArgs.push( - `--team=${turbo.team}`, - `--token=${turbo.token}`, - `--remote-only=${turbo.remoteOnly}`, - ) + if (ENABLED === 'true') { + core.exportVariable('TURBO_TEAM', TEAM) + core.exportVariable('TURBO_TOKEN', TOKEN) + core.exportVariable('TURBO_REMOTE_CACHE_SIGNATURE_KEY', REMOTE_ONLY) + // turboArgs.push( + // `--team=${TEAM}`, + // `--token=${TOKEN}`, + // `--remote-only=${REMOTE_ONLY}`, + // ) + } + + if (SIGNATURE && SIGNATURE !== '') { + core.exportVariable('TURBO_REMOTE_CACHE_SIGNATURE_KEY', SIGNATURE) } core.setOutput('turbo-args', turboArgs.join(' ')); core.exportVariable('FORCE_COLOR', '1') - if (turbo.signature && turbo.signature !== '') { - core.exportVariable('TURBO_REMOTE_CACHE_SIGNATURE_KEY') - } - - name: Setup NodeJS ${{ inputs.node-version }} uses: actions/setup-node@v3 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cc08d6d9e4..4475200cc9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,10 @@ jobs: turbo-team: ${{ vars.TURBO_TEAM }} turbo-token: ${{ secrets.TURBO_TOKEN }} + - name: Test Envs + run: | + console.log('TURBO_TEAM: ${{ env.TURBO_TEAM }}') + - name: Require Changeset run: if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi