Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ScaCap/action-ktlint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.0
Choose a base ref
...
head repository: ScaCap/action-ktlint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.8.1
Choose a head ref
  • 3 commits
  • 1 file changed
  • 4 contributors

Commits on Dec 19, 2023

  1. GHA: Copilot contributor check

    PlatformEngineering committed Dec 19, 2023
    Copy the full SHA
    c27e791 View commit details

Commits on Feb 6, 2024

  1. GHA: Copilot contributor check

    See ScaCap/terraform#13918 for more details.
    scalable-atlantis[bot] committed Feb 6, 2024
    Copy the full SHA
    104bf9c View commit details

Commits on Feb 29, 2024

  1. GH-48: fix ktlint version retrieval (#51)

    Co-authored-by: Ghais Zaher <[email protected]>
    guil-camp-scacap and ghaiszaher authored Feb 29, 2024
    Copy the full SHA
    38262d0 View commit details
Showing with 5 additions and 0 deletions.
  1. +5 −0 entrypoint.sh
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -34,10 +34,15 @@ git config --global --add safe.directory $GITHUB_WORKSPACE
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

ktlint_version=$(ktlint --version)
# In newer ktlint versions, the command `ktlint --version` returns "ktlint version x.y.z" and we need to remove "ktlint version " from the string
ktlint_version=${ktlint_version#"ktlint version "}

echo "ktlint version: $ktlint_version"

# ktlint_version > 0.49.1
if [ "$(printf '%s\n' "0.49.1" "$ktlint_version" | sort -V | head -n1)" = "0.49.1" ]; then
# --code-style is deprecated since 1.0.1 and .editorconfig needs to be used: https://pinterest.github.io/ktlint/latest/rules/code-styles/
# ktlint_version <= 1.0.0
if [ "$(printf '%s\n' "1.0.0" "$ktlint_version" | sort -V | tail -n1)" = "1.0.0" ]; then
if [ "$INPUT_ANDROID" = true ]; then
export ANDROID="--code-style=android_studio"