2021-10-21 16:49:25 +02:00
name : Sync PostHog FOSS
2020-08-20 15:30:27 +02:00
2022-01-24 14:03:50 +01:00
on :
push :
branches :
- master
- 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
2022-06-24 03:16:55 +02:00
if : github.repository == 'PostHog/posthog'
2020-08-20 18:20:41 +02:00
runs-on : ubuntu-latest
steps :
2021-07-15 22:29:33 +02:00
- name : Sync repositories 1 to 1 - master branch
2023-06-13 19:11:08 +02:00
uses : PostHog/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
2023-06-13 19:11:08 +02:00
uses : PostHog/git-sync@v3
2021-07-15 22:29:33 +02:00
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
2022-10-26 20:40:00 +02:00
uses : actions/checkout@v3
2020-08-20 18:20:41 +02:00
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-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
2021-10-21 16:49:25 +02:00
- name : Remove unused GitHub workflows
run : |
cd .github/workflows
ls | grep -v foss-release-image-publish.yml | xargs rm
2020-08-20 18:20:41 +02:00
- name : Commit "Sync and remove all non-FOSS parts"
2023-06-13 19:11:08 +02:00
uses : EndBug/add-and-commit@v9
2020-08-20 18:20:41 +02:00
with :
message : 'Sync and remove all non-FOSS parts'
2021-10-21 16:49:25 +02:00
remove : '["-r ee/"]'
2021-10-25 23:59:31 +02:00
default_author : github_actions
2021-07-15 22:29:33 +02:00
github_token : ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
2023-06-13 19:11:08 +02:00
repository : 'posthog/posthog-foss'
ref : master