From 4a60710ed8ed21c21c93b7aa3509f4d0a145aaa7 Mon Sep 17 00:00:00 2001 From: Paul Loberg Date: Fri, 27 Sep 2024 10:41:01 +0200 Subject: [PATCH 1/2] Set baseUrl for Octokit to make it work on GitHub Enterprise Server --- src/setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setup.ts b/src/setup.ts index bfce625..4994a33 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -31,7 +31,7 @@ async function setup() { if (version.length === 0) { // If no version is specified, the latest version is used by default. const token = core.getInput('token', {required: true}); - const octokit = getOctokit(token); + const octokit = getOctokit(token, {baseUrl: 'https://api.github.com'}); const release = await octokit.rest.repos.getLatestRelease({ owner: 'mozilla', repo: 'sccache' From e073bd0f5c2a1b383ffaee047ebfe0d6369abca2 Mon Sep 17 00:00:00 2001 From: Paul Loberg Date: Fri, 27 Sep 2024 11:01:55 +0200 Subject: [PATCH 2/2] Update README with instructions on GHES usage. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index d412f19..6b9bcde 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,19 @@ With configure, call it with: ./configure CC="sccache clang" CXX="sccache clang" ``` +## Using on GitHub Enterprise Server (GHES) + +When using the action on GitHub Enterprise Server installations a valid GitHub.com token must be provided. + +``` +- name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.5 + with: + token: ${{ secrets.MY_GITHUB_TOKEN }} +``` + +Note that using https://github.com/actions/create-github-app-token is a better option than storing a fixed token in the repo secrets. + ## Prepare a new release 1. Update the example in README.md