fix: Test release

releases/v3
Tycho Bokdam 2019-10-18 11:19:37 +02:00
parent 37217f530c
commit d0cd7bf31f
No known key found for this signature in database
GPG Key ID: A0FAE77C8CDF33C7
1 changed files with 17 additions and 1 deletions

View File

@ -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}`)
) )
/** /**