File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,16 +81,23 @@ RUN apt-get update && \
8181
8282# Install e-dant/watcher (necessary for file watching)
8383WORKDIR /usr/local/src/watcher
84- RUN curl -s https://api.github.com/repos/e-dant/watcher/releases/latest | \
85- grep tarball_url | \
86- awk '{ print $2 }' | \
87- sed 's/,$//' | \
88- sed 's/"//g' | \
89- xargs curl -L | \
84+ RUN --mount=type=secret,id=github-token \
85+ if [ -f /run/secrets/github-token ] && [ -s /run/secrets/github-token ]; then \
86+ echo "Using authenticated GitHub API request" ; \
87+ curl -s -H "Authorization: Bearer $(cat /run/secrets/github-token)" https://api.github.com/repos/e-dant/watcher/releases/latest; \
88+ else \
89+ echo "Using unauthenticated GitHub API request" ; \
90+ curl -s https://api.github.com/repos/e-dant/watcher/releases/latest; \
91+ fi | \
92+ grep tarball_url | \
93+ awk '{ print $2 }' | \
94+ sed 's/,$//' | \
95+ sed 's/"//g' | \
96+ xargs curl -L | \
9097 tar xz --strip-components 1 && \
9198 cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
92- cmake --build build && \
93- cmake --install build && \
99+ cmake --build build && \
100+ cmake --install build && \
94101 ldconfig
95102
96103WORKDIR /go/src/app
Original file line number Diff line number Diff line change @@ -88,16 +88,23 @@ RUN apk add --no-cache --virtual .build-deps \
8888
8989# Install e-dant/watcher (necessary for file watching)
9090WORKDIR /usr/local/src/watcher
91- RUN curl -s https://api.github.com/repos/e-dant/watcher/releases/latest | \
92- grep tarball_url | \
93- awk '{ print $2 }' | \
94- sed 's/,$//' | \
95- sed 's/"//g' | \
96- xargs curl -L | \
91+ RUN --mount=type=secret,id=github-token \
92+ if [ -f /run/secrets/github-token ] && [ -s /run/secrets/github-token ]; then \
93+ echo "Using authenticated GitHub API request" ; \
94+ curl -s -H "Authorization: Bearer $(cat /run/secrets/github-token)" https://api.github.com/repos/e-dant/watcher/releases/latest; \
95+ else \
96+ echo "Using unauthenticated GitHub API request" ; \
97+ curl -s https://api.github.com/repos/e-dant/watcher/releases/latest; \
98+ fi | \
99+ grep tarball_url | \
100+ awk '{ print $2 }' | \
101+ sed 's/,$//' | \
102+ sed 's/"//g' | \
103+ xargs curl -L | \
97104 tar xz --strip-components 1 && \
98105 cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
99- cmake --build build && \
100- cmake --install build
106+ cmake --build build && \
107+ cmake --install build
101108
102109WORKDIR /go/src/app
103110
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ target "default" {
116116 args = {
117117 FRANKENPHP_VERSION = VERSION
118118 }
119+ secret = [" id=github-token,env=GITHUB_TOKEN" ]
119120}
120121
121122target "static-builder-musl" {
You can’t perform that action at this time.
0 commit comments