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 alternative git provider #226

Merged
merged 3 commits into from
Oct 19, 2023
Merged
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,20 @@ Set check-last-commit-only to only read last commit's message (optional). Exampl
check-last-commit-only: 'true'
```

#### **custom-git-domain:**

Set a custom domain of the git instance (optional). This is only needed, when using self-hosted instances of GitHub or alternative git provider (e.g. Gitea).
Example:

```yaml
- name: 'Automated Version Bump'
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
custom-git-domain: 'github.com'
```

#### [DEPRECATED] **push:**
**DEPRECATED** Set false you want to avoid pushing the new version tag/package.json. Example:
```yaml
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ inputs:
required: false
skip-push:
description: 'If true, skip pushing any commits or tags created after the version bump'
default: false
default: 'false'
required: false
PACKAGEJSON_DIR:
description: 'Custom dir to the package'
Expand Down Expand Up @@ -74,6 +74,10 @@ inputs:
description: 'Check only last commit message'
default: 'false'
required: false
custom-git-domain:
description: 'Set a custom domain of the git instance'
default: 'github.com'
required: false
push:
description: '[DEPRECATED] Set to false to skip pushing the new tag'
default: 'true'
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const pkg = getPackageJson();
);
}

const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git`;
const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@${process.env['INPUT_CUSTOM-GIT-DOMAIN'] || "github.com"}/${process.env.GITHUB_REPOSITORY}.git`;
if (process.env['INPUT_SKIP-TAG'] !== 'true') {
await runInWorkspace('git', ['tag', newVersion]);
if (process.env['INPUT_SKIP-PUSH'] !== 'true') {
Expand Down