From 2cb0017fd69d54804930d3be3e811df7090b0243 Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 12:09:49 -0500 Subject: [PATCH 01/12] add check verb and tests Signed-off-by: kpenfound --- .github/workflows/test.yml | 15 +++++++++++++++ action.yml | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 699709b..4476010 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -236,6 +236,21 @@ jobs: exit 1 fi + check: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v4 + - name: "Test check" + uses: ./ + with: + module: github.com/kpenfound/dag/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 + check: "**" + - name: "Test check" + uses: ./ + with: + module: github.com/kpenfound/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 + verb: "check" + shell: runs-on: "ubuntu-latest" steps: diff --git a/action.yml b/action.yml index e8b25f6..11508a2 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: required: false default: "--progress plain" verb: - description: "CLI verb (call, run, download, up, functions, shell, query)" + description: "CLI verb (checks, call, run, download, up, functions, shell, query)" required: false default: "call" workdir: @@ -45,6 +45,10 @@ inputs: description: "Function and arguments for dagger shell" required: false default: "" + check: + description: "Function and arguments for dagger checks" + required: false + default: "" summary-path: description: "File path to write the job summary" required: false @@ -114,6 +118,8 @@ runs: shell=$(echo '${{ toJSON(inputs.shell) }}' | jq -rj .) if [[ -n "${{ inputs.call }}" ]]; then verb="call" + elif [[ -n "${{ inputs.check }}" ]]; then + verb="check" elif [[ "$shell" != "" ]]; then verb="" script=$(mktemp) From 244a5e8d090c9748924faf213c8bd1af39c373fa Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 12:25:52 -0500 Subject: [PATCH 02/12] enable calling dagger with check and pass check args through Signed-off-by: kpenfound --- README.md | 12 ++++++++++++ action.yml | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ab75ff1..a8337c1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,17 @@ ## Usage Examples +### `dagger check` + +```yaml +- name: Hello + uses: dagger/dagger-for-github@v8.2.0 + with: + module: github.com/shykes/daggerverse/hello + check: "**" + version: "latest" # semver vX.Y.Z +``` + ### `dagger call` ```yaml @@ -55,6 +66,7 @@ By setting the version to `latest`, this action will install the latest version | `args` | Arguments to pass to CLI | false | '' | | `call` | Arguments to pass to CLI (Alias for args with verb:call) | false | '' | | `shell` | Arguments to pass to CLI (Alias for args with verb:shell) | false | '' | +| `check` | Arguments to pass to CLI (Alias for args with verb:check) | false | '' | | `summary-path` | File path to write the job summary to | false | '' | | `enable-github-summary` | Whether to automatically write a GitHub Actions job summary | false | 'false' | diff --git a/action.yml b/action.yml index 11508a2..d2faff3 100644 --- a/action.yml +++ b/action.yml @@ -46,7 +46,7 @@ inputs: required: false default: "" check: - description: "Function and arguments for dagger checks" + description: "Function and arguments for dagger check" required: false default: "" summary-path: @@ -109,7 +109,7 @@ runs: echo "::endgroup::" - id: assemble - if: inputs.call != '' || inputs.shell != '' || inputs.args != '' + if: inputs.call != '' || inputs.shell != '' || inputs.args != '' || inputs.check != '' shell: bash env: INPUT_MODULE: ${{ inputs.module }} @@ -128,12 +128,12 @@ runs: echo "script=$script" >> "$GITHUB_OUTPUT" echo "verb=$verb" >> "$GITHUB_OUTPUT" - id: exec - if: inputs.call != '' || inputs.shell != '' || inputs.args != '' + if: inputs.call != '' || inputs.shell != '' || inputs.args != '' || inputs.check != '' shell: bash env: INPUT_MODULE: ${{ inputs.module }} VERB: ${{ steps.assemble.outputs.verb }} - CMD: ${{ inputs.args || inputs.call || steps.assemble.outputs.script }} + CMD: ${{ inputs.args || inputs.call || steps.assemble.outputs.script || inputs.check }} SCRIPT: ${{ steps.assemble.outputs.script }} run: | tmpout=$(mktemp) @@ -142,9 +142,9 @@ runs: DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \ dagger \ ${{ inputs.dagger-flags }} \ - ${{ steps.assemble.outputs.verb }} \ + ${VERB} \ ${INPUT_MODULE:+-m $INPUT_MODULE} \ - ${{ inputs.args || inputs.call || steps.assemble.outputs.script }}; } 1> >(tee "${tmpout}") 2> >(tee "${tmperr}" >&2) + ${CMD}; } 1> >(tee "${tmpout}") 2> >(tee "${tmperr}" >&2) { # we need a delim that doesn't appear in the output - a hash of the From e4448c9096a66f4b3f923ae77b870d7ba6889626 Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 12:40:50 -0500 Subject: [PATCH 03/12] checkout the repo with checks in it Signed-off-by: kpenfound --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4476010..71a7f61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -239,17 +239,22 @@ jobs: check: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + repository: "github.com/kpenfound/dag" + ref: "3ea64a3711c2d785db3133dd380ae74ac1440f79" - name: "Test check" uses: ./ with: module: github.com/kpenfound/dag/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 check: "**" + workdir: "./hello" - name: "Test check" uses: ./ with: module: github.com/kpenfound/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 verb: "check" + workdir: "./hello" shell: runs-on: "ubuntu-latest" From 06c374053d5197079acbd9754c97edb4b83d580d Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 12:41:23 -0500 Subject: [PATCH 04/12] fix checkout repo format Signed-off-by: kpenfound --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 71a7f61..287bc72 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -241,7 +241,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - repository: "github.com/kpenfound/dag" + repository: "kpenfound/dag" ref: "3ea64a3711c2d785db3133dd380ae74ac1440f79" - name: "Test check" uses: ./ From 010a17ca14f991156912c3a2093e3d758eebd5d5 Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 12:42:35 -0500 Subject: [PATCH 05/12] we still need to checkout the action Signed-off-by: kpenfound --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 287bc72..b7bba9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -239,22 +239,24 @@ jobs: check: runs-on: "ubuntu-latest" steps: + - uses: actions/checkout@v4 - uses: actions/checkout@v6 with: repository: "kpenfound/dag" ref: "3ea64a3711c2d785db3133dd380ae74ac1440f79" + path: "./dag" - name: "Test check" uses: ./ with: module: github.com/kpenfound/dag/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 check: "**" - workdir: "./hello" + workdir: "./dag/hello" - name: "Test check" uses: ./ with: module: github.com/kpenfound/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 verb: "check" - workdir: "./hello" + workdir: "./dag/hello" shell: runs-on: "ubuntu-latest" From fd87c3cd18b5bd2d1285875d7a4ae25222abaab3 Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 13:08:24 -0500 Subject: [PATCH 06/12] dont use check with -m Signed-off-by: kpenfound --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7bba9b..541d9f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -248,13 +248,11 @@ jobs: - name: "Test check" uses: ./ with: - module: github.com/kpenfound/dag/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 check: "**" workdir: "./dag/hello" - name: "Test check" uses: ./ with: - module: github.com/kpenfound/hello@3ea64a3711c2d785db3133dd380ae74ac1440f79 verb: "check" workdir: "./dag/hello" From bb3e3822a6745056a0b5f6170e828a999fe4bea5 Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 13:21:48 -0500 Subject: [PATCH 07/12] enable summary for check test Signed-off-by: kpenfound --- .github/workflows/test.yml | 1 + action.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 541d9f4..2d196fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -250,6 +250,7 @@ jobs: with: check: "**" workdir: "./dag/hello" + enable-github-summary: true - name: "Test check" uses: ./ with: diff --git a/action.yml b/action.yml index 3a36ea6..9e21203 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: required: false default: "--progress plain" verb: - description: "CLI verb (checks, call, run, download, up, functions, shell, query)" + description: "CLI verb (check, call, run, download, up, functions, shell, query)" required: false default: "call" workdir: @@ -121,7 +121,7 @@ runs: call=$(echo '${{ toJSON(inputs.call) }}' | jq -rj .) if [[ -n "${{ inputs.call }}" ]]; then verb="call" - elif [[ -n "${{ inputs.check }}" ]]; then + elif [[ "${{ inputs.check }}" != "" ]]; then verb="check" elif [[ "$shell" != "" ]]; then verb="" From e606120874624cb1119e0b68a4f392dbb322587b Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 13:42:05 -0500 Subject: [PATCH 08/12] simplify should-run conditionals Signed-off-by: kpenfound --- action.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 9e21203..a8ddf3d 100644 --- a/action.yml +++ b/action.yml @@ -108,8 +108,19 @@ runs: BIN_DIR=${prefix_dir}/bin DAGGER_VERSION="$VERSION" DAGGER_COMMIT="$COMMIT" sh echo "::endgroup::" + - id: should-exec + shell: bash + run: | + # Determine if the user wants to execute a dagger command or just install + if [[ -n "${{ inputs.call }}" ]] || \ + [[ -n "${{ inputs.shell }}" ]] || \ + [[ -n "${{ inputs.args }}" ]] || \ + [[ -n "${{ inputs.check }}" ]] || \ + [[ "${{ inputs.verb }}" != "call" ]]; then + echo "result=true" >> "$GITHUB_OUTPUT" + fi - id: assemble - if: inputs.call != '' || inputs.shell != '' || inputs.args != '' || inputs.check != '' + if: steps.should-exec.outputs.result == 'true' shell: bash env: INPUT_MODULE: ${{ inputs.module }} @@ -119,10 +130,13 @@ runs: dagger_flags=$(echo '${{ toJSON(inputs.dagger-flags) }}' | jq -rj .) args=$(echo '${{ toJSON(inputs.args) }}' | jq -rj .) call=$(echo '${{ toJSON(inputs.call) }}' | jq -rj .) + check=$(echo '${{ toJSON(inputs.check) }}' | jq -rj .) if [[ -n "${{ inputs.call }}" ]]; then verb="call" - elif [[ "${{ inputs.check }}" != "" ]]; then + elif [[ -n "$check" ]]; then verb="check" + # check input is used as a trigger; don't pass glob patterns as args + check="" elif [[ "$shell" != "" ]]; then verb="" script=$(mktemp) @@ -133,13 +147,14 @@ runs: echo "dagger-flags=$dagger_flags" >> "$GITHUB_OUTPUT" echo "args=$args" >> "$GITHUB_OUTPUT" echo "call=$call" >> "$GITHUB_OUTPUT" + echo "check=$check" >> "$GITHUB_OUTPUT" - id: exec - if: inputs.call != '' || inputs.shell != '' || inputs.args != '' || inputs.check != '' + if: steps.should-exec.outputs.result == 'true' shell: bash env: INPUT_MODULE: ${{ inputs.module }} VERB: ${{ steps.assemble.outputs.verb }} - CMD: ${{ steps.assemble.outputs.args || steps.assemble.outputs.call || steps.assemble.outputs.script || inputs.check }} + CMD: ${{ steps.assemble.outputs.args || steps.assemble.outputs.call || steps.assemble.outputs.script || steps.assemble.outputs.check }} SCRIPT: ${{ steps.assemble.outputs.script }} run: | tmpout=$(mktemp) From e977b0a3cff144104d68cc6ed8ebcb83e5cd7383 Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 13:44:30 -0500 Subject: [PATCH 09/12] safely quote inputs to check if they are set Signed-off-by: kpenfound --- action.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index a8ddf3d..4fa24fc 100644 --- a/action.yml +++ b/action.yml @@ -110,13 +110,19 @@ runs: - id: should-exec shell: bash + env: + INPUT_CALL: ${{ inputs.call }} + INPUT_SHELL: ${{ inputs.shell }} + INPUT_ARGS: ${{ inputs.args }} + INPUT_CHECK: ${{ inputs.check }} + INPUT_VERB: ${{ inputs.verb }} run: | # Determine if the user wants to execute a dagger command or just install - if [[ -n "${{ inputs.call }}" ]] || \ - [[ -n "${{ inputs.shell }}" ]] || \ - [[ -n "${{ inputs.args }}" ]] || \ - [[ -n "${{ inputs.check }}" ]] || \ - [[ "${{ inputs.verb }}" != "call" ]]; then + if [[ -n "$INPUT_CALL" ]] || \ + [[ -n "$INPUT_SHELL" ]] || \ + [[ -n "$INPUT_ARGS" ]] || \ + [[ -n "$INPUT_CHECK" ]] || \ + [[ "$INPUT_VERB" != "call" ]]; then echo "result=true" >> "$GITHUB_OUTPUT" fi - id: assemble From e67b29f4d6be05ee284a6df2e0fab3e33729b65e Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 13:51:17 -0500 Subject: [PATCH 10/12] fix output test Signed-off-by: kpenfound --- action.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 4fa24fc..9434161 100644 --- a/action.yml +++ b/action.yml @@ -160,7 +160,6 @@ runs: env: INPUT_MODULE: ${{ inputs.module }} VERB: ${{ steps.assemble.outputs.verb }} - CMD: ${{ steps.assemble.outputs.args || steps.assemble.outputs.call || steps.assemble.outputs.script || steps.assemble.outputs.check }} SCRIPT: ${{ steps.assemble.outputs.script }} run: | tmpout=$(mktemp) @@ -171,7 +170,7 @@ runs: ${{ steps.assemble.outputs.dagger-flags }} \ ${VERB} \ ${INPUT_MODULE:+-m $INPUT_MODULE} \ - ${CMD}; } 1> >(tee "${tmpout}") 2> >(tee "${tmperr}" >&2) + ${{ steps.assemble.outputs.args || steps.assemble.outputs.call || steps.assemble.outputs.script || steps.assemble.outputs.check }}; } 1> >(tee "${tmpout}") 2> >(tee "${tmperr}" >&2) { # we need a delim that doesn't appear in the output - a hash of the @@ -194,7 +193,7 @@ runs: summary_content(){ echo -e "## Command\n" echo '```bash' - cmd="dagger $VERB $CMD" + cmd="dagger $VERB ${{ steps.assemble.outputs.args || steps.assemble.outputs.call || steps.assemble.outputs.script || steps.assemble.outputs.check }}" if [[ -n "$INPUT_MODULE" ]]; then echo -e -E "DAGGER_MODULE=\"$INPUT_MODULE\" $cmd" else From d718c5c72eb7bc7a29edfad8608461cd46b9a1d1 Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 13:55:33 -0500 Subject: [PATCH 11/12] link to dagger/checks in readme Signed-off-by: kpenfound --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a8337c1..999e25b 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,20 @@ ```yaml - name: Hello - uses: dagger/dagger-for-github@v8.2.0 + uses: dagger/dagger-for-github@v8.3.0 with: module: github.com/shykes/daggerverse/hello check: "**" version: "latest" # semver vX.Y.Z ``` +Note: As a convenience for `dagger check` you can use the [dagger/checks](https://github.com/dagger/checks) action instead. + ### `dagger call` ```yaml - name: Hello - uses: dagger/dagger-for-github@v8.2.0 + uses: dagger/dagger-for-github@v8.3.0 with: module: github.com/shykes/daggerverse/hello call: hello --greeting Hola --name Jeremy @@ -29,7 +31,7 @@ ```yaml - name: Hello - uses: dagger/dagger-for-github@v8.2.0 + uses: dagger/dagger-for-github@v8.3.0 with: shell: container | from alpine | with-exec echo,"hello, world!" | stdout cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} @@ -39,7 +41,7 @@ ```yaml - name: Integration Test - uses: dagger/dagger-for-github@v8.2.0 + uses: dagger/dagger-for-github@v8.3.0 with: workdir: db-service verb: run From 8de9a04937173989013f6dff26bba4c639f1d88d Mon Sep 17 00:00:00 2001 From: kpenfound Date: Fri, 13 Feb 2026 14:16:43 -0500 Subject: [PATCH 12/12] remove module from check example. This is not valid Signed-off-by: kpenfound --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 999e25b..92d79a9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ - name: Hello uses: dagger/dagger-for-github@v8.3.0 with: - module: github.com/shykes/daggerverse/hello check: "**" version: "latest" # semver vX.Y.Z ```