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

Have github actions automatically push PR autofixes #3528

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ concurrency:
jobs:
# Jobs are listed in rough order of priority: if multiple jobs fail, the first job
# in the list should be the one that's most worth looking into
autofix:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '11'
buildcmd: |
set -eux;
git fetch --unshallow;
git commit --allow-empty -am 'Github Actions Autofix; please use "git push -f" next time you push to this PR';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
git commit --allow-empty -am 'Github Actions Autofix; please use "git push -f" next time you push to this PR';
git commit --allow-empty -am 'Github Actions Autofix; please use "git push --force-with-lease" next time you push to this PR';

git push "[email protected]:${{ github.event.pull_request.head.repo.full_name }}.git" HEAD:${{ github.head_ref }}
populate_cache: true

build-linux:
uses: ./.github/workflows/run-mill-action.yml
with:
Expand Down
68 changes: 34 additions & 34 deletions scalalib/src/mill/scalalib/Dependency.scala
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
package mill.scalalib
package mill.scalalib

import mill.T
import mill.define.{Command, Discover, ExternalModule}
import mill.eval.Evaluator
import mill.scalalib.dependency.{DependencyUpdatesImpl, Format}
import mill.scalalib.dependency.updates.ModuleDependenciesUpdates
import mill.T
import mill.define.{Command, Discover, ExternalModule}
import mill.eval.Evaluator
import mill.scalalib.dependency.{DependencyUpdatesImpl, Format}
import mill.scalalib.dependency.updates.ModuleDependenciesUpdates

object Dependency extends ExternalModule {
object Dependency extends ExternalModule {

/** Calculate possible dependency updates. */
def updates(
ev: Evaluator,
allowPreRelease: Boolean = false
): Command[Seq[ModuleDependenciesUpdates]] =
T.command {
DependencyUpdatesImpl(
ev,
implicitly,
ev.rootModule,
ev.rootModule.millDiscover,
allowPreRelease
)
}
/** Calculate possible dependency updates. */
def updates(
ev: Evaluator,
allowPreRelease: Boolean = false
): Command[Seq[ModuleDependenciesUpdates]] =
T.command {
DependencyUpdatesImpl(
ev,
implicitly,
ev.rootModule,
ev.rootModule.millDiscover,
allowPreRelease
)
}

/** Show possible dependency updates. */
def showUpdates(
ev: Evaluator,
allowPreRelease: Boolean = false,
format: Format = Format.PerModule
): Command[Unit] = T.command {
DependencyUpdatesImpl.showAllUpdates(updates(ev, allowPreRelease)(), format)
}
/** Show possible dependency updates. */
def showUpdates(
ev: Evaluator,
allowPreRelease: Boolean = false,
format: Format = Format.PerModule
): Command[Unit] = T.command {
DependencyUpdatesImpl.showAllUpdates(updates(ev, allowPreRelease)(), format)
}

@deprecated("Use other overload instead", "Mill after 0.11.6")
def showUpdates(ev: Evaluator, allowPreRelease: Boolean): Command[Unit] =
Dependency.showUpdates(ev, allowPreRelease, Format.PerModule)
@deprecated("Use other overload instead", "Mill after 0.11.6")
def showUpdates(ev: Evaluator, allowPreRelease: Boolean): Command[Unit] =
Dependency.showUpdates(ev, allowPreRelease, Format.PerModule)

lazy val millDiscover: Discover = Discover[this.type]
}
lazy val millDiscover: Discover = Discover[this.type]
}
Loading