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@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
  25. with:
  26. egress-policy: audit
  27. # Checkout our main repository.
  28. - name: Checkout the main repository
  29. uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  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