Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core feature request] Overriding Action versions and additional Yaml properties #74

Closed
jmfayard opened this issue Feb 8, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jmfayard
Copy link
Contributor

jmfayard commented Feb 8, 2022

What feature do you need?

More possibility for the developer to override an Action's version, add additional properties, check that the version is valid.

Currently the release of GitHub actions and of the github-actions-kotlin-dsl library are too tightly coupled.

Do you have an example usage?

Given an action like this one:

data class CreateBranchV2(
    val branch: String? = null,
    val sha: String? = null,
) : Action("peterjgrainger", "action-create-branch", "v2.0.0") {
}

I would like to be able to specify a specific version

val action = CreateBranchV2(branch = "main").withVersion("v2.1.0")

It may be the case the this release added two new parameters fast and nice who is not yet supported and I don't want to wait for a release of github-actions-kotlin-dsl.

I would then like to be able to specify an untyped map of additional Yaml Properties

val action = CreateBranchV2(branch = "main")
    .withVersion("v2.1.0")
    .withAdditionalYaml("fast" to "true", "nice" to "yes please")

An issue with this is that it's easy to specify a wrong version and waste too much time on the CI.

It would be nice if the .withVersion("v2.1.0") does check that the release actually exists

That can be done with either a request like this:

curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/peterjgrainger/action-create-branch/releases

or

curl --location --head 'https://github.com/peterjgrainger/action-create-branch/releases/tag/v2.1.0'

It would be nice to cache the result that a given release exists, so that we pay the network penalty only once.

@jmfayard jmfayard added the enhancement New feature or request label Feb 8, 2022
@jmfayard jmfayard changed the title [Core feature request] Checking and overriding Action versions [Core feature request] Overriding Action versions and additional Yaml properties Feb 8, 2022
@krzema12
Copy link
Member

Let's remember about updating the docs. I think a whole chapter on using custom attributes/inputs should be created, something that will answer "some feature is not yet in the library - what can I do as a workaround?".

krzema12 added a commit that referenced this issue Mar 22, 2022
Allows using an input that the library is not yet aware of, or passing any non-string value as string.

Co-authored-by: Piotr Krzemiński <git@krzeminski.it>
@krzema12 krzema12 assigned krzema12 and unassigned jmfayard Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants