Prechádzať zdrojové kódy

Add workflow for fork synching.

Martijn Laan 1 mesiac pred
rodič
commit
6eb151dad0
2 zmenil súbory, kde vykonal 25 pridanie a 0 odobranie
  1. 18 0
      .github/workflows/sync-fork.yml
  2. 7 0
      README.md

+ 18 - 0
.github/workflows/sync-fork.yml

@@ -0,0 +1,18 @@
+name: sync-fork
+on:
+  schedule:
+    - cron: '0 0 * * *'
+  workflow_dispatch:
+jobs:
+  sync:
+    # Only set the topic `has-issrc-build-env-sync-token` if the secret is available
+    if: contains(github.event.repository.topics, 'has-issrc-build-env-sync-token')
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+      - run: gh repo sync $REPOSITORY -b $BRANCH_NAME
+        env:
+          GITHUB_TOKEN: ${{ secrets.ISSRC_BUILD_ENV_SYNC_TOKEN }}
+          REPOSITORY: ${{ github.repository }}
+          BRANCH_NAME: ${{ github.ref_name }}

+ 7 - 0
README.md

@@ -273,6 +273,13 @@ https://github.com/YOUR-USER-NAME/issrc to add the topic).
 Once that's done, you're set! The next time you push a branch to your fork, the
 Once that's done, you're set! The next time you push a branch to your fork, the
 workflow will be triggered automatically.
 workflow will be triggered automatically.
 
 
+To set up automatic synchronization for your fork, first create a Fine-Grained Personal
+Access Token with access to your fork or all repositories you own, ensuring it has Read and
+Write permissions for Contents. After that, add this token as a new repository secret, under
+the name `ISSRC_BUILD_ENV_ZIP_SYNC_TOKEN`. Finally, indicate that your fork has this secret,
+by adding the topic `has-issrc-build-env-sync-token`. Your fork will nowsynchronize daily,
+and will automatically run the aforementioned build workflow on changes, if it's configured.
+
 <!-- Link references -->
 <!-- Link references -->
 [CONTRIBUTING.md]: <CONTRIBUTING.md>
 [CONTRIBUTING.md]: <CONTRIBUTING.md>
 [Projects\Bin]: <Projects/Bin>
 [Projects\Bin]: <Projects/Bin>