Skip to content

Commit

Permalink
Support token authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
kendal committed May 23, 2024
1 parent 35f590b commit 73f3827
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/cron-sync-bcny-forks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,21 @@ on:
workflow_dispatch:

jobs:
token:
runs-on: ubuntu-latest
outputs:
token: ${{ steps.token.outputs.token }}
steps:
- uses: actions/create-github-app-token@v1
id: token
with:
app-id: ${{ secrets.FORK_SYNCER_APP_ID }}
private-key: ${{ secrets.FORK_SYNCER_PRIVATE_KEY }}
owner: thebrowsercompany
repositories: firebase-cpp-sdk

sync_analytics_swift:
needs: [token]
name: "Sync thebrowsercompany/analytics-swift"
runs-on: ubuntu-latest
steps:
Expand All @@ -19,8 +32,10 @@ jobs:
fork_branch: develop
upstream_repo: segmentio/analytics-swift
upstream_branch: main
token: ${{ needs.token.outputs.token }}

sync_firebase_cpp_sdk:
needs: [token]
name: "Sync thebrowsercompany/firebase-cpp-sdk"
runs-on: ubuntu-latest
steps:
Expand All @@ -30,8 +45,10 @@ jobs:
fork_branch: compnerd/swift
upstream_repo: firebase/firebase-cpp-sdk
upstream_branch: main
token: ${{ needs.token.outputs.token }}

sync_swift_eventsource:
needs: [token]
name: "Sync thebrowsercompany/swift-eventsource"
runs-on: ubuntu-latest
steps:
Expand All @@ -41,4 +58,5 @@ jobs:
fork_branch: main-bcny
upstream_repo: launchdarkly/swift-eventsource
upstream_branch: main
token: ${{ needs.token.outputs.token }}

5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ inputs:
required: false
default: false

token:
description: Authentication token to use for Git commands
required: false

runs:
using: composite
steps:
Expand All @@ -39,6 +43,7 @@ runs:
# Fetch all commits from the fork to prevent arbitrary merge conflicts.
fetch-depth: 0
path: ${{ github.workspace }}/fork
token: ${{ inputs.token || github.token }}

- name: Rebase onto upstream
shell: pwsh
Expand Down

0 comments on commit 73f3827

Please sign in to comment.