From ca5c7b6b98c0e312915efdaae54702092a1b4854 Mon Sep 17 00:00:00 2001 From: Hiraku Date: Tue, 17 Oct 2023 21:11:03 +0200 Subject: [PATCH 1/3] feat: add support for alternative git provider --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8c02fff..537a500 100644 --- a/index.js +++ b/index.js @@ -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.CUSTOM_GIT_URL || "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') { From ecc5ee18affa2fa7dca9c41f562ebe1cae0e7325 Mon Sep 17 00:00:00 2001 From: Hiraku Date: Wed, 18 Oct 2023 15:13:27 +0200 Subject: [PATCH 2/3] fix syntax error --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index badf092..ea8468a 100644 --- a/action.yml +++ b/action.yml @@ -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' From e7dcfa86ed26bc0ffc08712b63cdc7afbe83b0c1 Mon Sep 17 00:00:00 2001 From: Hiraku Date: Wed, 18 Oct 2023 15:16:06 +0200 Subject: [PATCH 3/3] fix: add proposed changes --- README.md | 14 ++++++++++++++ action.yml | 4 ++++ index.js | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 63d2a0a..15eafb6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index ea8468a..58d47ba 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/index.js b/index.js index 537a500..cacd2e0 100644 --- a/index.js +++ b/index.js @@ -240,7 +240,7 @@ const pkg = getPackageJson(); ); } - const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@${process.env.CUSTOM_GIT_URL || "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') {