Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add support for custom github url #3

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | - |
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down