AkashRajpurohit / git-sync

🔄 A simple tool to backup and sync your git repositories
https://github.com/AkashRajpurohit/git-sync/wiki
MIT License
154 stars 7 forks source link

feat(config): able to include/filter orgs #7

Closed qlaffont closed 3 months ago

qlaffont commented 3 months ago

Able to filter or include orgs

changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: 0b9448543d704fca4d85d5e629a7dcbeba6d9bfe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

qlaffont commented 3 months ago

@AkashRajpurohit a little PR who can help person like me to filter work orgs from our backup (To test, i'm a beginner in go)

AkashRajpurohit commented 3 months ago

hey @qlaffont can you share how have you tested this? From what I understand it will fetch repos to which you have access (your PAT token) and I tested with my setup and where I have some repos from different orgs, it was able to fetch those correctly but the condition of repo.GetOrganization() is also nil for all repos so not sure how have you tested any verified that it is able to filter out repos based on orgs 🤔

To test, you can install golang v1.22 (I am on 1.22.4) and run go run main.go

qlaffont commented 3 months ago

I didn't test it (As I mentioned it before !). I will try !

AkashRajpurohit commented 3 months ago

I didn't test it (As I mentioned it before !). I will try !

Sure, ping if you need any help about this :)

qlaffont commented 3 months ago

I fixed it but @AkashRajpurohit i don't undertstand why i got nil for getOrganization.getName :thinking: any clue ?

AkashRajpurohit commented 3 months ago

why i got nil for getOrganization.getName

Yeah I also did not get this, I would've expected it to not be nil if the repo was infact part of organization, might have to check in the upstream github package.

qlaffont commented 3 months ago

@AkashRajpurohit Thanks I have made the changes and it works ! You can review it again and squash and merge if you want :)

AkashRajpurohit commented 3 months ago

@all-contributors please add @qlaffont for code.

allcontributors[bot] commented 3 months ago

@AkashRajpurohit

I've put up a pull request to add @qlaffont! :tada: