diff --git a/.github/workflows/autofix-push.yml b/.github/workflows/autofix-push.yml index d3902ae1abf..37324e69094 100644 --- a/.github/workflows/autofix-push.yml +++ b/.github/workflows/autofix-push.yml @@ -12,29 +12,12 @@ jobs: env: REPO_DEPLOY_KEY: ${{ secrets.REPO_DEPLOY_KEY }} steps: - # - uses: dawidd6/action-download-artifact@v7 - # with: - # run_id: ${{ github.event.workflow_run.id }} - # workflow_conclusion: "" - # name: autofix-artifacts + - uses: dawidd6/action-download-artifact@v7 + with: + run_id: ${{ github.event.workflow_run.id }} + workflow_conclusion: "" + name: autofix-artifacts - # - run: "chmod -R 777 ." - # - run: cat .autofix-repo - # - run: cat .autofix-branch - - uses: actions/checkout@v4 - with: {fetch-depth: 0} - - run: > - ci/publish-docs.sh - # if git diff --quiet HEAD~1; then - # echo "The latest commit is empty (no changes)." - # else - # git show - - # echo $REPO_DEPLOY_KEY | base64 --decode > deploy_key + - run: "chmod -R 777 ." - # eval "$(ssh-agent -s)" - # chmod 600 deploy_key - # ssh-add deploy_key - # rm deploy_key - # git push git@github.com:com-lihaoyi/mill.git HEAD:test-autofix-branch - # fi + - run: ci/push-autofix.sh diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 6028d68e1e4..0ff8bf3c477 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -6,6 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - run: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/ - run: git clean -xdf @@ -15,8 +16,8 @@ jobs: - run: echo "git@github.com:${{ github.event.pull_request.head.repo.full_name }}.git" - run: echo ${{ github.event.pull_request.head.ref }} - - run: echo "git@github.com:${{ github.event.pull_request.head.repo.full_name }}.git" > .autofix-repo - - run: echo HEAD:${{ github.event.pull_request.head.ref }} > .autofix-branch + - run: echo -n "git@github.com:${{ github.event.pull_request.head.repo.full_name }}.git" > .autofix-repo + - run: echo -n HEAD:${{ github.event.pull_request.head.ref }} > .autofix-branch - uses: actions/upload-artifact@v4.5.0 diff --git a/ci/push-autofix.sh b/ci/push-autofix.sh new file mode 100755 index 00000000000..9aace175968 --- /dev/null +++ b/ci/push-autofix.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -eu + +# Prepare ssh-key for git actions +echo $REPO_DEPLOY_KEY | base64 --decode > deploy_key + +eval "$(ssh-agent -s)" +chmod 600 deploy_key +ssh-add deploy_key +rm deploy_key + +# Prepare git user +git config user.email "haoyi.sg+travis@gmail.com" +git config user.name "Mill GitHub Bot" + +cat .autofix-repo +cat .autofix-branch +# skip git hooks +git push --no-verify $(cat .autofix-repo) HEAD:$(cat .autofix-branch) \ No newline at end of file diff --git a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala index 06a70cc0af4..c1ffabbd4a9 100644 --- a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala +++ b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala @@ -15,7 +15,8 @@ import mill.scalalib.bsp.{ScalaBuildTarget, ScalaPlatform} import mill.T trait ScalaJSModule extends scalalib.ScalaModule { outer => - def scalaJSVersion: T[String] + // + def scalaJSVersion: T[String] trait ScalaJSTests extends ScalaTests with TestScalaJSModule { override def scalaJSVersion = outer.scalaJSVersion()