mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-26 22:26:08 +08:00
test: set GITHUB_TOKEN secret
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
fe75972f55
commit
251b9d49f3
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -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
|
||||||
|
@ -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 /
|
||||||
|
@ -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"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user