fix(docker): use env vars for GitHub credentials in workflows
Some checks failed
Docker CI/CD / Docker Build and Push (push) Failing after 5m37s

Migrated from direct GitHub context references to environment variables for GitHub SHA, actor, and token within the Docker build and push actions. This enhances portability and consistency across different execution environments, ensuring better compatibility and security when interfacing with GitHub and Forgejo Docker registries.
This commit is contained in:
Kumi 2024-04-23 10:45:57 +02:00
parent f049285cb1
commit c94c016cf1
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -30,13 +30,13 @@ jobs:
push: true
tags: |
kumitterer/matrix-gptbot:latest
kumitterer/matrix-gptbot:${{ GITHUB_SHA }}
kumitterer/matrix-gptbot:${{ env.GITHUB_SHA }}
- name: Log in to Forgejo Docker Registry
uses: docker/login-action@v3
with:
registry: git.private.coffee
username: ${{ GITHUB_ACTOR }}
password: ${{ GITHUB_TOKEN }}
username: ${{ env.GITHUB_ACTOR }}
password: ${{ env.GITHUB_TOKEN }}
- name: Build and push to Forgejo Docker Registry
uses: docker/build-push-action@v5
with:
@ -45,4 +45,4 @@ jobs:
git.private.coffee/privatecoffee/matrix-gptbot:latest
|
git.private.coffee/privatecoffee/matrix-gptbot:latest
git.private.coffee/privatecoffee/matrix-gptbot:${{ GITHUB_SHA }}
git.private.coffee/privatecoffee/matrix-gptbot:${{ env.GITHUB_SHA }}