diff --git a/setup/README.md b/setup/README.md index 46a3812..c919e3b 100644 --- a/setup/README.md +++ b/setup/README.md @@ -39,6 +39,21 @@ We recommend using a Linux or MacOS runner if possible, especially if TinyTeX is tinytex: true ``` +### GitHub Enterprise + +For GitHub Enterprise Server (GHES), you may need to [generate a personal access token (PAT) on github.com](https://github.com/settings/tokens/new) to enable downloading Quarto. GitHub's [setup-python action](https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#avoiding-rate-limit-issues) uses a similar workaround, from which these instructions are adapted: + + - Create a PAT on any github.com account by using [this link](https://github.com/settings/tokens/new) after logging into github.com (not your GHES instance). This PAT does not need any rights, so make sure all the boxes are unchecked. + - Store this PAT in the repository / organization where you run your workflow, e.g. as `GH_GITHUB_COM_TOKEN`. You can do this by navigating to your repository -> **Settings** -> **Secrets** -> **Actions** -> **New repository secret**. + - In your workflow, incorporate your PAT as an environment variable. For example: + + ```yaml + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + env: + GH_TOKEN: ${{ secrets.GH_GITHUB_COM_TOKEN }} + ``` + ## Examples ```yaml diff --git a/setup/action.yml b/setup/action.yml index c684dc5..7f9bbe1 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -43,7 +43,7 @@ runs: # On Windows scoop will be used so no need to download the release if [ -z "${{inputs.version}}" ]; then # download the latest stable release - gh release download --repo quarto-dev/quarto-cli --pattern ${{ format('*{0}', env.BUNDLE_EXT) }} + gh release download --repo github.com/quarto-dev/quarto-cli --pattern ${{ format('*{0}', env.BUNDLE_EXT) }} version=$(curl https://quarto.org/docs/download/_download.json | jq -r '.version') echo "version=${version}" >> $GITHUB_OUTPUT elif [ "${{inputs.version}}" == "LATEST" -o "${{inputs.version}}" == "pre-release" ]; then