diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f996800..0b52fb7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,6 +25,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v6 + with: + ref: ${{ github.event.repository.default_branch }} - name: Check for latest id: save-var @@ -43,12 +45,14 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v6 + with: + ref: ${{ github.event.repository.default_branch }} - name: Create server folder run: mkdir server - name: Get previous version - run: echo "PREVIOUS_VERSION=$(curl -sSL "https://piston-meta.mojang.com/mc/game/version_manifest.json" | jq -cr '[.versions[] | select(.type == "release")] [1] .id')" >> $GITHUB_ENV + run: echo "PREVIOUS_VERSION=$(curl -sSL "https://piston-meta.mojang.com/mc/game/version_manifest.json" | jq -r --arg target "${{ github.event.inputs.VERSION }}" '[.versions[] | select(.type == "release") | .id] | index($target) as $idx | if $idx then .[$idx + 1] else empty end')" >> $GITHUB_ENV - name: Start server for world creation run: docker run --rm --name mc -e EULA=TRUE -e UID="$(id -u)" -e VERSION=${{ github.event.inputs.VERSION }} -e ENABLE_AUTOSTOP=TRUE -e AUTOSTOP_TIMEOUT_INIT=5 -e MEMORY=8G -v ./server:/data itzg/minecraft-server:latest --forceUpgrade