From 1f55be12b2665638b7b9d3d5146875570282a711 Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Wed, 18 Aug 2021 16:35:57 +0200 Subject: [PATCH] Support GHES. Fixes #3 Support GHES by using GITHUB_API_URL instead of hardcoded url --- upload.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upload.js b/upload.js index e50a863..f1cb1e9 100644 --- a/upload.js +++ b/upload.js @@ -3,13 +3,16 @@ */ const axios = require('axios') const path = require('path') -const BASE_URL = 'https://api.github.com' const core = require('@actions/core') async function upload( base64Content, { Authorization, remotePath, username, repo, commitMessage } ) { + + // load api url from context + let BASE_URL = process.env.GITHUB_API_URL + core.debug(`Using API url: ${BASE_URL}`) const url = BASE_URL +