Skip to content

Commit

Permalink
github: list branches from origin instead of local
Browse files Browse the repository at this point in the history
After cloning in actions/checkout, there'll be only one branch. List the
branches from the remote.
  • Loading branch information
jnikula committed Nov 16, 2024
1 parent 9b5db0b commit 660653a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def git_tags():
return git(cmd)

def git_branches():
cmd = ['git', 'branch', '--list', '--format=%(refname:short)']
cmd = ['git', 'branch', '--remotes', '--format=%(refname:short)']

return git(cmd)
return [branch.removeprefix('origin/') for branch in git(cmd) if branch != 'origin/HEAD']

def main():
parser = argparse.ArgumentParser()
Expand Down

0 comments on commit 660653a

Please sign in to comment.