Repository navigation
How to use Forgejo Actions compatible syntax with Act? (jobs.<job_id>.uses) #6208
|
Managed Hosting Forgejo with Forgejo Runner that processes my actions. - name: Execute remote deployment script via SSH
uses: https://github.com/appleboy/ssh-action@v1.2.5
...However, the input string is rejected by Act: Unfortunately, I have to use two different actions to test locally with Act. It would be nice if there is a way to fix this (without writing too much conditional logic into the action and bloat it) A workaround would be to mirror the GH repo to my Forgejo and the use that in my action in the compatible format for both. However, this requires additional authentication and is not what I want here. |
Replies: 1 comment 2 replies
|
I reproduced that action-reference error with Act 0.2.89. Forgejo accepts the full URL, but Act expects the GitHub shorthand For managed Forgejo, you can keep the checked-in workflow unchanged and generate a disposable local copy for Act. For the unquoted mkdir -p .act-workflows
sed 's#uses: https://github.com/#uses: #' \
.forgejo/workflows/deploy.yml > .act-workflows/deploy.yml
act -W .act-workflows/deploy.ymlReplace I wouldn't remove the hostname from the Forgejo version without checking the host's configuration: Forgejo prefixes shorthand actions with its instance-wide AI-assisted; I tested the generated YAML and verified that Act gets past the original reference-parser error and resolves the GitHub action. I did not test an SSH deployment. |
I reproduced that action-reference error with Act 0.2.89. Forgejo accepts the full URL, but Act expects the GitHub shorthand
appleboy/ssh-action@v1.2.5.For managed Forgejo, you can keep the checked-in workflow unchanged and generate a disposable local copy for Act. For the unquoted
uses:lines in your example:Replace
deploy.ymlwith your filename and keep.act-workflowsgenerated/ignored. This still points Act at the same public GitHub action; it needs neither a mirror nor conditional steps in the actual workflow. It only transl…