name: 'Test the action' on: push: branches: - skip_git_pull-1 pull_request: branches: - master jobs: test-json: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 with: path: "./" - run: npm ci --prod - run: touch ./fake-file.log - run: "git config --global user.email 'changelog@github.com'" - run: "git config --global user.name 'Awesome Github action'" - run: "git add . && git commit -m 'feat: Added fake file so version will be bumped'" - name: Generate changelog id: changelog uses: ./ env: ENV: 'dont-use-git' EXPECTED_TAG: 'v1.5.0' with: github-token: ${{ secrets.github_token }} version-file: 'test-file.json' - name: Show file run: | echo "$( banana.txt" - 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' 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: "echo 'askjfhsadjkfh' > banana.txt" - 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 steps: - name: Checkout code uses: actions/checkout@v2 with: path: "./" - run: npm ci --prod - run: touch ./fake-file.log - run: "git config --global user.email 'changelog@github.com'" - run: "git config --global user.name 'Awesome Github action'" - run: "git add . && git commit -m 'feat: Added fake file so version will be bumped'" - run: git tag | xargs git tag -d - name: Generate changelog id: changelog uses: ./ env: ENV: 'dont-use-git' EXPECTED_TAG: 'v0.1.0' SKIPPED_COMMIT: true with: github-token: ${{ secrets.github_token }} skip-commit: 'true' test-git-no-push: 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 EXPECTED_NO_PUSH: true with: github-token: ${{ secrets.github_token }} skip-commit: 'true' git-push: 'false' test-yaml: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 with: path: "./" - run: npm ci --prod - run: touch ./fake-file.log - run: "git config --global user.email 'changelog@github.com'" - run: "git config --global user.name 'Awesome Github action'" - run: "git add . && git commit -m 'feat: Added fake file so version will be bumped'" - name: Generate changelog id: changelog uses: ./ env: ENV: 'dont-use-git' EXPECTED_TAG: 'v9.5.0' with: github-token: ${{ secrets.github_token }} version-file: 'test-file.yaml' version-path: 'package.version' - name: Generate changelog uses: ./ env: ENV: 'dont-use-git' EXPECTED_TAG: 'v9.6.0' with: github-token: ${{ secrets.github_token }} version-file: 'test-file.yaml' version-path: 'package.no-quotes-version' - name: Generate changelog uses: ./ env: ENV: 'dont-use-git' EXPECTED_TAG: 'v9.7.0' with: github-token: ${{ secrets.github_token }} version-file: 'test-file.yaml' version-path: 'package.double-quotes-version' - name: Show file run: | echo "$(