Skip to content

Commit 7e78784

Browse files
authored
Read base_ref using library (#75)
Since the library already provides `base_ref`, we can remove the workaround.
1 parent 618caa0 commit 7e78784

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

.github/workflows/test.main.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import io.github.typesafegithub.workflows.domain.triggers.Cron
2121
import io.github.typesafegithub.workflows.domain.triggers.PullRequest
2222
import io.github.typesafegithub.workflows.domain.triggers.Push
2323
import io.github.typesafegithub.workflows.domain.triggers.Schedule
24-
import io.github.typesafegithub.workflows.dsl.expressions.expr
2524
import io.github.typesafegithub.workflows.dsl.workflow
2625
import it.krzeminski.snakeyaml.engine.kmp.api.Load
2726
import kotlinx.serialization.json.JsonArray
@@ -81,11 +80,8 @@ workflow(
8180
uses(action = Checkout())
8281
run(
8382
name = "Check for actions",
84-
// TODO: replace this workaround once base_ref can be accessed natively:
85-
// https://github.com/typesafegithub/github-workflows-kt/issues/1946
86-
env = mapOf("base_ref" to expr { github.base_ref })
8783
) {
88-
validateTypings(github.sha, System.getenv("base_ref").ifEmpty { null })
84+
validateTypings(github.sha, github.base_ref)
8985
}
9086
}
9187

.github/workflows/test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
- id: 'step-1'
5151
name: 'Check for actions'
5252
env:
53-
base_ref: '${{ github.base_ref }}'
5453
GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}'
5554
run: 'GHWKT_RUN_STEP=''test.yaml:validate_typings:step-1'' ''.github/workflows/test.main.kts'''
5655
workflows_consistency_check:

0 commit comments

Comments
 (0)