0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/.github/workflows/foss-sync.yml

53 lines
2.4 KiB
YAML
Raw Normal View History

name: Sync PostHog FOSS
on:
push:
branches:
- master
- main
jobs:
2020-08-20 18:20:41 +02:00
repo-sync:
name: Sync posthog-foss with posthog
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
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
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
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 }}
- 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
- 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"
uses: EndBug/add-and-commit@v9
2020-08-20 18:20:41 +02:00
with:
message: 'Sync and remove all non-FOSS parts'
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 }}
repository: 'posthog/posthog-foss'
ref: master