evergreen icon indicating copy to clipboard operation
evergreen copied to clipboard

Automatically configure the GitHub server URL

Open martincostello opened this issue 1 year ago • 3 comments

GitHub Actions provides information about the URLs associated with the GitHub instance running the action, whether that is GitHub.com or GitHub Enterprise Server via the following properties of the github context:

  • api_url
  • graphql_url
  • server_url

Accordingly, when run as a GitHub Action (not as a standalone container), the action could self-configure itself for the current environment, only requiring the URL to be specified if it does not match the execution environment. This would make the action "just work™️" in GitHub Enterprise Server without having to explicitly configure the action.

For example:

---
name: 'Evergreen action'
author: 'github'
description: 'A GitHub Action to request dependabot enablement on eligible repositories in an organization.'
runs:
  using: 'docker'
  image: 'docker://ghcr.io/github/evergreen:v1'
+ env:
+   GH_ENTERPRISE_URL: ${{ github.server_url }}
branding:
  icon: 'file-plus'
  color: 'green'

In this scenario, renaming the variable to GH_URL would probably make the most sense, but it could be still be optional when using the container directly as it is today.

martincostello avatar Jan 27 '24 14:01 martincostello

Is this still open?

Abdallah-Afifi avatar Feb 20 '24 10:02 Abdallah-Afifi

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Mar 13 '24 01:03 github-actions[bot]

Yes this is still open @Abdallah-Afifi

zkoppert avatar Mar 14 '24 17:03 zkoppert