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

Use different string in case of forks are not used. #129

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
dockerfiles: ./Dockerfile
image: betka
tags: latest 1 ${{ github.sha }} 0.9.2
tags: latest 1 ${{ github.sha }} 0.9.3

- name: Push betka image to Quay.io
id: push-to-quay
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM quay.io/fedora/fedora:37

ENV NAME=betka-fedora \
RELEASE=0.9.2 \
RELEASE=0.9.3 \
ARCH=x86_64 \
SUMMARY="Syncs changes from upstream repository to downstream" \
DESCRIPTION="Syncs changes from upstream repository to downstream" \
Expand Down
5 changes: 4 additions & 1 deletion betka/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,10 @@ def _update_valid_branches(self):
return branch_list_to_sync

def _get_valid_origin_branches(self):
all_branches = Git.get_valid_remote_branches()
if self.is_fork_enabled():
all_branches = Git.get_valid_remote_branches()
else:
all_branches = Git.get_valid_remote_branches(default_string="remotes/origin/")
self.debug(f"All remote branches {all_branches}.")
# Filter our branches before checking bot-cfg.yml files
branch_list_to_sync = Git.branches_to_synchronize(
Expand Down
3 changes: 1 addition & 2 deletions betka/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,9 @@ def push_changes_to_fork(branch: str):
Git.call_git_cmd(f"push origin {branch} --force")

@staticmethod
def get_valid_remote_branches() -> List[str]:
def get_valid_remote_branches(default_string: str = "remotes/upstream/") -> List[str]:
remote_branches = []
all_branches = Git.get_all_branches()
default_string = "remotes/upstream/"
for branch in all_branches.split("\n"):
branch = branch.strip()
if branch.startswith(default_string):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_requirements():

setup(
name="betka",
version="0.9.2",
version="0.9.3",
packages=find_packages(exclude=["examples", "tests"]),
url="https://github.com/sclorg/betka",
license="GPLv3+",
Expand Down
Loading