mirror of
https://github.com/go-i2p/go-github-sync.git
synced 2025-12-20 12:15:54 -05:00
sync-on-push
This commit is contained in:
10
.github/workflows/sync.yaml
vendored
10
.github/workflows/sync.yaml
vendored
@@ -12,12 +12,10 @@
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
sync:
|
||||||
env:
|
|
||||||
GITHUB_ACTIONS_ENVIRONMENT: ${{ github.action }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Security Check
|
- name: Validate Github Actions Environment
|
||||||
run: if [ "$GITHUB_ACTIONS_ENVIRONMENT" == "" ]; then echo "This workflow is only intended to run inside GitHub Actions"; exit 1; fi
|
run: if [ "$GITHUB_ACTIONS" != "true" ]; then echo 'This script must be run in a GitHub Actions environment.'; exit 1; fi
|
||||||
- name: Checkout GitHub Mirror
|
- name: Checkout GitHub Mirror
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -62,9 +60,7 @@ jobs:
|
|||||||
git push origin main
|
git push origin main
|
||||||
name: Sync Primary Repository to GitHub Mirror
|
name: Sync Primary Repository to GitHub Mirror
|
||||||
"on":
|
"on":
|
||||||
|
push: {}
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 * * * *
|
- cron: 0 * * * *
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: write
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ func generateWorkflowYAML(data WorkflowTemplate) (string, error) {
|
|||||||
workflow := map[string]interface{}{
|
workflow := map[string]interface{}{
|
||||||
"name": "Sync Primary Repository to GitHub Mirror",
|
"name": "Sync Primary Repository to GitHub Mirror",
|
||||||
"on": map[string]interface{}{
|
"on": map[string]interface{}{
|
||||||
|
"push": map[string]interface{}{},
|
||||||
"schedule": []map[string]string{
|
"schedule": []map[string]string{
|
||||||
{"cron": data.CronSchedule},
|
{"cron": data.CronSchedule},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user