Skip to content

Commit

Permalink
fix: GH login
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblackman committed Mar 12, 2024
1 parent c4264ac commit 9e2d951
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ FROM rust:1.74.0-slim-bookworm as builder
RUN apt-get update && \
apt-get install -y curl libssl-dev pkg-config

ARG EMPTY_GITHUB_TOKEN
RUN mkdir -p -m 755 /etc/apt/keyrings && \
curl -L -o /etc/apt/keyrings/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg && \
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
apt-get update && \
apt-get install gh -y && \
echo "$EMPTY_GITHUB_TOKEN" | gh auth login --with-token

COPY ./Cargo.lock ./Cargo.toml ./.mise.toml /tmp/build-cache/
COPY .cargo/ /tmp/build-cache/.cargo

Expand Down
1 change: 1 addition & 0 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PROGDIR=$(dirname "$(readlink -f "$0")")
cd "$PROGDIR/.."

BUILD_ARCH="$1"
export EMPTY_GITHUB_TOKEN="$2"

(
cd tools/node
Expand Down
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer-src.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "oatmeal",
"build": {
"context": "..",
"dockerfile": "./Dockerfile"
"dockerfile": "./Dockerfile",
"args": {
"EMPTY_GITHUB_TOKEN": "${localEnv:EMPTY_GITHUB_TOKEN}"
}
},
"remoteUser": "oatmeal",
"features": {
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ name: devcontainer
jobs:
build:
runs-on: ubuntu-latest
environment: devcontainer
strategy:
matrix:
arch: ["arm64", "amd64"]
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
node-version: 18.19.0
- name: Build
run: |
./.devcontainer/build.sh ${{ matrix.arch }}
./.devcontainer/build.sh ${{ matrix.arch }} ${{ secrets.EMPTY_GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9e2d951

Please sign in to comment.