Skip to content

Fix: Make plan mode work via prompt instruction (#171) #519

Fix: Make plan mode work via prompt instruction (#171)

Fix: Make plan mode work via prompt instruction (#171) #519

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: write
pull-requests: write
packages: write
jobs:
dagger-ci:
runs-on: [monorepo-runner-set]
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: 1password/load-secrets-action/configure@v2
with:
connect-host: http://onepassword-connect.1password.svc.cluster.local:8080
connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
- uses: 1password/load-secrets-action@v2
with:
export-env: true
env:
NPM_TOKEN: op://bic45kuflnwsnxnd67dzcnxjze/5p65mbzr237yyzt2sfnfao3a5a/NPM_TOKEN
GH_TOKEN: op://bic45kuflnwsnxnd67dzcnxjze/5p65mbzr237yyzt2sfnfao3a5a/GH_TOKEN
- name: Extract kubectl version
id: kubectl-version
run: |
KUBECTL_VERSION=v1.34.1
echo "version=$KUBECTL_VERSION" >> "$GITHUB_OUTPUT"
- name: Cache kubectl
uses: actions/cache@v4
id: kubectl-cache
with:
path: ~/.local/bin/kubectl
key: kubectl-${{ steps.kubectl-version.outputs.version }}-linux-amd64
- name: Install kubectl
if: steps.kubectl-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.local/bin
curl -LO "https://dl.k8s.io/release/${{ steps.kubectl-version.outputs.version }}/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl ~/.local/bin/
- name: Add kubectl to PATH
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Extract Dagger version
id: dagger-version
run: |
DAGGER_IMAGE=$(kubectl get pod --selector=name=dagger-dagger-helm-engine --namespace=dagger -o jsonpath='{.items[0].spec.containers[0].image}')
DAGGER_VERSION="${DAGGER_IMAGE##*:v}"
echo "version=$DAGGER_VERSION" >> "$GITHUB_OUTPUT"
- name: Install Dagger CLI
run: |
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=${{ steps.dagger-version.outputs.version }} BIN_DIR=$HOME/.local/bin sh
- name: Get Dagger Engine Pod Name
run: |
DAGGER_ENGINE_POD_NAME="$(kubectl get pod --selector=name=dagger-dagger-helm-engine --namespace=dagger --output=jsonpath='{.items[0].metadata.name}')"
echo "_EXPERIMENTAL_DAGGER_RUNNER_HOST=kube-pod://$DAGGER_ENGINE_POD_NAME?namespace=dagger" >> "$GITHUB_ENV"
- name: Install Dagger module dependencies
working-directory: .dagger
run: bun install --frozen-lockfile
- name: Run Dagger CI pipeline
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ARGS=(
--source=.
--branch="${{ github.ref_name }}"
--github-token=env:GH_TOKEN
--npm-token=env:NPM_TOKEN
)
if [[ "${{ github.ref_name }}" == "main" ]]; then
ARGS+=(
--version="1.0.${{ github.run_number }}"
--git-sha="${{ github.sha }}"
--registry-username="${{ github.actor }}"
--registry-password=env:GITHUB_TOKEN
)
fi
dagger call ci "${ARGS[@]}"