Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for GHES #216

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Also, the following general options are supported:
so make sure to add it as secret, not as environment variable, in the GitHub
workflow file!

- `GHE_HOSTNAME`: If provided, the action can be used with GitHub Enterprise Server (GHES) instead of github.com. For example, `github.company.com`. HTTPS is assumed, as is the API endpoint at `/api/v3`.

- `PULL_REQUEST`: If provided, this action will attempt to merge the specified pull request. By default, it will attempt to use the pull request specified in the GitHub context. If a pull request number is provided via this input, this action will search in the current repo for the provided pull request number. If you want to merge a pull request in another repo, just provide the repo slug before the pull request number, like `Some-Org/Some-Repo/1234`

- `BASE_BRANCHES`: If provided, the action will be restricted in terms of base branches. Can be comma-separated list of simple branch names (i.e `main,dev`).
Expand Down
2 changes: 2 additions & 0 deletions bin/automerge.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ async function main() {
checkOldConfig();

const token = env("GITHUB_TOKEN");
const baseUrl = "https://" + process.env.GHE_HOSTNAME + "/api/v3" || "https://api.github.com";

const octokit = new Octokit({
auth: `token ${token}`,
baseUrl: baseUrl,
userAgent: "pascalgn/automerge-action"
});

Expand Down