Skip to content

Commit

Permalink
feat(gh-actions): use bot user for create release
Browse files Browse the repository at this point in the history
  • Loading branch information
rti committed Oct 7, 2024
1 parent c94c8cb commit 3fbd1ba
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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
Expand Down Expand Up @@ -34,7 +37,7 @@ runs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ inputs.github_user }}
password: ${{ inputs.github_token }}

- name: Set NX to run locally using Node vs in Docker dev runner container
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:

- uses: ./.github/actions/setup-environment
with:
github_user: ${{ github.repository_owner }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- run: ./nx lint
Expand All @@ -35,6 +36,7 @@ jobs:

- uses: ./.github/actions/setup-environment
with:
github_user: ${{ github.repository_owner }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push ${{ matrix.imageName }}
Expand Down Expand Up @@ -62,6 +64,7 @@ jobs:

- uses: ./.github/actions/setup-environment
with:
github_user: ${{ github.repository_owner }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: "Pull images from GHCR"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_publish_image_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:

- uses: ./.github/actions/setup-environment
with:
github_user: ${{ github.repository_owner }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/login-action@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:

- uses: ./.github/actions/setup-environment
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_user: wikibase-suite-bot
github_token: ${{ secrets.GH_WBS_BOT_TOKEN }}

- uses: docker/login-action@v3
with:
Expand Down

0 comments on commit 3fbd1ba

Please sign in to comment.