Skip to content

enable usage of absolute urls for reusable workflows #30246

Closed
@jonas-switala

Description

@jonas-switala

Feature Description

Reusing workflows seems quite similar to reusing actions at first glance. They share several common issues. For example:

  • Accessing workflows/actions from private repositories
  • Distinguishing workflows/actions hosted on github.com or locally

For actions, this issue can be resolved by using absolute URLs (As described here https://docs.gitea.com/next/usage/actions/comparison#absolute-action-urls) and embedding the access token (As described in #25929)
However, this is currently not supported for reusable workflows:

calling workflow snippet:

### jobs:
  validate-manifests:
    uses: https://${{ secrets.GITHUB_TOKEN }}:{instance}/{owner}/{repo}/.gitea/workflows/[email protected]

output:

expected format {owner}/{repo}/.{git_platform}/workflows/{filename}@{ref}. Actual 'https://${{ secrets.GITHUB_TOKEN }}:{instance}/{owner}/{repo}/.gitea/workflows/[email protected]' Input string was not in a correct format

This leads to several inconveniences when working with reusable workflows or even makes them unusable for some use cases:

  • reusable workflows can't be hosted in private repos since there is no way to use a token with sufficient permissions
  • the only way to use reusable workflows not hosted publically on github.com is to set DEFAULT_ACTIONS_URL=self which
    • requires absolute URLs for all GitHub-hosted actions on the Gitea instance (which might be the majority of actions)
    • prohibts users from using reusable workflows hosted on github.com, since without absolute URLs there is no way to specify where a reusable workflow might be hosted

Possible Solution

I think the cleanest way to solve this is to make the same URL options available for reusable workflows that are already implemented for actions (e.g. absolute URLs with embedded tokens)

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposal/acceptedWe have reviewed the proposal and agree that it should be implemented like that/at all.topic/gitea-actionsrelated to the actions of Giteatype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions