Skip to content

Commit

Permalink
Correctly use ref when loading files via token server
Browse files Browse the repository at this point in the history
  • Loading branch information
szschaler committed Feb 13, 2024
1 parent c65cb90 commit c842148
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tokenserver/src/controller/StorageController.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ class StorageController {

var paramOwner = req.query.owner;
var paramRepo = req.query.repo;
var paramBranch = req.query.ref;
var paramPath = req.query.path;

if ( paramOwner!=null && paramRepo!=null && paramPath!=null ) {
if ( paramOwner!=null && paramRepo!=null && paramPath!=null && paramBranch!=null ) {

let repoData = await octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
let repoData = await octokit.request('GET /repos/{owner}/{repo}/contents/{path}?ref={ref}', {
owner: paramOwner,
repo: paramRepo,
path: paramPath,
ref: paramBranch,
headers: {
'X-GitHub-Api-Version': config.githubApiVersion
}
Expand Down

0 comments on commit c842148

Please sign in to comment.