Skip to content
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

fix: organization license validation error #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

geloman-likes-rust
Copy link

@geloman-likes-rust geloman-likes-rust commented Nov 22, 2024

Closes #167

This changes fixes the gitleaks license required validation error in an organization-level repositories when ${{ secrets.GITLEAKS_LICENSE }} was not set.

- var shouldValidate = true;
+ var shouldValidate = false;

This conditional block in .finally block will not run when shouldValidate was set to false and thus fixes the issue #167.

  .finally(() => {
    // check if a gitleaks license is available, if not log error message
    if (shouldValidate && !process.env.GITLEAKS_LICENSE) {
      core.error(
        "🛑 missing gitleaks license. Go grab one at gitleaks.io and store it as a GitHub Secret named GITLEAKS_LICENSE. For more info about the recent breaking update, see [here](https://github.com/gitleaks/gitleaks-action#-announcement)."
      );
      process.exit(1);
    }

    start();
  });

The conditional logic shouldValidate && !process.env.GITLEAKS_LICENSE returns a non-zero exit code when GITLEAKS_LICENSE environment variable was empty or undefined in javascript.

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.

Gitleaks Action failing : Invalid Licence
1 participant