gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Actions: Checkout of self hosted repo with tag always results on main branch checkout

Open Fratee opened this issue 10 months ago • 4 comments

Description

act runner version: 0.2.10

The following job does not use the upload-artifact at the v3 tag, but instead uses the latest commit on the default branch. The actions/upload-artifact repository is hosted locally and correctly fetched by using DEFAULT_ACTIONS_URL=self in Gitea configuration.

jobs:
  upload:
    steps:
      - name: Create a file
        run: echo "hello world" > my-file.txt
      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          name: test-file
          path: my-file.txt

When trying to investigate the issue we found out that in the runner act cache the repository is called actions-upload-artifact@v3 but the content in our case was of the v4.

Launch command .\act_runner.exe daemon -c .\config.yaml.

config.yaml

cache:
  dir: D:\programs\runner\cache\actcache
host:
  workdir_parent: D:\programs\runner\cache\act

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.41.0.windows.1

Operating System

windows 10

How are you running Gitea?

self hosted

Database

SQLite

Fratee avatar Apr 17 '24 13:04 Fratee

Hmm, so you mirrored the actions/upload-artifact repo to your own instance, right? Do your mirror repo has any tag like v3.*?

wolfogre avatar Apr 22 '24 06:04 wolfogre

Hmm, so you mirrored the actions/upload-artifact repo to your own instance, right? Do your mirror repo has any tag like v3.*?

Yes, the repo has been mirrored from https://gitea.com/actions/upload-artifact complete of all tags. I've tried with different tags and what i noticed is that the repo in the runner cache has the correct folder name ending with the specified tag, but the content is always what is present on the main branch.

edit: I haven't used the mirror feature. My instance has no access to the internet so i cloned https://gitea.com/actions/upload-artifact with git clone --mirror and pushed it to the instance in the intranet, making sure to git push --tags as well. Indeed tags are present in the repo as i can see them from gitea UI and also if i clone the instance actions/upload-artifact repo.

Fratee avatar Apr 25 '24 09:04 Fratee

Hmm, so you mirrored the actions/upload-artifact repo to your own instance, right? Do your mirror repo has any tag like v3.*?

Yes, the repo has been mirrored from gitea.com/actions/checkout complete of all tags. I've tried with different tags and what i noticed is that the repo in the runner cache has the correct folder name ending with the specified tag, but the content is always what is present on the main branch.

edit: I haven't used the mirror feature. My instance has no access to the internet so i cloned gitea.com/actions/checkout with git clone --mirror and pushed it to the instance in the intranet, making sure to git push --tags as well. Indeed tags are present in the repo as i can see them from gitea UI and also if i clone the instance actions/upload-artifact repo.

You said you have mirrored actions/checkout but use it as actions/upload-artifact, is it just a typo or the truth?

I tried my best to reproduce, but it doesn't happen. Could you please clear the cache dir and try again? What are the detailed steps to reproduce it?

wolfogre avatar May 06 '24 08:05 wolfogre

@wolfogre oops that's a typo. I'm referring to upload-artifact. I've also cleared the cache. I'll try with a new instance when possible and let you know more detailed steps. Thanks

Fratee avatar May 06 '24 08:05 Fratee