Skip to content

Commit

Permalink
Add github action to daily auto-sync forks
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Mar 19, 2024
1 parent ab4eece commit 6c551f7
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ blank_issues_enabled: false
contact_links:
- name: DON'T POST ISSUES. Have a bug, feature idea, or any question? Start a discussion
about: Please start Discussions for everything. Project maintainers will create issues.
url: https://github.com/the-dot-bot/hostedgpt/discussions/new?category=general
url: https://github.com/allyourbot/hostedgpt/discussions/new?category=general
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Docker Container Build"
name: Docker Container Build
on:
push:
branches: [ "main" ]
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/fork-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Daily Fork Auto-Update
on:
workflow_dispatch:
schedule:
- cron: '11 3 * * *'

jobs:
sync_with_upstream:
runs-on: ubuntu-latest
name: Sync main with upstream fork

steps:

- uses: actions/checkout@v2
- name: Merge upstream
run: |
ORIG_USER=$(git config --global --get --default="null" user.name)
ORIG_EMAIL=$(git config --global --get --default="null" user.email)
echo "Debug ${ORIG_USER} and ${ORIG_EMAIL}" 1>&1
git config --global user.name 'GitHub'
git config --global user.email ''
git checkout main
if [ $(git branch --show-current) != "main" ]; then
git checkout "main"
echo 'Target branch 'main' checked out' 1>&1
fi
git remote add upstream "https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/allyourbot/hostedgpt.git"
git fetch upstream "main"
LOCAL_COMMIT_HASH=$(git rev-parse "main")
UPSTREAM_COMMIT_HASH=$(git rev-parse upstream/"main")
echo "Debug ${LOCAL_COMMIT_HASH} vs ${UPSTREAM_COMMIT_HASH}" 1>&1
if [ "${LOCAL_COMMIT_HASH}" = "${UPSTREAM_COMMIT_HASH}" ]; then
echo 'No new commits to sync, exiting' 1>&1
else
echo 'New commits being synced:' 1>&1
git log upstream/"main" "${LOCAL_COMMIT_HASH}"..HEAD
echo 'Syncing...' 1>&1
git pull --ff-only upstream "main"
echo 'Sync successful' 1>&1
echo 'Pushing to target branch...' 1>&1
git push origin "main"
echo 'Push successful' 1>&1
fi
echo 'Done.' 1>&1
8 changes: 1 addition & 7 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "Ruby on Rails CI"
name: Ruby on Rails CI
on:
push:
branches: [ "main" ]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ You can deploy a full version of HostedGPT to the hosting service, Render, for f

1. If you encountered an error while waiting for the services to be deployed on Render, click **Dashboard** at the top of the Render screen and click the Service that failed.
2. It should take you to the Events section and the top event should explain the error. It will probably contain a link to click to the **deploy logs**
3. Scroll back up through the logs and find any instances of errors. [Open a new Issue for us](https://github.com/the-dot-bot/hostedgpt/issues/new) and share details.
3. Scroll back up through the logs and find any instances of errors. [Open a new Issue for us](https://github.com/allyourbot/hostedgpt/issues/new) and share details.
4. When you are ready to try Render again, it's best to do the following:
5. First, ensure your repo is caught up. Open your fork in github, click the Sync Fork button so that any bug fixes are pulled in.
6. Second, in Render navigate to the Dashboard, Bluebrint, and Env Groups and delete any details associated with **hostedgpt**
7. Now you can go back to your repo and click **Deploy to Render**

# Contribute as a Developer

We welcome contributors! After you get your developoment environment setup, review the list of Issues. We organize the issues into Milestones and are currently working on v0.6. [View 0.6 Milestone](https://github.com/the-dot-bot/hostedgpt/milestone/5). Look for any issues tagged with **Good first issue** and add a comment so we know you're working on it.
We welcome contributors! After you get your developoment environment setup, review the list of Issues. We organize the issues into Milestones and are currently working on v0.6. [View 0.6 Milestone](https://github.com/allyourbot/hostedgpt/milestone/5). Look for any issues tagged with **Good first issue** and add a comment so we know you're working on it.

## Setting up Development

Expand Down

0 comments on commit 6c551f7

Please sign in to comment.