sync_repos.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. name: Sync repos
  5. on:
  6. push:
  7. branches: [trunk]
  8. paths:
  9. # Minimize where we run this to changes to the top-level files and
  10. # specific trees that we sync to other repositories.
  11. - '*'
  12. - 'utils/**'
  13. # Also run if the action itself is updated.
  14. - '.github/workflows/sync_repos.yaml'
  15. - 'scripts/sync_repos.sh'
  16. # Note the sync script has its own token.
  17. permissions:
  18. contents: read # For actions/checkout.
  19. jobs:
  20. sync-repos:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Harden Runner
  24. uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
  25. with:
  26. egress-policy: audit
  27. # Checkout our main repository.
  28. - name: Checkout the main repository
  29. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  30. # Run the sync script.
  31. - name: Sync to other repositories
  32. env:
  33. API_TOKEN_GITHUB: ${{ secrets.SYNC_REPOS_API_TOKEN_GITHUB }}
  34. run: ./scripts/sync_repos.sh