diff --git a/.github/workflows/publish-deno.yml b/.github/workflows/publish-deno.yml index df361c7ce..1b264b39e 100644 --- a/.github/workflows/publish-deno.yml +++ b/.github/workflows/publish-deno.yml @@ -11,6 +11,15 @@ jobs: environment: publish steps: + - name: Generate a token + id: generate_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: 'openai' + repositories: 'openai-node,openai-deno-build' + - uses: actions/checkout@v3 - name: Set up Node @@ -27,17 +36,9 @@ jobs: run: | yarn install - - name: Generate a token - id: generate_token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Publish to Deno run: | bash ./scripts/git-publish-deno.sh env: - GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} - DENO_PUSH_REMOTE_URL: git@github.com:openai/openai-deno-build.git + DENO_PUSH_REMOTE_URL: https://username:${{ steps.generate_token.outputs.token }}@github.com/openai/openai-deno-build.git DENO_PUSH_BRANCH: main diff --git a/scripts/git-publish-deno.sh b/scripts/git-publish-deno.sh index 90855bfb8..4098994f3 100755 --- a/scripts/git-publish-deno.sh +++ b/scripts/git-publish-deno.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -exuo pipefail -# This script pushes the contents of the `deno`` directory to the `deno` branch, +# This script pushes the contents of the `deno` directory to the `deno` branch, # and creates a `vx.x.x-deno` tag, so that Deno users can # import OpenAI from "https://raw.githubusercontent.com/openai/openai-node/vx.x.x-deno/mod.ts"