Skip to content

feat(ghes): fetch tool from configurable server#22

Merged
DariuszPorowski merged 3 commits into
mainfrom
feat/base_url
Jun 27, 2026
Merged

feat(ghes): fetch tool from configurable server#22
DariuszPorowski merged 3 commits into
mainfrom
feat/base_url

Conversation

@DariuszPorowski

@DariuszPorowski DariuszPorowski commented Mar 9, 2024

Copy link
Copy Markdown
Collaborator

💌 Description

  • Add option to set own GitHub REST API, default to GITHUB_API_URL
  • Enforce actionlint version / matcher check from public github
  • Inputs naming adjustments
  • Update docs

🔗 Related issue

Fixes: #14

🏗️ Type of change

  • 📚 Examples/docs/tutorials
  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🚨 Security fix
  • ⬆️ Dependencies update

✅ Checklist

@DariuszPorowski DariuszPorowski added the enhancement New feature or request label Mar 9, 2024
@DariuszPorowski DariuszPorowski self-assigned this Mar 9, 2024
@DariuszPorowski
DariuszPorowski marked this pull request as ready for review March 9, 2024 18:19
@DariuszPorowski
DariuszPorowski requested a review from a team as a code owner March 9, 2024 18:19
@DariuszPorowski DariuszPorowski added the documentation Improvements or additions to documentation label Mar 9, 2024
@bhundven-axon

Copy link
Copy Markdown

@DariuszPorowski I'll give this a shot in a little while and will update with results.

Comment thread README.md Outdated
| `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` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't actually needed in my option. github.api_url will point to the correct API URL of the GHES instance.

Comment thread action.yml
id: environment
with:
github-token: ${{ inputs.token || env.GITHUB_TOKEN }}
github-token: ${{ inputs.github-token || inputs.token || env.GITHUB_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work (and breaks as expected in my tests due to a 401 error), because the token here will be my GHES token by default, which is unknown to GitHub. If I override the github-token option with a real GitHub.com token, then consequently the later steps which target my GHES API will fail due to always using the same configured token.

I think you would need to introduce an additional github-token-downloadurl (name just for illustration) which is used for the environment step. This can also default to ${{ github.api_url }}, thus remaining backwards compatible.

Additionally we should allow not using a token at all when accessing the API (unauthenticated request). These calls are heavily rate-limited, but our GHES workflow may not have access to any GitHub.com token at all.

The list releases API is available without authentication:

This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frederikb great input! thanks for checking. Going to address your suggestions today, and appreciate GHES test after will update this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frederikb the problem with anonymous GH public api calls is, it's a very limited rate limits: The primary rate limit for unauthenticated requests is 60 requests per hour.

@RufusJWB

Copy link
Copy Markdown

Is there hope that this will be fixed anytime soon? I'm trying to use actionlint inside of a GitHub Enterprise instance and it is constantly failing with 404 errors

@alikose90

Copy link
Copy Markdown

Me either.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ EDITORCONFIG editorconfig-checker 3 0 0 0.25s
✅ MARKDOWN markdownlint 1 0 0 0 0.64s
✅ MARKDOWN markdown-table-formatter 1 0 0 0 0.22s
✅ REPOSITORY gitleaks yes no no 0.52s
✅ SPELL cspell 2 0 0 2.28s
✅ SPELL lychee 3 0 0 1.61s
✅ YAML yamllint 2 0 0 0.54s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Adds a github-server-url input (default https://github.com) used to build the release lookup (redirect), binary download, matcher, and API fallback URLs. By default the external rhysd/actionlint tool is always fetched from public github.com, so the GHES API is never queried for it; GHES users who mirror rhysd/actionlint can point the action at their own server.
…description

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
@DariuszPorowski DariuszPorowski changed the title feat(action): add base-url feat(ghes): fetch tool from configurable server Jun 27, 2026
@DariuszPorowski
DariuszPorowski merged commit cfcda4a into main Jun 27, 2026
5 checks passed
@DariuszPorowski
DariuszPorowski deleted the feat/base_url branch June 27, 2026 02:23
@DariuszPorowski DariuszPorowski removed the documentation Improvements or additions to documentation label Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [bug]: using v1 gives node16 deprecation warnings 🐛 [bug]: Unable to set URL of actionlint

5 participants