zx-bulk-release 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [1.3.0](https://github.com/semrel-extra/zx-bulk-release/compare/v1.2.0...v1.3.0) (2022-06-21)
2
+
3
+ ### Features
4
+ * feat: add gh username and token env aliases ([892bfdc](https://github.com/semrel-extra/zx-bulk-release/commit/892bfdc86215a0532939f24ca4a2690d69e8d59e))
5
+
1
6
  ## [1.2.0](https://github.com/semrel-extra/zx-bulk-release/compare/v1.1.2...v1.2.0) (2022-06-21)
2
7
 
3
8
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "zx-based alternative for multi-semantic-release",
5
5
  "type": "module",
6
6
  "exports": "./src/main/js/index.js",
@@ -1,5 +1,5 @@
1
1
  import {formatTag, getLatestTag} from './tag.js'
2
- import {tempy, ctx, fs, path, $} from 'zx-extra'
2
+ import {tempy, ctx, fs, path} from 'zx-extra'
3
3
  import {copydir} from 'git-glob-cp'
4
4
 
5
5
  const branches = {}
@@ -7,12 +7,14 @@ const META_VERSION = '1'
7
7
 
8
8
  export const getOrigin = (cwd) => ctx(async ($) => {
9
9
  $.cwd = cwd
10
- const gitAuth = `${$.env.GH_USER}:${$.env.GITHUB_TOKEN || $.env.GH_TOKEN}`
10
+ const {GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN} = $.env
11
+ const username = GH_USER || GITHUB_USER || GH_USERNAME || GITHUB_USERNAME
12
+ const token = GH_TOKEN || GITHUB_TOKEN
11
13
  const originUrl = (await $`git config --get remote.origin.url`).toString().trim()
12
14
  const [,,repoHost, repoName] = originUrl.replace(':', '/').replace(/\.git/, '').match(/.+(@|\/\/)([^/]+)\/(.+)$/) || []
13
15
 
14
- return repoHost && $.env.GH_USER?
15
- `https://${gitAuth}@${repoHost}/${repoName}`
16
+ return token && username && repoHost && repoName?
17
+ `https://${username}:${token}@${repoHost}/${repoName}`
16
18
  : originUrl
17
19
  })
18
20
 
@@ -121,4 +123,4 @@ export const getLatest = async (cwd, name) => {
121
123
  tag,
122
124
  meta
123
125
  }
124
- }
126
+ }