Skip to content

Commit

Permalink
refactor: use github-api-url-public
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszPorowski committed May 13, 2024
1 parent 2f8e607 commit cffd6fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Action returns some basic information. For more details, follow [📤 Outputs](#
| `pyflakes` | false | `bool` | `true` | Use `pyflakes` with `actionlint` (and install if it does not exist) |
| `cache` | false | `bool` | `true` | Use GitHub cache for caching binaries for the next runs. |
| `github-token` | false | `string` | `github.token` | GitHub Token for API authentication. |
| `github-api-url` | false | `string` | `github.api_url` | GitHub REST API URL to connect to a different GitHub instance. For example, `https://my.github-enterprise-server.com/api/v3` |
| `github-api-url-public` | false | `string` | `github.api_url` | Public GitHub REST API URL to connect to for dependencies download. For example, `https://api.github.com`. Required if you are running in the GHES. |

## 📤 Outputs

Expand Down
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ inputs:
description: GitHub Token
required: false
default: ${{ github.token }}
github-api-url:
description: GitHub REST API URL
github-api-url-public:
description: Public GitHub REST API URL for dependencies download
required: false
default: ${{ github.api_url }}
outputs:
Expand Down Expand Up @@ -217,8 +217,8 @@ runs:
uses: actions/github-script@v7
if: ${{ steps.tool-cache.outputs.cache-hit != 'true' }}
with:
github-token: ${{ inputs.github-token || inputs.token || env.GITHUB_TOKEN }}
base-url: ${{ inputs.github-api-url }}
# github-token: ${{ inputs.github-token || inputs.token || env.GITHUB_TOKEN }}
base-url: ${{ inputs.github-api-url-public }}
script: |
// dependencies
const tc = require('@actions/tool-cache')
Expand Down Expand Up @@ -256,7 +256,7 @@ runs:
id: tool-dependencies
with:
github-token: ${{ inputs.github-token || inputs.token || env.GITHUB_TOKEN }}
base-url: ${{ inputs.github-api-url }}
# base-url: ${{ inputs.github-api-url }}
script: |
// input envs
const { INPUT_PYFLAKES, INPUT_SHELLCHECK } = process.env
Expand Down Expand Up @@ -322,7 +322,7 @@ runs:
id: tool-runner
with:
github-token: ${{ inputs.github-token || inputs.token || env.GITHUB_TOKEN }}
base-url: ${{ inputs.github-api-url }}
# base-url: ${{ inputs.github-api-url }}
script: |
// input envs
const { INPUT_FILES, INPUT_FLAGS, INPUT_TOOL_NAME, INPUT_TOOL_DIR_PATH, INPUT_MATCHER, INPUT_MATCHER_PATH, INPUT_TOOL_EXECUTABLE, INPUT_JSON, INPUT_FAIL_ON_ERROR, INPUT_PYFLAKES, INPUT_SHELLCHECK, INPUT_GROUP_RESULT, DEBUG } = process.env
Expand Down

0 comments on commit cffd6fb

Please sign in to comment.