From 2caaadb22e95b688d8755307c8d772f6dae83982 Mon Sep 17 00:00:00 2001 From: Rene Barak Date: Wed, 25 Jun 2025 11:30:31 -0400 Subject: [PATCH] feat: add support for custom github url --- README.md | 1 + action.yml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9c377f..adfeacc 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ jobs: | Input | Description | Required | Default | | --------------------- | ------------------------------------------------------------------------------------------------------- | -------- | --------------------------------- | | `github-token` | GitHub token for posting comments | No | `${{ github.token }}` | +| `github-url` | GitHub URL to be used for running an action | No | `https://github.com` | | `github-issue-number` | GitHub issue number where the status comment will be posted | No | Current issue from GitHub context | | `github-username` | GitHub username of the user for whom the workspace is being started (requires Coder 2.21 or newer) | No | - | | `coder-username` | Coder username to override default user mapping (only set one of `github-username` or `coder-username`) | No | - | diff --git a/action.yml b/action.yml index 9e8c972..e52e608 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,10 @@ inputs: description: 'GitHub token for posting the status comment' required: false default: ${{ github.token }} + github-url: + description: 'GitHub URL to be used for running an action' + required: false + default: 'https://github.com' github-issue-number: description: 'GitHub issue number where the status comment will be posted (defaults to current issue context)' required: false @@ -44,7 +48,7 @@ runs: core.setFailed('No issue number provided and no issue context available'); return; } - const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + const runUrl = `${{ inputs.github-url }}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; const comment = await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo,