From 013f0647d0d0968dcf049cca241b6fb46dfe1bcc Mon Sep 17 00:00:00 2001 From: apr-1985 Date: Mon, 15 Nov 2021 09:12:31 +0000 Subject: [PATCH 1/6] Update test.yml --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07eb840..a01c46b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -138,6 +138,36 @@ jobs: with: github-token: ${{ secrets.github_token }} skip-commit: 'true' + + test-git-no-pull: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + path: "./" + + - run: npm ci --prod + + - run: "git config --global user.email 'changelog@github.com'" + - run: "git config --global user.name 'Awesome Github action'" + + - run: git tag | xargs git tag -d + - name: Create fake tag + run: "git tag -a 'v0.55.8' -m 'v0.55.8'" + - run: "git add . && git commit -m 'fix: Added fake file so version will be bumped'" + + - name: Generate changelog + id: changelog + uses: ./ + env: + ENV: 'dont-use-git' + EXPECTED_TAG: 'v0.55.9' + SKIPPED_COMMIT: true + with: + github-token: ${{ secrets.github_token }} + skip-commit: 'true' + skip-git-pull: 'true' test-git-fallback: runs-on: ubuntu-latest From 865880cdc6f4a140053206cecbe3bfbfbc2ec0ea Mon Sep 17 00:00:00 2001 From: apr-1985 Date: Mon, 15 Nov 2021 09:17:27 +0000 Subject: [PATCH 2/6] chore: run test job --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a01c46b..e464627 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,8 @@ name: 'Test the action' on: + push: + branches: + - skip_git_pull-1 pull_request: branches: - master From ac4ebd34bbfd83c3fd4393281995c052760ea02c Mon Sep 17 00:00:00 2001 From: apr-1985 Date: Mon, 15 Nov 2021 09:34:08 +0000 Subject: [PATCH 3/6] chore: allow test to work --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e464627..7de2cd0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -129,6 +129,7 @@ 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 From 73e939a72d7ef53558280f4644f2dc5b2ef8aaa3 Mon Sep 17 00:00:00 2001 From: apr-1985 Date: Mon, 15 Nov 2021 09:35:39 +0000 Subject: [PATCH 4/6] chore: fix my test --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7de2cd0..4f861ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -159,6 +159,7 @@ 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 From 5c73ddeb477eb532bc4443dba1b773fef9e9a0c8 Mon Sep 17 00:00:00 2001 From: apr-1985 Date: Wed, 17 Nov 2021 10:11:43 +0000 Subject: [PATCH 5/6] chore: test breaking the expectedCommands --- src/helpers/git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/git.js b/src/helpers/git.js index f77058f..80679d5 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -166,7 +166,7 @@ module.exports = new (class Git { const expectedCommands = [ 'git config user.name "Conventional Changelog Action"', 'git config user.email "conventional.changelog.action@github.com"', - 'git pull --tags --ff-only', + 'git upll --tags --ff-only', ] if (!SKIPPED_COMMIT) { From a85ab5798acc7142b08c485b6d55dd33c835ac77 Mon Sep 17 00:00:00 2001 From: apr-1985 Date: Wed, 17 Nov 2021 10:13:42 +0000 Subject: [PATCH 6/6] chore: revert change to expectedCommands --- src/helpers/git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/git.js b/src/helpers/git.js index 80679d5..f77058f 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -166,7 +166,7 @@ module.exports = new (class Git { const expectedCommands = [ 'git config user.name "Conventional Changelog Action"', 'git config user.email "conventional.changelog.action@github.com"', - 'git upll --tags --ff-only', + 'git pull --tags --ff-only', ] if (!SKIPPED_COMMIT) {