Skip to content

Using env together with "Untyped wrapper"-approach #412

Answered by uweschaefer
uweschaefer asked this question in Q&A
Discussion options

You must be logged in to vote

[Solved]

Ok, now i found it - stupid me.

example:

        uses(
            action = customAction,
            name = "Sonar analysis",
            env = linkedMapOf(
                "GITHUB_TOKEN" to expr { secrets.GITHUB_TOKEN }, // typesafe
                "SONAR_TOKEN" to expr { "secrets.SONAR_TOKEN" } // just as a string
            )
        )

with custom action being

val customAction = CustomAction(
    actionOwner = "SonarSource",
    actionName = "sonarcloud-github-action",
    actionVersion = "master",
    inputs = linkedMapOf()
)

to produce

      - id: step-6
        name: Sonar analysis
        uses: SonarSource/sonarcloud-github-action@master
        env:
          GITHUB_TOK…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@krzema12
Comment options

Answer selected by uweschaefer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants