go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.26k stars 5.51k forks source link

Wrong working directory in gitea actions #26003

Closed why0why0why closed 1 year ago

why0why0why commented 1 year ago

Description

I run wsl2, docker desktop, act_runner 0.2.3 and gitea 1.20.0 on windows. When I try to run actions/checkout, the working directory shows as /mnt/d/C:/Users/xxxxx/.cache/act/xxxx/CICDtest, and it seems wrong.

There is my yaml file\:

name: Gitea Actions
run-name: test
on:
  push:
    branches:
      - main
  merge:
    branches:
      - main
jobs:
  test:
    runs-on: ubuntu-ostl
    steps:
      - name: Check out with submodules
        uses: https://gitea.com/actions/checkout@v3
        with:
          token: "${{ secrets.PAT_SUBMODULES }}"
          submodules: recursive
      - name: build
        run: |
          chmod 777 ./build_sh/build.sh
          ./build_sh/build.sh stm32mp157a-dtu-core
      - name: release
        run: |
          cd FIP_artifacts
          ls
          cd fip
          ls
          cd ../arm-trusted-firmware
          ls

The ubuntu-ostl label is a container made by this:

FROM node:16-bullseye
ADD 4.0.4-openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23.tar.gz /opt/st/stm32mp1/

The actions log\:

::save-state name=isPost::true
::add-matcher::/run/act/actions/https---gitea.com-actions-checkout@v3/dist/problem-matcher.json
Syncing repository: xxxxx/CICDtest
::group::Getting Git version info
Working directory is '/mnt/d/C:/Users/xxxxx/.cache/act/xxxxx/CICDtest'
[command]/usr/bin/git version
git version 2.30.2
::endgroup::

The actions log of gitea 1.19.4\:

::save-state name=isPost::true
::add-matcher::/run/act/actions/actions-checkout@v3/dist/problem-matcher.json
Syncing repository: xxxxxx/CICDtest
::group::Getting Git version info
Working directory is '/mnt/d/workspace/xxxxxx/CICDtest'
[command]/usr/bin/git version
git version 2.30.2
::endgroup::

Gitea Version

1.20.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Windows 10

How are you running Gitea?

Download from github release

Database

SQLite

he0119 commented 1 year ago

After I upgrade act_runner to version 0.2.5, It works for me.

act_runner 0.2.3 with gitea 1.20.3

::add-matcher::/run/act/actions/actions-checkout@v3/dist/problem-matcher.json
Syncing repository: he0119/tailscale-acls
::group::Getting Git version info
Working directory is '/root/.cache/act/he0119/tailscale-acls'

act_runner 0.2.5 with gitea 1.20.3

::add-matcher::/run/act/actions/actions-checkout@v3/dist/problem-matcher.json
Syncing repository: he0119/tailscale-acls
::group::Getting Git version info
Working directory is '/workspace/he0119/tailscale-acls'
why0why0why commented 1 year ago

@he0119 It seems that your platform is linux but mine is windows. However, I just try again after upgrade act_runner to 0.2.5 and gitea to 1.20.3. It works now. Thanks a lot.

Maybe this bug has been fixed by act_runner#279.