about summary refs log tree commit diff
path: root/.github/workflows/sync-internal.yaml
blob: b50d6bc51291915c59c5d4c32de2ec69d31d9c57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Sync to internal repo

on:
  push:
    branches: [main]

jobs:
  sync:
    runs-on: ubuntu-latest
    if: github.repository == 'bluesky-social/social-app'
    steps:
      - name: Checkout public repo
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Generate GitHub App Token
        id: app-token
        uses: actions/create-github-app-token@v1
        with:
          app-id: ${{ vars.SYNC_INTERNAL_APP_ID }}
          private-key: ${{ secrets.SYNC_INTERNAL_PK }}
          repositories: social-app-internal
      - name: Push to internal repo
        env:
          TOKEN: ${{ steps.app-token.outputs.token }}
        run: |
          git config user.name "github-actions"
          git config user.email "test@users.noreply.github.com"
          git config --unset-all http.https://github.com/.extraheader
          git remote add internal https://x-access-token:${TOKEN}@github.com/bluesky-social/social-app-internal.git
          git push internal main --force