Skip to content

Conversation

@escii
Copy link

@escii escii commented Jun 30, 2025

This PR introduces a new boolean input, soft-fail-version-check, which defaults to false. When set to true, the action will:

  • Emit a warning instead of throwing an error when the requested Swift version isn’t found in the list of tested versions.
  • Attempt to download/install the exact version string provided

This makes it possible to consume patch/minor releases (e.g. 6.1.1) as soon as they’re available upstream, without having to wait for the action’s static list to be updated. #743 #706 #683 #672

Changes:
action.yml

  • Added soft-fail-version-check input (default: false)

src/swift-versions.ts

  • Read soft-fail-version-check via core.getInput(...)
  • In verify(...), replace the hard error on missing version with:
if (softFailVersionCheck) {
  core.warning(
    `Swift version "${version}" not in the list of tested versions; proceeding anyway because soft-fail-version-check is enabled.`
  );
  return version;
}
throw new Error(`Version "${version}" is not available`);

Tests:
Added a matrix job in our test workflow to verify all three behaviors:

  • Default (fails on unknown versions)
  • With soft-fail-version-check: true (warns and proceeds)
  • With soft-fail-version-check: true (warns and proceeds) but then fails because the version 6.1.6 does not exist.

You can see the matrix runs here:
https://github.com/sonderformat-llc/setup-swift-test/actions/runs/15975074977

@escii escii marked this pull request as ready for review June 30, 2025 14:28
@Aaron-Ritter
Copy link

@fwal what do you think about this workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants