diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d8bb4d..9045411 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,8 +31,10 @@ jobs: shell: bash run: git config --global core.autocrlf false - - name: Checkout current branch (fast) + - name: Checkout current branch (full) uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Java and Scala uses: olafurpg/setup-scala@v5 @@ -110,8 +112,10 @@ jobs: if: contains(runner.os, 'windows') run: git config --global core.autocrlf false - - name: Checkout current branch (fast) + - name: Checkout current branch (full) uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Java and Scala uses: olafurpg/setup-scala@v5 diff --git a/src/main/scala/sbtghactions/GenerativePlugin.scala b/src/main/scala/sbtghactions/GenerativePlugin.scala index cb19235..20ec9a2 100644 --- a/src/main/scala/sbtghactions/GenerativePlugin.scala +++ b/src/main/scala/sbtghactions/GenerativePlugin.scala @@ -547,7 +547,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}""" } autoCrlfOpt ::: List( - WorkflowStep.Checkout, + WorkflowStep.CheckoutFull, WorkflowStep.SetupScala) ::: githubWorkflowGeneratedCacheSteps.value.toList }, diff --git a/src/main/scala/sbtghactions/WorkflowStep.scala b/src/main/scala/sbtghactions/WorkflowStep.scala index 59150ac..ba6e32d 100644 --- a/src/main/scala/sbtghactions/WorkflowStep.scala +++ b/src/main/scala/sbtghactions/WorkflowStep.scala @@ -25,7 +25,11 @@ sealed trait WorkflowStep extends Product with Serializable { object WorkflowStep { - val CheckoutFull: WorkflowStep = Use("actions", "checkout", "v1", name = Some("Checkout current branch (full)")) + val CheckoutFull: WorkflowStep = Use( + "actions", "checkout", "v2", + name = Some("Checkout current branch (full)"), + params = Map("fetch-depth" -> "0")) + val Checkout: WorkflowStep = Use("actions", "checkout", "v2", name = Some("Checkout current branch (fast)")) val SetupScala: WorkflowStep = Use("olafurpg", "setup-scala", "v5", name = Some("Setup Java and Scala"), params = Map("java-version" -> s"$${{ matrix.java }}")) diff --git a/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml b/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml index b987470..783dd4b 100644 --- a/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml +++ b/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml @@ -34,8 +34,10 @@ jobs: test: is runs-on: ${{ matrix.os }} steps: - - name: Checkout current branch (fast) + - name: Checkout current branch (full) uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Java and Scala uses: olafurpg/setup-scala@v5 @@ -109,8 +111,10 @@ jobs: java: [adopt@1.8] runs-on: ${{ matrix.os }} steps: - - name: Checkout current branch (fast) + - name: Checkout current branch (full) uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Java and Scala uses: olafurpg/setup-scala@v5 diff --git a/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml b/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml index 13b84fc..2d03b89 100644 --- a/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml +++ b/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml @@ -26,8 +26,10 @@ jobs: java: [adopt@1.8] runs-on: ${{ matrix.os }} steps: - - name: Checkout current branch (fast) + - name: Checkout current branch (full) uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Java and Scala uses: olafurpg/setup-scala@v5 @@ -98,8 +100,10 @@ jobs: java: [adopt@1.8] runs-on: ${{ matrix.os }} steps: - - name: Checkout current branch (fast) + - name: Checkout current branch (full) uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Java and Scala uses: olafurpg/setup-scala@v5