Skip to content

Commit 7edc545

Browse files
authored
Minor improvements to bump and tag actions (#33)
1 parent e796a48 commit 7edc545

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

bump-version/action.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
required: true
77
version_bump_script:
88
description: The version bump script
9-
required: true
9+
default: ''
1010
commit_template:
1111
description: The template for the git commit message
1212
default: "BUMP ${VERSION}"
@@ -21,26 +21,27 @@ runs:
2121
using: composite
2222
steps:
2323
- name: Set new version
24+
if: ${{ inputs.version_bump_script != '' }}
2425
shell: bash -eux {0}
2526
run: |
2627
${{ inputs.version_bump_script }} ${{ inputs.version }}
2728
- name: Get the commit message
2829
shell: bash -eux {0}
2930
run: |
30-
export VERSION=${{inputs.version}}
31-
export COMMIT_MESSAGE=$(echo "${{inputs.commit_template}}" | envsubst)
31+
export VERSION=${{ inputs.version }}
32+
export COMMIT_MESSAGE=$(echo "${{ inputs.commit_template }}" | envsubst)
3233
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
3334
- name: Commit the version bump
3435
uses: mongodb-labs/drivers-github-tools/git-sign@v2
3536
with:
36-
command: git commit -a -m \"${{env.COMMIT_MESSAGE}}\" -s --gpg-sign=${{ env.GPG_KEY_ID }}
37-
artifactory_image: ${{inputs.artifactory_image}}
37+
command: git commit -a -m \"${{ env.COMMIT_MESSAGE }}\" -s --gpg-sign=${{ env.GPG_KEY_ID }}
38+
artifactory_image: ${{ inputs.artifactory_image }}
3839
- name: Push the commit to the source branch
3940
shell: bash -eux {0}
4041
run: |
4142
if [ ${{ inputs.push_commit }} == "true" ]; then
4243
git push origin
43-
echo "### Pushed version bump: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY
44+
echo "Pushed version bump: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
4445
else
45-
echo "### Created version bump (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY
46-
fi
46+
echo "Created version bump (no push): ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
47+
fi

tag-version/action.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
default: "${VERSION}"
1010
tag_message_template:
1111
description: The template for the git tag message
12-
default: "BUMP ${VERSION}"
12+
default: "Release ${VERSION}"
1313
push_tag:
1414
description: Whether to push the tag
1515
default: "true"
@@ -23,14 +23,14 @@ runs:
2323
- name: Get the tag
2424
shell: bash -eux {0}
2525
run: |
26-
export VERSION=${{inputs.version}}
27-
export TAG=$(echo "${{inputs.tag_template}}" | envsubst)
26+
export VERSION=${{ inputs.version }}
27+
export TAG=$(echo "${{ inputs.tag_template }}" | envsubst)
2828
echo "TAG=$TAG" >> $GITHUB_ENV
2929
- name: Get the tag message
3030
shell: bash -eux {0}
3131
run: |
32-
export VERSION=${{inputs.version}}
33-
export TAG_MESSAGE=$(echo "${{inputs.tag_message_template}}" | envsubst)
32+
export VERSION=${{ inputs.version }}
33+
export TAG_MESSAGE=$(echo "${{ inputs.tag_message_template }}" | envsubst)
3434
echo "TAG_MESSAGE=$TAG_MESSAGE" >> $GITHUB_ENV
3535
- name: Tag the version
3636
uses: mongodb-labs/drivers-github-tools/git-sign@v2
@@ -52,7 +52,7 @@ runs:
5252
run: |
5353
if [ ${{ inputs.push_tag }} == "true" ]; then
5454
git push origin --tags
55-
echo "### Pushed tag: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY
55+
echo "Pushed tag: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
5656
else
57-
echo "### Created tag (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY
58-
fi
57+
echo "Created tag (no push): ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
58+
fi

0 commit comments

Comments
 (0)