0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 02:49:32 +01:00
posthog/.github/workflows/posthog-foss.yml

40 lines
1.7 KiB
YAML
Raw Normal View History

name: PostHog FOSS
on:
2020-08-20 18:20:41 +02:00
push:
branches:
- master
- main
jobs:
2020-08-20 18:20:41 +02:00
repo-sync:
name: Sync posthog-foss with posthog
runs-on: ubuntu-latest
steps:
- name: Sync repositories 1 to 1
uses: ungless/git-sync@master # tag syncing is not currently part of wei/git-sync
with:
source_repo: 'https://${{ secrets.SYNC_GITHUB_TOKEN }}@github.com/posthog/posthog.git'
source_branch: 'master'
destination_repo: 'https://${{ secrets.SYNC_GITHUB_TOKEN }}@github.com/posthog/posthog-foss.git'
destination_branch: 'master'
- name: Checkout posthog-foss
uses: actions/checkout@v2
with:
repository: 'posthog/posthog-foss'
ref: master
token: ${{ secrets.SYNC_GITHUB_TOKEN }} # SYNC_GITHUB_TOKEN is a PAT token with the workflows scope which is not in GITHUB_TOKEN
- name: Change LICENSE to pure MIT
run: |
sed -i -e '/PostHog Inc\./,/Permission is hereby granted/c\Copyright (c) 2020-2021 PostHog Inc\.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy' LICENSE
echo -e "MIT License\n\n$(cat LICENSE)" > LICENSE
2020-08-20 18:20:41 +02:00
- name: Commit "Sync and remove all non-FOSS parts"
uses: EndBug/add-and-commit@v7
2020-08-20 18:20:41 +02:00
with:
author_name: PostHog Bot
author_email: hey@posthog.com
message: 'Sync and remove all non-FOSS parts'
remove: '["-r ee/", "-r .github/"]'
2020-08-20 18:20:41 +02:00
env:
GITHUB_TOKEN: ${{ secrets.SYNC_GITHUB_TOKEN }}