2020-08-20 15:30:27 +02:00
name : PostHog FOSS
on :
2020-08-20 18:20:41 +02:00
push :
branches :
- master
2021-02-01 09:25:40 +01:00
- main
2020-08-20 15:30:27 +02:00
jobs :
2020-08-20 18:20:41 +02:00
repo-sync :
name : Sync posthog-foss with posthog
runs-on : ubuntu-latest
steps :
2021-07-15 22:29:33 +02:00
- name : Sync repositories 1 to 1 - master branch
2021-06-17 00:22:23 +02:00
if : github.repository == 'PostHog/posthog'
2021-07-15 22:29:33 +02:00
uses : wei/git-sync@v3
2020-08-20 18:20:41 +02:00
with :
2021-07-15 22:29:33 +02:00
source_repo : 'https://posthog-bot:${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}@github.com/posthog/posthog.git'
2020-08-20 18:20:41 +02:00
source_branch : 'master'
2021-07-15 22:29:33 +02:00
destination_repo : 'https://posthog-bot:${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}@github.com/posthog/posthog-foss.git'
2020-08-20 18:20:41 +02:00
destination_branch : 'master'
2021-07-15 22:29:33 +02:00
- name : Sync repositories 1 to 1 – tags
if : github.repository == 'PostHog/posthog'
uses : wei/git-sync@v3
with :
source_repo : 'https://posthog-bot:${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}@github.com/posthog/posthog.git'
source_branch : 'refs/tags/*'
destination_repo : 'https://posthog-bot:${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}@github.com/posthog/posthog-foss.git'
destination_branch : 'refs/tags/*'
2020-08-20 18:20:41 +02:00
- name : Checkout posthog-foss
2021-06-17 00:22:23 +02:00
if : github.repository == 'PostHog/posthog'
2020-08-20 18:20:41 +02:00
uses : actions/checkout@v2
with :
repository : 'posthog/posthog-foss'
ref : master
2021-07-15 22:29:33 +02:00
token : ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
2021-02-01 14:55:39 +01:00
- name : Change LICENSE to pure MIT
2021-06-17 00:22:23 +02:00
if : github.repository == 'PostHog/posthog'
2021-02-01 15:26:00 +01:00
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"
2021-06-17 00:22:23 +02:00
if : github.repository == 'PostHog/posthog'
2021-02-01 11:22:55 +01:00
uses : EndBug/add-and-commit@v7
2020-08-20 18:20:41 +02:00
with :
message : 'Sync and remove all non-FOSS parts'
2021-02-01 11:22:55 +01:00
remove : '["-r ee/", "-r .github/"]'
2021-07-15 22:29:33 +02:00
github_token : ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
2021-06-17 00:22:23 +02:00
- run : echo # Empty step so that GitHub doesn't complain about an empty job on forks