Closed oilrich25 closed 11 months ago
Using https://gitea.com/gitea/act_runner
, it successfully uploaded release
serverUrl is: http://192.168.1.10:3000
token is: ***
client is: GiteaApi {
request: FetchHttpRequest {
config: {
BASE: 'http://192.168.1.10:3000/api/v1',
VERSION: '1.17.3',
WITH_CREDENTIALS: true,
CREDENTIALS: 'include',
TOKEN: '***',
USERNAME: undefined,
PASSWORD: undefined,
HEADERS: undefined,
ENCODE_PATH: undefined
}
},
admin: AdminService { httpRequest: FetchHttpRequest { config: [Object] } },
issue: IssueService { httpRequest: FetchHttpRequest { config: [Object] } },
miscellaneous: MiscellaneousService {
httpRequest: FetchHttpRequest { config: [Object] }
},
notification: NotificationService {
httpRequest: FetchHttpRequest { config: [Object] }
},
organization: OrganizationService {
httpRequest: FetchHttpRequest { config: [Object] }
},
package: PackageService { httpRequest: FetchHttpRequest { config: [Object] } },
repository: RepositoryService {
httpRequest: FetchHttpRequest { config: [Object] }
},
settings: SettingsService {
httpRequest: FetchHttpRequest { config: [Object] }
},
user: UserService { httpRequest: FetchHttpRequest { config: [Object] } }
}
owner is: oilrich25
repo is: simple-go-action
(node:135) ExperimentalWarning: buffer.File is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
{
id: 1676,
name: 'Dockerfile',
size: 7307,
download_count: 0,
created_at: '2023-12-05T07:36:43Z',
uuid: '7d186dec-a53a-4e7c-9826-10484e41d4a6',
browser_download_url: 'http://192.168.1.10:3000/attachments/7d186dec-a53a-4e7c-9826-10484e41d4a6'
}
But if I switch to ChristopherHX/gitea-actions-runner
, it will error ##[error]Unauthorized
##[group]Run oilrich25/gitea-action-release-asset@main
with:
asset: image/Dockerfile
asset-name: Dockerfile
token: ***
env:
CACHE_EPOCH: 1
CCACHE_MAXFILES: 0
CCACHE_MAXSIZE: 200M
GOCACHE: /root/gocache
SCCACHE_CACHE_SIZE: 200M
XDC_CACHE_HOME: /root/gocache
##[endgroup]
serverUrl is: http://192.168.1.10:3000
token is: ***
client is: GiteaApi {
request: FetchHttpRequest {
config: {
BASE: 'http://192.168.1.10:3000/api/v1',
VERSION: '1.17.3',
WITH_CREDENTIALS: true,
CREDENTIALS: 'include',
TOKEN: '***',
USERNAME: undefined,
PASSWORD: undefined,
HEADERS: undefined,
ENCODE_PATH: undefined
}
},
admin: AdminService { httpRequest: FetchHttpRequest { config: [Object] } },
issue: IssueService { httpRequest: FetchHttpRequest { config: [Object] } },
miscellaneous: MiscellaneousService {
httpRequest: FetchHttpRequest { config: [Object] }
},
notification: NotificationService {
httpRequest: FetchHttpRequest { config: [Object] }
},
organization: OrganizationService {
httpRequest: FetchHttpRequest { config: [Object] }
},
package: PackageService { httpRequest: FetchHttpRequest { config: [Object] } },
repository: RepositoryService {
httpRequest: FetchHttpRequest { config: [Object] }
},
settings: SettingsService {
httpRequest: FetchHttpRequest { config: [Object] }
},
user: UserService { httpRequest: FetchHttpRequest { config: [Object] } }
}
owner is: oilrich25
repo is: simple-go-action
##[error]Unauthorized
The action not portable... It honestly hardcodes api/v1.
The GitHub octokit uses ${{ github.api_url }}
to allow moving the api endpoint, e.g. for gitea it's api/v1, their GHES has api/v3 at this time..
The ${{ github.server_url }}
is the problem, Gitea appended a /
to the domain on the server. Then the actions just assumes it doesn't end with /
and appends /api/v1
without checking anything https://gitea//api/v1
The action not portable... It honestly hardcodes api/v1.
The GitHub octokit uses
${{ github.api_url }}
to allow moving the api endpoint, e.g. for gitea it's api/v1, their GHES has api/v3 at this time..The
${{ github.server_url }}
is the problem, Gitea appended a/
to the domain on the server. Then the actions just assumes it doesn't end with/
and appends/api/v1
without checking anythinghttps://gitea//api/v1
Can this error be resolved? Or what alternatives are there?
Fixed in f5496fb020e3cd5d7c9d90c02fcb0bded346b4e9, you can update the runner
I have recently switched from using
https://gitea.com/gitea/act_runner
toChristopherHX/gitea-actions-runner
for my Gitea Actions workflow. Previously, the workflow withhttps://gitea.com/gitea/act_runner
andsigyl-actions/gitea-action-release-asset
worked seamlessly, allowing successful compilation and release asset uploads. However, after the switch(ChristopherHX/gitea-actions-runner
), I encountered authorization issues with the samesigyl-actions/gitea-action-release-asset
.Note:
sigyl-actions/gitea-action-release-asset
is a node projectSteps to Reproduce
Use the following action.yaml configuration with https://gitea.com/gitea/act_runner (successfully runs):
Switch to ChristopherHX/gitea-actions-runner and use the same action.yaml (fails with Unauthorized error).
Expected Behavior
I expect the sigyl-actions/gitea-action-release-asset to run successfully with ChristopherHX/gitea-actions-runner as it did with https://gitea.com/gitea/act_runner.
Actual Behavior
The workflow fails with the following error: