diff --git a/.github/workflows/bumpversion.yaml b/.github/workflows/bumpversion.yaml index c43e2e2..76e8e65 100644 --- a/.github/workflows/bumpversion.yaml +++ b/.github/workflows/bumpversion.yaml @@ -17,12 +17,12 @@ jobs: - name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: "${{ secrets.GITHUB_TOKEN }}" changelog_increment_filename: body.md - name: Release uses: softprops/action-gh-release@v1 with: body_path: "body.md" - tag_name: ${{ env.REVISION }} + tag_name: "${{ env.REVISION }}" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/test_action.yml b/.github/workflows/test_action.yml index 42f53a3..03ebc3a 100644 --- a/.github/workflows/test_action.yml +++ b/.github/workflows/test_action.yml @@ -10,13 +10,13 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} + ref: "${{ github.event.pull_request.head.ref }}" + repository: "${{ github.event.pull_request.head.repo.full_name }}" fetch-depth: 0 # ensures that tags are fetched, seems to be needed - name: Capture commit id id: capture run: | - COMMIT_ID=$(git rev-parse ${{ github.head_ref }}) + COMMIT_ID="$(git rev-parse "${{ github.head_ref }}")" echo "The sha of the starting commit is $COMMIT_ID" echo "::set-output name=commit::$COMMIT_ID" - name: create test commit @@ -29,27 +29,27 @@ jobs: - name: test action uses: ./ with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: "${{ secrets.GITHUB_TOKEN }}" commit: false push: false - uses: actions/checkout@v2 with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} + ref: "${{ github.event.pull_request.head.ref }}" + repository: "${{ github.event.pull_request.head.repo.full_name }}" fetch-depth: 0 # ensures that tags are fetched, seems to be needed path: new_head - name: Test push run: | cd new_head - last_pushed_commit=$(git rev-parse ${{ github.head_ref }}) - echo "Commit sha on origin : $last_pushed_commit" - if [[ $last_pushed_commit != ${{steps.capture.outputs.commit}} ]]; then + last_pushed_commit="$(git rev-parse "${{ github.head_ref }}")" + echo "Commit sha on origin: $last_pushed_commit" + if [[ $last_pushed_commit != ${{ steps.capture.outputs.commit }} ]]; then echo "Something got pushed to ${{ github.head_ref }}" exit 1 fi - name: Test commit run: | - commit_message=$(git log -1 HEAD --pretty=format:%s) + commit_message="$(git log -1 HEAD --pretty=format:%s)" echo "Latest commit: $commit_message" if [[ $commit_message != "feat: test feature" ]]; then echo "The latest commit message is not 'feat: test feature'" diff --git a/entrypoint.sh b/entrypoint.sh index ea55b49..3146a46 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -44,10 +44,13 @@ if [[ $INPUT_COMMIT == 'false' ]]; then CZ_CMD+=('--files-only') fi if [[ $INPUT_CHANGELOG_INCREMENT_FILENAME ]]; then - CZ_CMD+=('--changelog-to-stdout' ">$INPUT_CHANGELOG_INCREMENT_FILENAME") + CZ_CMD+=('--changelog-to-stdout') + echo "${CZ_CMD[@]}" ">$INPUT_CHANGELOG_INCREMENT_FILENAME" + "${CZ_CMD[@]}" >"$INPUT_CHANGELOG_INCREMENT_FILENAME" +else + echo "${CZ_CMD[@]}" + "${CZ_CMD[@]}" fi -echo "${CZ_CMD[@]}" -"${CZ_CMD[@]}" REV="$(cz version --project)" echo "REVISION=${REV}" >>"$GITHUB_ENV"