|
| 1 | +# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json |
| 2 | +--- |
| 3 | +name: Sync |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + paths: |
| 10 | + - .github/workflows/sync.yml |
| 11 | + - .github/sync.yml |
| 12 | + - sync-templates/** |
| 13 | + - workflow-templates/*.yaml |
| 14 | + - workflow-templates/*.yml |
| 15 | + |
| 16 | +permissions: {} |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ format('{0}-{1}-{2}-{3}-{4}', github.workflow, github.event_name, github.ref, github.base_ref, github.head_ref) }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +jobs: |
| 23 | + sync: |
| 24 | + name: Sync |
| 25 | + runs-on: ubuntu-24.04 |
| 26 | + timeout-minutes: 15 |
| 27 | + permissions: |
| 28 | + contents: read |
| 29 | + steps: |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 32 | + with: |
| 33 | + persist-credentials: false |
| 34 | + |
| 35 | + - name: Get App Token |
| 36 | + uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 |
| 37 | + id: get-token |
| 38 | + with: |
| 39 | + app-id: ${{ secrets.SYNC_BOT_APP_ID }} |
| 40 | + private-key: ${{ secrets.SYNC_BOT_PRIVATE_KEY }} |
| 41 | + owner: ${{ github.repository_owner }} |
| 42 | + permission-metadata: read |
| 43 | + permission-contents: write |
| 44 | + permission-pull-requests: write |
| 45 | + permission-workflows: write |
| 46 | + |
| 47 | + - name: Get bot details |
| 48 | + id: bot-details |
| 49 | + uses: raven-actions/bot-details@ee8966a9ff6e7e42cbfc4a56b4ddb60a9d1b40a6 # v1.2.0 |
| 50 | + with: |
| 51 | + bot-slug-name: ${{ steps.get-token.outputs.app-slug }} |
| 52 | + set-env: false |
| 53 | + |
| 54 | + - name: Run Repo File Sync |
| 55 | + uses: PaddleHQ/repo-file-sync-action@fb024b6e51a36213d16cc4b2c3b51c73b2b5ca70 # v1.26.13 |
| 56 | + with: |
| 57 | + GH_INSTALLATION_TOKEN: ${{ steps.get-token.outputs.token }} |
| 58 | + CONFIG_PATH: ./.github/sync.yml |
| 59 | + COMMIT_PREFIX: "chore:" |
| 60 | + BRANCH_PREFIX: repo-sync |
| 61 | + GIT_EMAIL: ${{ steps.bot-details.outputs.email }} |
| 62 | + GIT_USERNAME: ${{ steps.bot-details.outputs.name }} |
0 commit comments