chore: Test expectedCommands for skipping git pulls
parent
f7c266a578
commit
c9222a9423
|
@ -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'
|
||||
|
|
|
@ -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}"`)
|
||||
|
|
Loading…
Reference in New Issue