Skip to content

Conversation

@eggyhead
Copy link
Contributor

@eggyhead eggyhead commented Jan 31, 2024

What are we doing?

Currently, we are only checking equality against github.com to ensure artifact and cache actions are being run in a non-enterprise host. We need to update this check to allow requests from ghe.com and ghe.localhost, additional allowed hostnames for production and local development.

Fixes https://github.com/github/actions-results-team/issues/2208

How are we doing it?

  • We are including the known GItHub hostnames in the negative condition for isGhes

How do I test?

  • Run upload or download artifact from an allowed host using this toolkit package version


const hostname = ghUrl.hostname.trimEnd().toUpperCase()
const isGitHubHost = (hostname == 'GITHUB.COM')
const isProximaHost = (hostname.endsWith('GHE.COM') || hostname.endsWith('GHE.LOCALHOST'))

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization

'[GHE.COM](1)' may be preceded by an arbitrary host name.
updating alowed hosts in artifact ghes check

using dot prepend ghe host
@eggyhead eggyhead force-pushed the eggyhead/ghescheck-updatehosts branch from 1e316cc to 3b02a6f Compare January 31, 2024 16:31
@eggyhead eggyhead marked this pull request as ready for review January 31, 2024 17:14
@eggyhead eggyhead requested review from a team as code owners January 31, 2024 17:14
Copy link

@chrisimap32 chrisimap32 left a comment

Choose a reason for hiding this comment

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

R

@chrisimap32
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants