Skip to content

Commit 875a6f4

Browse files
committed
Mounts token as docker secret
1 parent 84cdbb0 commit 875a6f4

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ jobs:
6767
context: .
6868
load: true
6969
tags: plus3it/tardigrade-ci:test
70-
build-args: |
71-
GITHUB_ACCESS_TOKEN=${{ secrets.GH_READONLY_TOKEN }}
70+
secrets: |
71+
"GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}"
7272
7373
- name: Run bats tests
7474
if: github.event_name == 'pull_request'
75-
run: docker run --rm plus3it/tardigrade-ci:test bats/test
75+
run: docker run --rm -e "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" plus3it/tardigrade-ci:test bats/test
7676

7777
- name: Push to registries
7878
if: github.event_name != 'pull_request'
@@ -81,3 +81,5 @@ jobs:
8181
push: true
8282
tags: ${{ steps.meta.outputs.tags }}
8383
labels: ${{ steps.meta.outputs.labels }}
84+
secrets: |
85+
"GITHUB_ACCESS_TOKEN=${{ secrets.GH_READONLY_TOKEN }}"

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ concurrency:
99
jobs:
1010
lint:
1111
runs-on: ubuntu-latest
12+
env:
13+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1214
steps:
1315
- name: Clone this git repository
1416
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
FROM golang:1.24.3-bookworm as golang
1+
FROM golang:1.24.3-bookworm AS golang
22

33
FROM python:3.13.3-bookworm
44

55
ARG PROJECT_NAME=tardigrade-ci
6-
ARG GITHUB_ACCESS_TOKEN
6+
7+
RUN --mount=type=secret,id=GITHUB_ACCESS_TOKEN,env=GITHUB_ACCESS_TOKEN
78

89
ENV USER=${PROJECT_NAME}
910
ENV USER_UID=1000

0 commit comments

Comments
 (0)