mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
ci(docker): authenticate GitHub API calls (#1680)
This commit is contained in:
committed by
GitHub
parent
b2435183f4
commit
2712876e95
23
Dockerfile
23
Dockerfile
@@ -81,16 +81,23 @@ RUN apt-get update && \
|
||||
|
||||
# Install e-dant/watcher (necessary for file watching)
|
||||
WORKDIR /usr/local/src/watcher
|
||||
RUN curl -s https://api.github.com/repos/e-dant/watcher/releases/latest | \
|
||||
grep tarball_url | \
|
||||
awk '{ print $2 }' | \
|
||||
sed 's/,$//' | \
|
||||
sed 's/"//g' | \
|
||||
xargs curl -L | \
|
||||
RUN --mount=type=secret,id=github-token \
|
||||
if [ -f /run/secrets/github-token ] && [ -s /run/secrets/github-token ]; then \
|
||||
echo "Using authenticated GitHub API request"; \
|
||||
curl -s -H "Authorization: Bearer $(cat /run/secrets/github-token)" https://api.github.com/repos/e-dant/watcher/releases/latest; \
|
||||
else \
|
||||
echo "Using unauthenticated GitHub API request"; \
|
||||
curl -s https://api.github.com/repos/e-dant/watcher/releases/latest; \
|
||||
fi | \
|
||||
grep tarball_url | \
|
||||
awk '{ print $2 }' | \
|
||||
sed 's/,$//' | \
|
||||
sed 's/"//g' | \
|
||||
xargs curl -L | \
|
||||
tar xz --strip-components 1 && \
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
|
||||
cmake --build build && \
|
||||
cmake --install build && \
|
||||
cmake --build build && \
|
||||
cmake --install build && \
|
||||
ldconfig
|
||||
|
||||
WORKDIR /go/src/app
|
||||
|
||||
@@ -88,16 +88,23 @@ RUN apk add --no-cache --virtual .build-deps \
|
||||
|
||||
# Install e-dant/watcher (necessary for file watching)
|
||||
WORKDIR /usr/local/src/watcher
|
||||
RUN curl -s https://api.github.com/repos/e-dant/watcher/releases/latest | \
|
||||
grep tarball_url | \
|
||||
awk '{ print $2 }' | \
|
||||
sed 's/,$//' | \
|
||||
sed 's/"//g' | \
|
||||
xargs curl -L | \
|
||||
RUN --mount=type=secret,id=github-token \
|
||||
if [ -f /run/secrets/github-token ] && [ -s /run/secrets/github-token ]; then \
|
||||
echo "Using authenticated GitHub API request"; \
|
||||
curl -s -H "Authorization: Bearer $(cat /run/secrets/github-token)" https://api.github.com/repos/e-dant/watcher/releases/latest; \
|
||||
else \
|
||||
echo "Using unauthenticated GitHub API request"; \
|
||||
curl -s https://api.github.com/repos/e-dant/watcher/releases/latest; \
|
||||
fi | \
|
||||
grep tarball_url | \
|
||||
awk '{ print $2 }' | \
|
||||
sed 's/,$//' | \
|
||||
sed 's/"//g' | \
|
||||
xargs curl -L | \
|
||||
tar xz --strip-components 1 && \
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
|
||||
cmake --build build && \
|
||||
cmake --install build
|
||||
cmake --build build && \
|
||||
cmake --install build
|
||||
|
||||
WORKDIR /go/src/app
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ target "default" {
|
||||
args = {
|
||||
FRANKENPHP_VERSION = VERSION
|
||||
}
|
||||
secret = ["id=github-token,env=GITHUB_TOKEN"]
|
||||
}
|
||||
|
||||
target "static-builder-musl" {
|
||||
|
||||
Reference in New Issue
Block a user