Skip to content

Pin version opt#266

Merged
csasarak merged 20 commits intomainfrom
pin-version-opt
Feb 5, 2026
Merged

Pin version opt#266
csasarak merged 20 commits intomainfrom
pin-version-opt

Conversation

@csasarak
Copy link
Contributor

@csasarak csasarak commented Feb 5, 2026

Overview

Allow specifying a CLI version in our fossa-action.

Checklist

  • If I changed code, I ran yarn build and committed resulting changes.
  • I added an example exercising this PRs functionality to .github/workflows/test.yml or explained why it doesn't make sense to do so.

Important

After merging, make sure to create a new GitHub release and associated tag for this release.
You can either create the tag locally and then create a corresponding GitHub release,
or just create both the tag and release using the GitHub Release UI.

Additionally, if this is not a breaking change, make sure to update the v1 tag:

# Check out the tag you want to set as `v1`.
git checkout $TAG

# Delete and re-create the `v1` tag.
git tag -d v1 && git push origin :refs/tags/v1 && git tag v1 && git push origin tag v1

@csasarak csasarak requested a review from a team as a code owner February 5, 2026 19:29
@csasarak csasarak requested a review from tjugdev February 5, 2026 19:29
let selectedCliVersion: string;

if (PINNED_CLI_VERSION) {
const trimmed = PINNED_CLI_VERSION.trimStart();
Copy link

Choose a reason for hiding this comment

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

Suggested change
const trimmed = PINNED_CLI_VERSION.trimStart();
const trimmed = PINNED_CLI_VERSION.trim();

Probably want to trim trailing spaces too, no?

debug(`Fetching new FOSSA version`);

if (await exec('bash', [installer, '-b', './fossa'], {...defaultOptions}) !== 0) {
const versionArgs = (selectedCliVersion !== '-1' && [selectedCliVersion]) || [];
Copy link

Choose a reason for hiding this comment

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

How very bash-y

Suggested change
const versionArgs = (selectedCliVersion !== '-1' && [selectedCliVersion]) || [];
const versionArgs = selectedCliVersion !== '-1' ? [selectedCliVersion] : [];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes when you get in that head-space it's hard to jump back out...

@csasarak csasarak enabled auto-merge (squash) February 5, 2026 21:41
@csasarak csasarak merged commit c414b9a into main Feb 5, 2026
2 checks passed
@csasarak csasarak deleted the pin-version-opt branch February 5, 2026 21:43
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