Comments (12)
Is there anyway to grab this automatically from the GitHub API?
from git-updater.
I use git-flow on one of my projects, so develop
is the default branch, and master
is the clean branch that I'd want version checks and downloads to come from.
Compare:
- https://api.github.com/repos/GaryJones/genesis-header-nav/contents/genesis-header-nav.php (default branch,
develop
) - https://api.github.com/repos/GaryJones/genesis-header-nav/contents/genesis-header-nav.php?ref=master (
master
)
You can see in the first one that the url
in the output contains a ref=develop
, so we can extrapolate that to determine the branch to download from when no "GitHub Branch: " is given.
You might also be able to spot that in this case, the content of the file is different - search on page for the string uMQ
- it's in the first (develop is on version 1.1.1), but changes to uMA
in the second (master is on version 1.1.0).
from git-updater.
Makes sense then to add a GitHub Branch:
header and use it. After all, I did make it that way on purpose.
from git-updater.
We just need to ensure the renaming code still works. I've accidentally deleted lots of stuff testing it.
from git-updater.
There's nothing obviously hard-coded in the renaming method that references "master" - so we should be all right there.
from git-updater.
Does this commit 787b877 solve this issue?
from git-updater.
No, not quite, for two reasons (and this is why I said I'd already got code for it).
- You need a:
if ( ! empty( $this->github_plugin['branch'] ) )
$endpoint = add_query_arg( 'ref', $this->github_plugin['branch'], $endpoint );
...just before the return line in get_api_url()
so that the remote version check is made against the right branch.
- You're still falling back to the master branch for the download zip, instead of parsing out the
url
from the remote info to get the default branch name (the bit at the end of?ref=develop
).
from git-updater.
I've reverted the commit so you can make another PR. I left in the declaration for the GitHub Branch
from git-updater.
I'm working on this.
from git-updater.
You're working, I'm waiting π
from git-updater.
Nearly there I think.
from git-updater.
Closing in favour of #13.
from git-updater.
Related Issues (20)
- Version 12.1.3 and WordPress 6.2 causes PHP error in backend (PHP8.0) HOT 1
- 'We made a few tweaks to the plugin, Opt in to make "Git Updater" better'! link broken HOT 4
- Problem of CSS layout in changelog tab HOT 6
- Version number issue: Version: 0.2.41 does not update to Version: 0.2.5 HOT 1
- 404 Error can't get updates HOT 4
- An error occurred while updating WebHeroe: Update package not available. HOT 4
- Persistent license reminder on network admin screens on multisite installs HOT 4
- Cron refresh never finishes HOT 1
- GitHub Updater Error Code: 401 HOT 1
- Consider `main` as default branch (instead of `master`) HOT 1
- Possible to include branch name in assets? HOT 2
- "Doing it wrong" message in Query Monitor HOT 2
- GitHub Access Token disappears HOT 5
- AnΓ‘lisis Auth
- discouraged Improvements HOT 1
- Please be patient while WP-Cron finishes making API calls. HOT 5
- Header information HOT 1
- Theme deleted during update HOT 8
- Dockerized Project - style.css not in the root of the repo HOT 25
- Git-Updater website login HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-updater.