Skip to content

feat: support Chef community and Cinc installs#43

Open
damacus wants to merge 4 commits intomainfrom
codex/chef-community-cinc-support
Open

feat: support Chef community and Cinc installs#43
damacus wants to merge 4 commits intomainfrom
codex/chef-community-cinc-support

Conversation

@damacus
Copy link
Copy Markdown
Contributor

@damacus damacus commented Mar 20, 2026

Summary

  • default Chef installs to the Chef Community download API via a new chefDownloadUrl input
  • add a license input for Chef Community/Commercial downloads
  • keep omnitruckUrl as a compatibility override, which also preserves the Cinc install path
  • document Cinc omnibus usage and clarify that Cinc packages do not require a license
  • validate that the default Chef Community API is only used with the stable channel

Why

Omnitruck is no longer the right default path for Chef installs, but this action still needs to support Cinc and avoid breaking existing omnitruck-based consumers. This keeps the newer Chef download flow as the default while preserving omnitruckUrl precedence for backwards compatibility and Cinc.

Verification

  • parsed action.yml with Ruby YAML
  • ran git diff --check
  • did not run the action on a live GitHub runner

Notes

@damacus damacus added the Release: Major Release is a semver.org major label Mar 20, 2026
@damacus damacus requested review from Copilot, ramereth and xorima March 20, 2026 12:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the composite GitHub Action to support installing Chef via the Chef Community/Commercial download APIs (license-based) while also supporting Cinc installs via omnitruck-compatible endpoints, and updates the README accordingly.

Changes:

  • Adds chefDownloadUrl + license inputs and uses the Chef download API flow when license is provided.
  • Switches the non-license install path to download-and-validate the installer script before executing it (Linux/macOS + Windows).
  • Updates documentation to include Chef Community/Commercial usage and Cinc omnibus usage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
action.yml Adds new inputs and implements conditional Chef-download vs omnitruck install flows across Linux/macOS and Windows.
README.md Documents the new Chef download API flow (license-based) and the Cinc/omnitruck usage patterns and parameters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action.yml
Comment thread action.yml
Comment on lines +83 to +84
TEMP_SCRIPT="$(mktemp)"
TEMP_HEADERS="$(mktemp)"
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mktemp without a template is not portable to macOS/BSD (it errors with a usage message on many runners). Since this step targets Linux/macOS, use a portable form like mktemp -t <prefix>.XXXXXX (and/or place the temp files under $RUNNER_TEMP) to avoid failing on macOS.

Suggested change
TEMP_SCRIPT="$(mktemp)"
TEMP_HEADERS="$(mktemp)"
TEMP_SCRIPT="$(mktemp -t chef-install-script.XXXXXX)"
TEMP_HEADERS="$(mktemp -t chef-install-headers.XXXXXX)"

Copilot uses AI. Check for mistakes.
Comment thread action.yml
Comment on lines +106 to +115
case "$EFFECTIVE_URL" in
*"/${SCRIPT_SUFFIX}"* ) ;;
*)
echo "Installer download redirected to an unexpected URL: $EFFECTIVE_URL" >&2
if [ -n "$LICENSE" ]; then
echo "This usually means the supplied Chef license_id is missing or invalid." >&2
fi
exit 1
;;
esac
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The redirect validation only checks that the effective URL contains /${SCRIPT_SUFFIX}, but it does not ensure the redirect stays on the expected host ($CHEF_DOWNLOAD_URL / $OMNITRUCK_URL). A cross-domain redirect to a different host with the same path would pass this check.

Tighten the validation to require the effective URL to start with the expected base (e.g. https://${CHEF_DOWNLOAD_URL}/ or https://${OMNITRUCK_URL}/) in addition to the suffix/path check.

Copilot uses AI. Check for mistakes.
Comment thread action.yml
Comment on lines +198 to +204
if ($effectiveUrl -notlike "*/$scriptSuffix*") {
$message = "Installer download redirected to an unexpected URL: $effectiveUrl"
if ($env:LICENSE) {
$message += ". This usually means the supplied Chef license_id is missing or invalid."
}
throw $message
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows redirect validation ($effectiveUrl -notlike "*/$scriptSuffix*") only checks the path segment and doesn't ensure the redirect stayed on the expected host ($env:CHEF_DOWNLOAD_URL / $env:OMNITRUCK_URL). Tighten this to validate the effective URL begins with the expected base URL as well, to avoid accepting cross-domain redirects.

Copilot uses AI. Check for mistakes.
Comment thread action.yml
} else {
$installRoot = "C:\opscode\$installProject\"
}
"$($installRoot)bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windowsPath is treated as an install root and the code appends bin via string concatenation ("$($installRoot)bin"). If a user supplies a path without a trailing \ (e.g. C:\opscode\chef-workstation), the resulting PATH entry becomes invalid (...chef-workstationbin). Prefer Join-Path $installRoot "bin" and/or normalize $installRoot to include a trailing separator.

Suggested change
"$($installRoot)bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
(Join-Path -Path $installRoot -ChildPath "bin") | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

Copilot uses AI. Check for mistakes.
Comment thread action.yml
Comment on lines 10 to +27
project:
description: 'which chef project to install, chef-workstation or chefdk'
description: 'Which Chef or Cinc project to install'
required: false
default: 'chef-workstation'
default: 'cinc-workstation'
version:
description: 'Version to install. Defaults to latest for chef-workstation'
description: 'Version to install. Defaults to latest for workstation installs'
required: false
chefDownloadUrl:
description: 'Chef download base url'
required: false
default: 'chefdownload-community.chef.io'
license:
description: 'Chef Downloads license ID. Required for Chef Community/Commercial downloads; not used for Cinc.'
required: false
omnitruckUrl:
description: 'Omnitruck base url'
description: 'Deprecated: Omnitruck base url. Use for Cinc or other omnitruck-compatible endpoints.'
required: false
default: 'omnitruck.chef.io'
default: 'omnitruck.cinc.sh'
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the defaults to project: cinc-workstation and omnitruckUrl: omnitruck.cinc.sh changes the action’s behavior for consumers who rely on defaults (it will install Cinc instead of Chef). Given the PR goal of avoiding breaking existing consumers, consider keeping the previous Chef defaults (or making the new behavior opt-in) and documenting the breaking change/versioning expectations if this is intentional.

Copilot uses AI. Check for mistakes.
Comment thread README.md
Note you will need to accept the Chef license, you can find more information at <https://docs.chef.io/chef_license.html>
By default this action installs Cinc from `omnitruck.cinc.sh`. Chef installs use the
[Chef Community download API](https://docs.chef.io/download/community/) or the Chef commercial API
when you provide a `license_id`.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README says Chef installs use the commercial API when you provide a license_id, but the action input is named license (and license_id is only the query parameter passed to the download endpoint). To avoid confusion for users, align the docs to the actual input name (e.g. “provide license (Chef license_id)”).

Suggested change
when you provide a `license_id`.
when you provide the `license` input (Chef license_id).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release: Major Release is a semver.org major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants