github-community-projects / github-community-projects/evergreen

Automatically configure the GitHub server URL

Open
#32 3 comments 0 reactions 0 assignees View on GitHub
enhancement keep ready-for-work
Dominant language
Python
Stars
226
Forks
25
Avg merge
2h 16m
Merged PRs (30d)
14

Description

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`](https://docs.github.com/actions/learn-github-actions/contexts#github-context) 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:

```diff
---
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.