diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f861ea..eddf199 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,5 @@ name: 'Test the action' on: - push: - branches: - - skip_git_pull-1 pull_request: branches: - master @@ -129,7 +126,6 @@ jobs: - run: git tag | xargs git tag -d - name: Create fake tag run: "git tag -a 'v0.55.8' -m 'v0.55.8'" - - run: "echo 'askjfhsadjkfh' > banana.txt" - run: "git add . && git commit -m 'fix: Added fake file so version will be bumped'" - name: Generate changelog @@ -159,7 +155,6 @@ jobs: - run: git tag | xargs git tag -d - name: Create fake tag run: "git tag -a 'v0.55.8' -m 'v0.55.8'" - - run: "echo 'askjfhsadjkfh' > banana.txt" - run: "git add . && git commit -m 'fix: Added fake file so version will be bumped'" - name: Generate changelog @@ -169,6 +164,7 @@ jobs: ENV: 'dont-use-git' EXPECTED_TAG: 'v0.55.9' SKIPPED_COMMIT: true + SKIPPED_PULL: true with: github-token: ${{ secrets.github_token }} skip-commit: 'true' diff --git a/src/helpers/git.js b/src/helpers/git.js index f77058f..b35cf0c 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -161,14 +161,17 @@ module.exports = new (class Git { */ testHistory = () => { if (ENV === 'dont-use-git') { - const { EXPECTED_TAG, SKIPPED_COMMIT, EXPECTED_NO_PUSH } = process.env + const { EXPECTED_TAG, SKIPPED_COMMIT, EXPECTED_NO_PUSH, SKIPPED_PULL } = process.env const expectedCommands = [ 'git config user.name "Conventional Changelog Action"', 'git config user.email "conventional.changelog.action@github.com"', - 'git pull --tags --ff-only', ] + if (!SKIPPED_PULL) { + expectedCommands.push('git pull --tags --ff-only') + } + if (!SKIPPED_COMMIT) { expectedCommands.push('git add .') expectedCommands.push(`git commit -m "chore(release): ${EXPECTED_TAG}"`)