Skip to content

Private config

Private config #1015

# This file was generated. See https://daggerverse.dev/mod/github.com/shykes/gha
name: Lua Modules (linter)
"on":
pull_request:
branches:
- main
workflow_dispatch: {}
jobs:
dagger:
runs-on: ubuntu-latest
name: Lua Modules (linter)
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: "false"
sparse-checkout: |-
dagger.json
dagger
lua/modules
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: latest
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
GITHUB_OUTPUT="${GITHUB_OUTPUT:=github-output.txt}"
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
# Expose the outputs as GitHub Actions step outputs directly from the files
# Multi-line outputs are handled with the '<<EOF' syntax
{
echo 'stdout<<EOF'
cat "$tmp/stdout.txt"
echo 'EOF'
echo 'stderr<<EOF'
cat "$tmp/stderr.txt"
echo 'EOF'
} > "${GITHUB_OUTPUT}"
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
cat $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: p.eyJ1IjogIjFiZjEwMmRjLWYyZmQtNDVhNi1iNzM1LTgxNzI1NGFkZDU2ZiIsICJpZCI6ICI4ZmZmNmZkMi05MDhiLTQ4YTEtOGQ2Zi1iZWEyNGRkNzk4MTkifQ.l1Sf1gB37veXUWhxOgmjvjYcrh32NiuovbMxvjVI7Z0
COMMAND: dagger call -q lint-modules --src=.
DAGGER_CLOUD_TOKEN: p.eyJ1IjogIjFiZjEwMmRjLWYyZmQtNDVhNi1iNzM1LTgxNzI1NGFkZDU2ZiIsICJpZCI6ICI4ZmZmNmZkMi05MDhiLTQ4YTEtOGQ2Zi1iZWEyNGRkNzk4MTkifQ.l1Sf1gB37veXUWhxOgmjvjYcrh32NiuovbMxvjVI7Z0
GITHUB_ACTION: ${{ github.action }}
GITHUB_ACTION_PATH: ${{ github.action_path }}
GITHUB_ACTION_REF: ${{ github.action_ref }}
GITHUB_ACTION_REPOSITORY: ${{ github.action_repository }}
GITHUB_ACTION_STATUS: ${{ github.action_status }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_ACTOR_ID: ${{ github.actor_id }}
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_BASE_REF: ${{ github.base_ref }}
GITHUB_ENV: ${{ github.env }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
GITHUB_GRAPHQL_URL: ${{ github.graphql_url }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_JOB: ${{ github.job }}
GITHUB_PATH: ${{ github.path }}
GITHUB_REF: ${{ github.ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_REF_PROTECTED: ${{ github.ref_protected }}
GITHUB_REF_TYPE: ${{ github.ref_type }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REPOSITORY_ID: ${{ github.repository_id }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_REPOSITORY_OWNER_ID: ${{ github.repository_owner_id }}
GITHUB_REPOSITORYURL: ${{ github.repositoryUrl }}
GITHUB_RETENTION_DAYS: ${{ github.retention_days }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
GITHUB_SECRET_SOURCE: ${{ github.secret_source }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TRIGGERING_ACTOR: ${{ github.triggering_actor }}
GITHUB_WORKFLOW: ${{ github.workflow }}
GITHUB_WORKFLOW_REF: ${{ github.workflow_ref }}
GITHUB_WORKFLOW_SHA: ${{ github.workflow_sha }}
GITHUB_WORKSPACE: ${{ github.workspace }}
shell: bash
outputs:
stderr: ${{ steps.exec.outputs.stderr }}
stdout: ${{ steps.exec.outputs.stdout }}