Replace checkout action with git fetch in Gitea workflow
Some checks failed
Build Mod Package / build (push) Failing after 13s

This commit is contained in:
2026-04-07 23:29:46 +03:00
parent e89459fda6
commit bcc21cf2a1

View File

@@ -9,6 +9,9 @@ on:
- "v*" - "v*"
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: runs-on:
@@ -19,17 +22,29 @@ jobs:
shell: powershell shell: powershell
steps: steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare workspace - name: Prepare workspace
run: | run: |
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
$workspace = "${{ gitea.workspace }}"
$repoUrl = "${{ gitea.server_url }}/${{ gitea.repository }}.git"
$repoRef = "${{ gitea.ref }}"
$authPair = "${{ gitea.actor }}:${{ secrets.GITEA_TOKEN }}"
$authBytes = [System.Text.Encoding]::ASCII.GetBytes($authPair)
$authBasic = [Convert]::ToBase64String($authBytes)
if ($env:GITHUB_WORKSPACE -and (Test-Path -LiteralPath $env:GITHUB_WORKSPACE)) { New-Item -ItemType Directory -Path $workspace -Force | Out-Null
Set-Location $env:GITHUB_WORKSPACE Set-Location $workspace
if (-not (Test-Path -LiteralPath ".git")) {
git init | Out-Null
git remote add origin $repoUrl
} else {
git remote set-url origin $repoUrl
} }
git -c "http.extraHeader=Authorization: Basic $authBasic" fetch --depth 1 origin $repoRef
git checkout --force FETCH_HEAD
if (-not (Test-Path -LiteralPath "Mods\\DnD55eRussian\\Localization\\Russian\\russian.xml")) { if (-not (Test-Path -LiteralPath "Mods\\DnD55eRussian\\Localization\\Russian\\russian.xml")) {
throw "Repository sources are not available in the runner workspace." throw "Repository sources are not available in the runner workspace."
} }