-
Notifications
You must be signed in to change notification settings - Fork 561
feat(run-digger-action): add digger-version input #2283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
motatoes
merged 15 commits into
diggerhq:develop
from
sidpalas:sp/add-digger-version-input
Oct 7, 2025
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2055d5d
feat(run-digger-action): allow specifying digger version explicitly
sidpalas 8bd1383
fix double quote comparison
sidpalas 835c56d
balance parens
sidpalas 0f2d4bb
use ${{ env.DIGGER_VERSION }} so version shows in script
sidpalas 77d199c
skip go toolchain steps
sidpalas c3a692a
clarify binary conditions
sidpalas 0f9e748
add comments for each mode
sidpalas 507fdb0
Merge branch 'develop' into sp/add-digger-version-input
sidpalas e3502d9
update versioning docs
sidpalas 4847dad
use bash ${VAR} instead of ${{env.VAR}}
sidpalas 8c85a77
validate digger-version input
sidpalas a13a6db
Merge branch 'develop' into sp/add-digger-version-input
sidpalas 7e4f6d2
make description more explicit
sidpalas 5ae0c2d
fix variable reference
sidpalas 445b488
Merge branch 'develop' into sp/add-digger-version-input
sidpalas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,6 +232,10 @@ inputs: | |
| description: "(orchestrator only) the spec to pass onto digger cli" | ||
| required: false | ||
| default: "" | ||
| digger-version: | ||
| description: "Version of digger CLI to install. Overrides the version derived from the actionref" | ||
| required: false | ||
| default: "" | ||
|
|
||
| outputs: | ||
| output: | ||
|
|
@@ -257,7 +261,7 @@ runs: | |
| exit 1 | ||
| shell: bash | ||
| if: inputs.setup-google-cloud == 'true' | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
| with: | ||
| clean: false | ||
| ref: refs/pull/${{ github.event.issue.number }}/merge | ||
|
|
@@ -396,15 +400,15 @@ runs: | |
| with: | ||
| go-version-file: "${{ github.action_path }}/cli/go.mod" | ||
| cache: false | ||
| if: ${{ !startsWith(github.action_ref, 'v') }} | ||
| if: ${{ inputs.digger-version == '' && !startsWith(github.action_ref, 'v') }} | ||
|
|
||
| - name: Determine Golang cache paths | ||
| id: golang-env | ||
| run: | | ||
| echo "build-cache-path=$(go env GOCACHE)" >>"$GITHUB_OUTPUT" | ||
| echo "module-cache-path=$(go env GOMODCACHE)" >>"$GITHUB_OUTPUT" | ||
| shell: bash | ||
| if: ${{ !startsWith(github.action_ref, 'v') }} | ||
| if: ${{ inputs.digger-version == '' && !startsWith(github.action_ref, 'v') }} | ||
|
|
||
| - name: Copy Digger CLI go.sum for cache key | ||
| run: | | ||
|
|
@@ -416,7 +420,7 @@ runs: | |
| cp "$GITHUB_ACTION_PATH/cli/go.sum" "$GITHUB_WORKSPACE/.digger.go.sum" | ||
| fi | ||
| shell: bash | ||
| if: ${{ !startsWith(github.action_ref, 'v') }} | ||
| if: ${{ inputs.digger-version == '' && !startsWith(github.action_ref, 'v') }} | ||
|
|
||
| - name: Adding required env vars for next step | ||
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | ||
|
|
@@ -434,7 +438,7 @@ runs: | |
| shell: bash | ||
|
|
||
| - name: build and run digger | ||
| if: ${{ !startsWith(github.action_ref, 'v') && inputs.local-dev-mode == 'false' }} | ||
| if: ${{ inputs.digger-version == '' && !startsWith(github.action_ref, 'v') && inputs.local-dev-mode == 'false' }} | ||
| shell: bash | ||
| env: | ||
| PLAN_UPLOAD_DESTINATION: ${{ inputs.upload-plan-destination }} | ||
|
|
@@ -486,9 +490,9 @@ runs: | |
| digger | ||
|
|
||
| - name: run digger | ||
| if: ${{ startsWith(github.action_ref, 'v') && inputs.local-dev-mode == 'false' }} | ||
| if: ${{( inputs.digger-version != '' || startsWith(github.action_ref, 'v')) && inputs.local-dev-mode == 'false' }} | ||
| env: | ||
| actionref: ${{ github.action_ref }} | ||
| DIGGER_VERSION: ${{ inputs.digger-version || github.action_ref }} | ||
| PLAN_UPLOAD_DESTINATION: ${{ inputs.upload-plan-destination }} | ||
| PLAN_UPLOAD_S3_ENCRYPTION_ENABLED: ${{ inputs.upload-plan-destination-s3-encryption-enabled }} | ||
| PLAN_UPLOAD_S3_ENCRYPTION_TYPE: ${{ inputs.upload-plan-destination-s3-encryption-type }} | ||
|
|
@@ -525,16 +529,16 @@ runs: | |
| set -euo pipefail | ||
|
|
||
| echo "🔧 Downloading Digger CLI..." | ||
| echo "Runner OS: ${{ runner.os }}, Arch: ${{ runner.arch }}, Action Ref: ${actionref}" | ||
| echo "Runner OS: ${{ runner.os }}, Arch: ${{ runner.arch }}, Digger Version: ${{ env.DIGGER_VERSION }}" | ||
|
|
||
| if [[ ${{ inputs.ee }} == "true" ]]; then | ||
| if [[ ${{ inputs.fips }} == "true" ]]; then | ||
| DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}-fips" | ||
| DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${{ env.DIGGER_VERSION }}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}-fips" | ||
| else | ||
| DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}" | ||
| DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${{ env.DIGGER_VERSION }}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}" | ||
| fi | ||
| else | ||
| DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-cli-${{ runner.os }}-${{ runner.arch }}" | ||
| DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${{ env.DIGGER_VERSION }}/digger-cli-${{ runner.os }}-${{ runner.arch }}" | ||
| fi | ||
|
|
||
| echo "Downloading from: $DOWNLOAD_URL" | ||
|
|
@@ -543,12 +547,12 @@ runs: | |
| echo "Failed to download Digger CLI from $DOWNLOAD_URL" | ||
| echo "" | ||
| echo "Possible reasons:" | ||
| echo "1. The release ${actionref} might not exist" | ||
| echo "1. The release ${{ env.DIGGER_VERSION }} might not exist" | ||
| echo "2. Binary for ${{ runner.os }}-${{ runner.arch }} might not be available" | ||
| echo "3. Network connectivity issues" | ||
| echo "" | ||
| echo "Suggestions:" | ||
| echo "- Check if release ${actionref} exists at: https://github.com/diggerhq/digger/releases" | ||
| echo "- Check if release ${{ env.DIGGER_VERSION }} exists at: https://github.com/diggerhq/digger/releases" | ||
| echo "- Verify the architecture combination is supported" | ||
| echo "- Try using a different release version" | ||
| exit 1 | ||
|
|
@@ -574,7 +578,7 @@ runs: | |
| - name: run digger in local dev mode | ||
| if: ${{ inputs.local-dev-mode == 'true' }} | ||
| env: | ||
| actionref: ${{ github.action_ref }} | ||
| DIGGER_VERSION: ${{ github.action_ref }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated here for consistency, but I don't actually think this gets used... |
||
| PLAN_UPLOAD_DESTINATION: ${{ inputs.upload-plan-destination }} | ||
| PLAN_UPLOAD_S3_ENCRYPTION_ENABLED: ${{ inputs.upload-plan-destination-s3-encryption-enabled }} | ||
| PLAN_UPLOAD_S3_ENCRYPTION_TYPE: ${{ inputs.upload-plan-destination-s3-encryption-type }} | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a drive by fix for one action I missed in #2277