From c614b96095d7618d3d78be13c6d1e4bd8fbe337d Mon Sep 17 00:00:00 2001 From: Loren Johnson Date: Mon, 7 Oct 2024 11:48:36 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20Add=20token=20with=20adequate=20permis?= =?UTF-8?q?sions=20for=20"=F0=9F=93=A6=20Create=20a=20WBS=20Release"=20(#7?= =?UTF-8?q?85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup-environment/action.yml | 5 +---- .github/workflows/_build_test.yml | 3 --- .github/workflows/build_publish_image_release.yml | 1 - .github/workflows/create_release.yml | 6 ++++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-environment/action.yml b/.github/actions/setup-environment/action.yml index a73b453c1..377236b5c 100644 --- a/.github/actions/setup-environment/action.yml +++ b/.github/actions/setup-environment/action.yml @@ -1,9 +1,6 @@ name: "Setup Node and Docker build environment" description: "Reusable action to set up the environment for builds and tests" inputs: - github_user: - description: user to access GHCR - required: true github_token: description: token to access GHCR required: true @@ -37,7 +34,7 @@ runs: uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ inputs.github_user }} + username: ${{ github.repository_owner }} password: ${{ inputs.github_token }} - name: Set NX to run locally using Node vs in Docker dev runner container diff --git a/.github/workflows/_build_test.yml b/.github/workflows/_build_test.yml index de9dd52ad..736e950dc 100644 --- a/.github/workflows/_build_test.yml +++ b/.github/workflows/_build_test.yml @@ -11,7 +11,6 @@ jobs: - uses: ./.github/actions/setup-environment with: - github_user: ${{ github.repository_owner }} github_token: ${{ secrets.GITHUB_TOKEN }} - run: ./nx lint @@ -36,7 +35,6 @@ jobs: - uses: ./.github/actions/setup-environment with: - github_user: ${{ github.repository_owner }} github_token: ${{ secrets.GITHUB_TOKEN }} - name: Build and push ${{ matrix.imageName }} @@ -64,7 +62,6 @@ jobs: - uses: ./.github/actions/setup-environment with: - github_user: ${{ github.repository_owner }} github_token: ${{ secrets.GITHUB_TOKEN }} - name: "Pull images from GHCR" diff --git a/.github/workflows/build_publish_image_release.yml b/.github/workflows/build_publish_image_release.yml index 8453bb5e3..de638a4b9 100644 --- a/.github/workflows/build_publish_image_release.yml +++ b/.github/workflows/build_publish_image_release.yml @@ -39,7 +39,6 @@ jobs: - uses: ./.github/actions/setup-environment with: - github_user: ${{ github.repository_owner }} github_token: ${{ secrets.GITHUB_TOKEN }} - uses: docker/login-action@v3 diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 6dfceeafc..30149d187 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -39,8 +39,7 @@ jobs: - uses: ./.github/actions/setup-environment with: - github_user: wikibase-suite-bot - github_token: ${{ secrets.GH_WBS_BOT_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} - uses: docker/login-action@v3 with: @@ -55,6 +54,7 @@ jobs: git config --global user.name 'wikibase suite github actions bot' git config --global user.email 'wikibase-suite-github-actions-bot@users.noreply.github.com' + git remote set-url origin https://$GH_WBS_BOT_TOKEN@github.com/${{ github.repository }} if [ "${{ inputs.dry_run }}" == "true" ]; then DRY_RUN_FLAG="--dry-run" @@ -69,3 +69,5 @@ jobs: fi ./nx release $PROJECT_ARG $DRY_RUN_FLAG + env: + GH_WBS_BOT_TOKEN: ${{ secrets.GH_WBS_BOT_TOKEN }}