test: set GITHUB_TOKEN secret

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-01-24 00:29:03 +01:00
parent fe75972f55
commit 251b9d49f3
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
3 changed files with 10 additions and 5 deletions

View File

@ -23,6 +23,8 @@ jobs:
uses: docker/bake-action@v2 uses: docker/bake-action@v2
with: with:
targets: test-coverage targets: test-coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - # -
# name: Upload coverage # name: Upload coverage
# uses: codecov/codecov-action@v3 # uses: codecov/codecov-action@v3

View File

@ -59,7 +59,8 @@ RUN --mount=type=bind,target=.,rw \
--mount=type=bind,from=docker,source=/usr/local/bin/docker,target=/usr/bin/docker \ --mount=type=bind,from=docker,source=/usr/local/bin/docker,target=/usr/bin/docker \
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \ --mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
--mount=type=bind,from=buildx,source=/buildx,target=/usr/bin/buildx \ --mount=type=bind,from=buildx,source=/buildx,target=/usr/bin/buildx \
yarn run test-coverage --coverageDirectory=/tmp/coverage --mount=type=secret,id=GITHUB_TOKEN \
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) yarn run test-coverage --coverageDirectory=/tmp/coverage
FROM scratch AS test-coverage FROM scratch AS test-coverage
COPY --from=test /tmp/coverage / COPY --from=test /tmp/coverage /

View File

@ -44,10 +44,12 @@ target "test" {
dockerfile = "dev.Dockerfile" dockerfile = "dev.Dockerfile"
target = "test" target = "test"
output = ["type=cacheonly"] output = ["type=cacheonly"]
secret = ["id=GITHUB_TOKEN,env=GITHUB_TOKEN"]
} }
target "test-coverage" { target "test-coverage" {
dockerfile = "dev.Dockerfile" dockerfile = "dev.Dockerfile"
target = "test-coverage" target = "test-coverage"
output = ["./coverage"] output = ["./coverage"]
secret = ["id=GITHUB_TOKEN,env=GITHUB_TOKEN"]
} }