raven-actions / actionlint

✅ Run actionlint in your GitHub workflow
https://github.com/marketplace/actions/actionlint
MIT License
23 stars 1 forks source link

🐛 [bug]: Unable to set URL of actionlint #14

Open bhundven opened 12 months ago

bhundven commented 12 months ago

🐛 What happened?

Environmnet:

The action is trying to look for the latest version of rhysd/actionlint on our local GHES instance. Of course it is not there. I don't see a way to set the url to point at https://github.com/ instead.

🔬 How to reproduce?

See code sample/log

🏗️ Code Sample / Log

Workflow:

  actionlint:
    name: 'ActionLint'
    runs-on: [self-hosted]
      steps:
        - uses: actions/checkout@v3
        - uses: axon-actions/actionlint@v1

Output:

RequestError [HttpError]: Not Found
    at /runner/_work/_actions/actions/github-script/v6/dist/index.js:6842:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getToolReleaseLatest (eval at callAsyncFunction (/runner/_work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:58:20)
    at async eval (eval at callAsyncFunction (/runner/_work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:77:7)
    at async main (/runner/_work/_actions/actions/github-script/v6/dist/index.js:15236:20) {
  status: 404,
  response: {
    url: 'https://<redacted url for GHES>/api/v3/repos/rhysd/actionlint/releases/latest',
    status: 404,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
      connection: 'close',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Wed, 01 Nov 2023 16:51:34 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'GitHub.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains',
      'transfer-encoding': 'chunked',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-enterprise-version': '3.8.10',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': '3cb06c66-301c-488c-9774-5f7382604551',
      'x-runtime-rack': '0.024953',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Not Found',
      documentation_url: 'https://docs.github.com/enterprise-server@3.8/rest/reference/repos#get-the-latest-release'
    }
  },
  request: {
    method: 'GET',
    url: 'https://<redacted url for GHES>/api/v3/repos/rhysd/actionlint/releases/latest',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'actions/github-script octokit-core.js/3.6.0 Node.js/16.20.1 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { agent: [Agent], hook: [Function: bound bound register] }
  }
}
Error: Unhandled error: HttpError: Not Found

🌌 Environment (actionlint action)

1.0.2

🌌 Environment (actionlint)

1.6.26

🌌 Environment (GitHub Runner OS)

Linux

📷 Screenshots

No response

📈 Expected behavior

It would by default pull from github.com, and allow you to set the URL of your github instance in case you do want to use a local version of rhysd/actionlint

📎 Additional context

No response

📜 Code of Conduct

DariuszPorowski commented 11 months ago

@bhundven hmm good idea, will try to investigate how to handle it, because currently Action uses native GitHub SDK to determine actionlint version and the last thing what I want to do is to write own logic to do that.

bhundven commented 11 months ago

@DariuszPorowski I got some ideas on how to fix this. I'll try and get a PR together.

frederikb commented 9 months ago

@bhundven Did you ever find the time to investigate this issue further or did you find a workaround? I'm in a similar situation.

bhundven commented 7 months ago

@frederikb No, I haven't had time.

bhundven commented 7 months ago

I think this depends on #11

DariuszPorowski commented 7 months ago

@frederikb @bhundven just working on potential solution. In theory should works. Unfortunately, I do not have access to GHE so cannot fully test. https://github.com/raven-actions/actionlint/pull/22

p.s. @bhundven It does not depend on https://github.com/raven-actions/actionlint/issues/11 composite/js action after all use the same GH api.

frederikb commented 7 months ago

Thanks, @DariuszPorowski . I'll try to find some time next week to look through the changes and test drive it on a GHES instance.