diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml new file mode 100644 index 000000000000..bb44ae957fad --- /dev/null +++ b/.github/workflows/sync.yaml @@ -0,0 +1,46 @@ +name: 'Upstream Sync' + +on: + schedule: + - cron: '0 21 * * 1-6' + + workflow_dispatch: # click the button on Github repo! + +jobs: + sync_latest_from_upstream: + permissions: + contents: write + runs-on: ubuntu-latest + name: Sync latest commits from upstream repo + + steps: + # REQUIRED step + # Step 1: run a standard checkout action, provided by github + - name: Checkout target repo + uses: actions/checkout@v4 + with: + ref: master + + # REQUIRED step + # Step 2: run the sync action + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_sync_branch: master + # REQUIRED 'target_repo_token' exactly like this! + target_repo_token: ${{ secrets.GITHUB_TOKEN }} + upstream_sync_branch: master + upstream_sync_repo: clearlydefined/curated-data + + # Step 3: Display a sample message based on the sync output var 'has_new_commits' + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." + + - name: Show value of 'has_new_commits' + run: echo ${{ steps.sync.outputs.has_new_commits }} diff --git a/README.md b/README.md index becdd068addb..8451d0d6f8eb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1 @@ -# curated-data - -This repository contains curation patches for clearlydefined.io. \ No newline at end of file +This branch `main` only contains the github action to keep the `master` branch in sync with the upstream `clearlydefined/curated-data`. diff --git a/package-lock.json b/package-lock.json index edafb7a9bede..5321f3af4354 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,9 +78,9 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" }