fix: Test release
parent
37217f530c
commit
d0cd7bf31f
|
@ -3,6 +3,8 @@ const exec = require('@actions/exec')
|
||||||
|
|
||||||
const { GITHUB_REPOSITORY, GITHUB_REF } = process.env
|
const { GITHUB_REPOSITORY, GITHUB_REF } = process.env
|
||||||
|
|
||||||
|
const branch = GITHUB_REF.replace('refs/heads/', '')
|
||||||
|
|
||||||
module.exports = new (class Git {
|
module.exports = new (class Git {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -11,10 +13,15 @@ module.exports = new (class Git {
|
||||||
// Make the Github token secret
|
// Make the Github token secret
|
||||||
core.setSecret(githubToken)
|
core.setSecret(githubToken)
|
||||||
|
|
||||||
|
// Set config
|
||||||
this.config('user.name', 'Conventional Changelog Action')
|
this.config('user.name', 'Conventional Changelog Action')
|
||||||
this.config('user.email', 'conventional.changelog.action@github.com')
|
this.config('user.email', 'conventional.changelog.action@github.com')
|
||||||
|
|
||||||
|
// Update the origin
|
||||||
this.updateOrigin(`https://${githubToken}@github.com/${GITHUB_REPOSITORY}.git`)
|
this.updateOrigin(`https://${githubToken}@github.com/${GITHUB_REPOSITORY}.git`)
|
||||||
|
|
||||||
|
// Checkout the branch
|
||||||
|
this.checkout()
|
||||||
}
|
}
|
||||||
|
|
||||||
exec = command => new Promise(async(resolve, reject) => {
|
exec = command => new Promise(async(resolve, reject) => {
|
||||||
|
@ -77,7 +84,16 @@ module.exports = new (class Git {
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
push = () => (
|
push = () => (
|
||||||
this.exec(`push ${GITHUB_REF}`)
|
this.exec(`push origin ${branch}`)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checkout branch
|
||||||
|
*
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
checkout = () => (
|
||||||
|
this.exec(`checkout ${branch}`)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue