Skip to content

Commit

Permalink
Add GitHub mirroring
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Aug 5, 2024
1 parent b6868e9 commit 53cb0d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/mirror-canonical-repository.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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.Contexts.secrets
import io.github.typesafegithub.workflows.dsl.expressions.expr
import io.github.typesafegithub.workflows.dsl.workflow
import io.github.typesafegithub.workflows.yaml.ConsistencyCheckJobConfig.Disabled
Expand All @@ -18,7 +19,7 @@ workflow(
on = listOf(
Push(),
RepositoryDispatch(),
Schedule(triggers = listOf(Cron(minute = "44"))),
// Schedule(triggers = listOf(Cron(minute = "44"))),
WorkflowDispatch()
),
sourceFile = __FILE__,
Expand All @@ -33,9 +34,10 @@ workflow(
name = "Clone Canonical Repository",
command = "git clone --bare git://git.code.sf.net/p/jedit/jEdit.bak ."
)
val MIRROR_TOKEN by secrets
run(
name = "Push To Mirror Repository",
command = "git push --mirror https://x:${expr { github.token }}@github.com/${expr { github.repository }}"
command = "git push --mirror https://x:${expr(MIRROR_TOKEN)}@github.com/${expr { github.repository }}"
)
}
}
4 changes: 1 addition & 3 deletions .github/workflows/mirror-canonical-repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ name: 'Mirror Canonical Repository'
on:
push: {}
repository_dispatch: {}
schedule:
- cron: '44 * * * *'
workflow_dispatch: {}
jobs:
mirror_repository:
Expand All @@ -19,4 +17,4 @@ jobs:
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 }}'
run: 'git push --mirror https://x:${{ secrets.MIRROR_TOKEN }}@github.com/${{ github.repository }}'

0 comments on commit 53cb0d7

Please sign in to comment.