-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 389518c
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env kotlin | ||
|
||
@file:Repository("https://repo.maven.apache.org/maven2/") | ||
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:2.3.0") | ||
|
||
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest | ||
import io.github.typesafegithub.workflows.domain.triggers.Cron | ||
import io.github.typesafegithub.workflows.domain.triggers.Push | ||
import io.github.typesafegithub.workflows.domain.triggers.RepositoryDispatch | ||
import io.github.typesafegithub.workflows.domain.triggers.Schedule | ||
import io.github.typesafegithub.workflows.domain.triggers.WorkflowDispatch | ||
import io.github.typesafegithub.workflows.dsl.expressions.expr | ||
import io.github.typesafegithub.workflows.dsl.workflow | ||
|
||
workflow( | ||
name = "Mirror Canonical Repository", | ||
on = listOf( | ||
Push(), | ||
RepositoryDispatch(), | ||
Schedule(triggers = listOf(Cron(minute = "44"))), | ||
WorkflowDispatch() | ||
), | ||
sourceFile = __FILE__ | ||
) { | ||
job( | ||
id = "mirror_repository", | ||
name = "Mirror Repository", | ||
runsOn = UbuntuLatest | ||
) { | ||
run( | ||
name = "Clone Canonical Repository", | ||
command = "git clone --bare git://git.code.sf.net/p/jedit/jEdit.bak ." | ||
) | ||
run( | ||
name = "Push To Mirror Repository", | ||
command = "git push --mirror https://x:${expr { github.token }}@github.com/${expr { github.repository }}" | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This file was generated using Kotlin DSL (.github/workflows/mirror-canonical-repository.main.kts). | ||
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file. | ||
# Generated with https://github.com/typesafegithub/github-workflows-kt | ||
|
||
name: 'Mirror Canonical Repository' | ||
on: | ||
push: {} | ||
repository_dispatch: {} | ||
schedule: | ||
- cron: '44 * * * *' | ||
workflow_dispatch: {} | ||
jobs: | ||
check_yaml_consistency: | ||
name: 'Check YAML consistency' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- id: 'step-0' | ||
name: 'Check out' | ||
uses: 'actions/checkout@v4' | ||
- id: 'step-1' | ||
name: 'Execute script' | ||
run: 'rm ''.github/workflows/mirror-canonical-repository.yaml'' && ''.github/workflows/mirror-canonical-repository.main.kts''' | ||
- id: 'step-2' | ||
name: 'Consistency check' | ||
run: 'git diff --exit-code ''.github/workflows/mirror-canonical-repository.yaml''' | ||
mirror_repository: | ||
name: 'Mirror Repository' | ||
runs-on: 'ubuntu-latest' | ||
needs: | ||
- 'check_yaml_consistency' | ||
steps: | ||
- id: 'step-0' | ||
name: 'Clone Canonical Repository' | ||
run: 'git clone --bare git://git.code.sf.net/p/jedit/jEdit.bak .' | ||
- id: 'step-1' | ||
name: 'Push To Mirror Repository' | ||
run: 'git push --mirror https://x:${{ github.token }}@github.com/${{ github.repository }}' |