Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open a PR updating the submodule in the main repo after syncing #32

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
93 changes: 0 additions & 93 deletions .github/ISSUE_TEMPLATE/bug-report.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/feature-request.yaml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/ISSUE_TEMPLATE/ui.bug-report.yaml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/sync-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Sync fork
# syncs our main branch with upstream main

on:
# runs every monday at 6:21 UTC+0
schedule:
- cron: '21 6 * * MON'
# allow triggers via button click
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-20.04

steps:
- uses: tgymnich/fork-sync@v1.6.3
with:
pr_title: Fork updates from go-gitea/gitea main
owner: go-gitea
base: main
head: main
auto_approve: false
auto_merge: true
token: ${{ secrets.GITHUB_TOKEN }}

open_pr:
name: Update submodule after syncing
runs-on: ubuntu-20.04
needs:
- sync

steps:
- name: Configure git
run: |
git config --global pull.rebase false
git config --global user.email auto-merge-bot@kitspace.dev
git config --global user.name "Kitspace Auto-Merge Bot"
- name: Check out gitea repo
uses: actions/checkout@v2
- name: Get gitea SHA
id: sha
shell: bash
run: |
echo "::set-output name=gitea_sha_short::$(git log --format=%h -n1)"
- name: Check out kitspace repo
uses: actions/checkout@v2
with:
repository: kitspace/kitspace-v2
- name: Update submodule
run: |
git submodule update --init
cd gitea
git checkout ${{ steps.sha.outputs.gitea_sha_short }}
cd ..
git commit -am "Deps: update gite@${{ steps.sha.outputs.gitea_sha_short }}"
- name: Open PR
uses: peter-evans/create-pull-request@v3
with:
delete-branch: true
reviewers: kasbah,AbdulrhmnGhanem
title: Auto update gitea
labels: dependencies
token: ${{ secrets.PAT }}
66 changes: 66 additions & 0 deletions Dockerfile.gitea.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM golang:1.17-alpine3.15

ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}

ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS

#Build & runtime deps
RUN apk --no-cache add \
build-base \
git \
nodejs \
npm \
bash \
ca-certificates \
curl \
gettext \
git \
linux-pam \
openssh \
s6 \
sqlite \
su-exec \
gnupg


#Setup repo
COPY . /go/src/code.gitea.io/gitea
WORKDIR /go/src/code.gitea.io/gitea

RUN npm install --no-save
RUN make build

# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go

EXPOSE 22 3000

RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:*" | chpasswd -e

ENV USER git
ENV GITEA_CUSTOM /data/gitea

VOLUME ["/data"]

ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]

COPY docker/root /
RUN mkdir -p /app/gitea
RUN cp /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
RUN cp /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
8 changes: 6 additions & 2 deletions routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,10 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {

m.Get("/issues/search", repo.SearchIssues)

m.Post("/migrate", reqToken(), bind(api.MigrateRepoOptions{}), repo.Migrate)
m.Group("/migrate", func() {
m.Post("", reqToken(), bind(api.MigrateRepoOptions{}), repo.Migrate)
m.Get("/status", repo.GetMigratingTask)
})

m.Group("/{username}/{reponame}", func() {
m.Combo("").Get(reqAnyRepoReader(), repo.Get).
Expand Down Expand Up @@ -759,9 +762,10 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
m.Post("/tests", context.RepoRefForAPI, repo.TestHook)
})
}, reqToken(), reqAdmin(), reqWebhooksEnabled())
m.Get("/collaborators/{collaborator}", reqAnyRepoReader(), repo.IsCollaborator)
m.Group("/collaborators", func() {
m.Get("", reqAnyRepoReader(), repo.ListCollaborators)
m.Combo("/{collaborator}").Get(reqAnyRepoReader(), repo.IsCollaborator).
m.Combo("/{collaborator}").
Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
Delete(reqAdmin(), repo.DeleteCollaborator)
}, reqToken())
Expand Down
Loading