Skip to content

Commit

Permalink
fix: Pull full history so it works with checkout@v2
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Apr 29, 2020
1 parent 281fa8a commit 50ab4fa
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- run: yarn --production
- run: git add node_modules -f
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"homepage": "https://github.com/TriPSs/conventional-changelog-action#readme",
"dependencies": {
"@actions/core": "1.2.3",
"@actions/exec": "1.0.3",
"@actions/exec": "1.0.4",
"conventional-changelog": "3.1.18",
"conventional-recommended-bump": "6.0.5"
}
Expand Down
9 changes: 9 additions & 0 deletions src/helpers/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ module.exports = new (class Git {
this.exec(`commit -m "${message}" ${args.join(' ')}`)
)

/**
* Pull the full history
*
* @return {Promise<>}
*/
pull = () => (
this.exec(`git pull --unshallow`)
)

/**
* Push all changes
*
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ async function run() {
core.info(`Using "${outputFile}" as output file`)

conventionalRecommendedBump({ preset }, async(error, recommendation) => {
core.info('Pull to make sure we have the full git history')
await git.pull()

if (error) {
core.setFailed(error.message)

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.3.tgz#e844b4fa0820e206075445079130868f95bfca95"
integrity sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w==

"@actions/exec@1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.0.3.tgz#b967f8700d6ff011dcc91243b58bafc1bb9ab95f"
integrity sha512-TogJGnueOmM7ntCi0ASTUj4LapRRtDfj57Ja4IhPmg2fls28uVOPbAn8N+JifaOumN2UG3oEO/Ixek2A4NcYSA==
"@actions/exec@1.0.4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.0.4.tgz#99d75310e62e59fc37d2ee6dcff6d4bffadd3a5d"
integrity sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==
dependencies:
"@actions/io" "^1.0.1"

Expand Down

0 comments on commit 50ab4fa

Please sign in to comment.