Skip to content

Commit

Permalink
⚡️ Avoid running tasks twice in PRs
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Jan 22, 2025
1 parent 91e9d47 commit f3400de
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-debug.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import io.github.typesafegithub.workflows.dsl.workflow

workflow(
name = "Build Universal Debug APK",
on = listOf(Push(), PullRequest()),
on = listOf(Push(branches = listOf("main")), PullRequest()),
sourceFile = __FILE__
) {
job(id = "build", runsOn = RunnerType.UbuntuLatest) {
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

name: 'Build Universal Debug APK'
on:
push: {}
push:
branches:
- 'main'
pull_request: {}
jobs:
check_yaml_consistency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-license-analysis.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import io.github.typesafegithub.workflows.dsl.workflow

workflow(
name = "Dependency License Analysis",
on = listOf(Push(), PullRequest()),
on = listOf(Push(branches = listOf("main")), PullRequest()),
sourceFile = __FILE__
) {
job(id = "analyse", runsOn = RunnerType.UbuntuLatest) {
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/dependency-license-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

name: 'Dependency License Analysis'
on:
push: {}
push:
branches:
- 'main'
pull_request: {}
jobs:
check_yaml_consistency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import io.github.typesafegithub.workflows.dsl.workflow

workflow(
name = "Lint",
on = listOf(Push(), PullRequest()),
on = listOf(Push(branches = listOf("main")), PullRequest()),
sourceFile = __FILE__
) {
job(id = "detekt", runsOn = UbuntuLatest) {
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

name: 'Lint'
on:
push: {}
push:
branches:
- 'main'
pull_request: {}
jobs:
check_yaml_consistency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import io.github.typesafegithub.workflows.dsl.workflow

workflow(
name = "Unit Tests",
on = listOf(Push(), PullRequest()),
on = listOf(Push(branches = listOf("main")), PullRequest()),
sourceFile = __FILE__
) {
job(id = "unit-test", runsOn = RunnerType.UbuntuLatest) {
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

name: 'Unit Tests'
on:
push: {}
push:
branches:
- 'main'
pull_request: {}
jobs:
check_yaml_consistency:
Expand Down

0 comments on commit f3400de

Please sign in to comment.