mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 09:14:46 +01:00
4bd79a27b7
* Remove commented out test
* Update VERSION
* Don't run the automerge job on forks
* Revert "Update VERSION"
This reverts commit dc37f20133
.
* Change automerge condition
* Change automerge condition a bit more
* Try scrolling
* Scroll by more
* Stop GitHub complaining about no jobs ran in a workflow
* Search for a different event name
* Try a different operator
* Don't default branch push jobs on forks
* Move clicks around
Co-authored-by: PostHog Bot <hey@posthog.com>
45 lines
2.0 KiB
YAML
45 lines
2.0 KiB
YAML
name: PostHog FOSS
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- main
|
|
|
|
jobs:
|
|
repo-sync:
|
|
name: Sync posthog-foss with posthog
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Sync repositories 1 to 1
|
|
if: github.repository == 'PostHog/posthog'
|
|
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
|
|
if: github.repository == 'PostHog/posthog'
|
|
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
|
|
if: github.repository == 'PostHog/posthog'
|
|
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: Commit "Sync and remove all non-FOSS parts"
|
|
if: github.repository == 'PostHog/posthog'
|
|
uses: EndBug/add-and-commit@v7
|
|
with:
|
|
author_name: PostHog Bot
|
|
author_email: hey@posthog.com
|
|
message: 'Sync and remove all non-FOSS parts'
|
|
remove: '["-r ee/", "-r .github/"]'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.SYNC_GITHUB_TOKEN }}
|
|
- run: echo # Empty step so that GitHub doesn't complain about an empty job on forks
|