From cb0df9638a0815e8bf459922ac4e8c61a821a70e Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 12 Jun 2024 15:28:20 +0200 Subject: [PATCH 1/4] Update tag message template --- tag-version/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tag-version/action.yml b/tag-version/action.yml index 91e10c0..30a4138 100644 --- a/tag-version/action.yml +++ b/tag-version/action.yml @@ -9,7 +9,7 @@ inputs: default: "${VERSION}" tag_message_template: description: The template for the git tag message - default: "BUMP ${VERSION}" + default: "Release ${VERSION}" push_tag: description: Whether to push the tag default: "true" @@ -55,4 +55,4 @@ runs: echo "### Pushed tag: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY else echo "### Created tag (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY - fi \ No newline at end of file + fi From fece8febeb918649aadf8f9a16e309c97c6a2c52 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 12 Jun 2024 15:30:12 +0200 Subject: [PATCH 2/4] Don't print bump/tag output as headings --- bump-version/action.yml | 6 +++--- tag-version/action.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bump-version/action.yml b/bump-version/action.yml index 0ab6c83..9df8ea3 100644 --- a/bump-version/action.yml +++ b/bump-version/action.yml @@ -40,7 +40,7 @@ runs: run: | if [ ${{ inputs.push_commit }} == "true" ]; then git push origin - echo "### Pushed version bump: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + echo "Pushed version bump: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY else - echo "### Created version bump (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY - fi \ No newline at end of file + echo "Created version bump (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + fi diff --git a/tag-version/action.yml b/tag-version/action.yml index 30a4138..cc21d9b 100644 --- a/tag-version/action.yml +++ b/tag-version/action.yml @@ -52,7 +52,7 @@ runs: run: | if [ ${{ inputs.push_tag }} == "true" ]; then git push origin --tags - echo "### Pushed tag: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + echo "Pushed tag: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY else - echo "### Created tag (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + echo "Created tag (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY fi From d45f6d2ac1d9b3fd9c592ae422fd2a2e447d9fd5 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 13 Jun 2024 12:51:01 +0200 Subject: [PATCH 3/4] Make version_bump_script optional --- bump-version/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bump-version/action.yml b/bump-version/action.yml index 9df8ea3..63a30b1 100644 --- a/bump-version/action.yml +++ b/bump-version/action.yml @@ -6,7 +6,7 @@ inputs: required: true version_bump_script: description: The version bump script - required: true + default: '' commit_template: description: The template for the git commit message default: "BUMP ${VERSION}" @@ -21,6 +21,7 @@ runs: using: composite steps: - name: Set new version + if: ${{ inputs.version_bump_script != '' }} shell: bash -eux {0} run: | ${{ inputs.version_bump_script }} ${{ inputs.version }} From 4122b7f0ea651140f3fb9af6162965cb24557164 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 13 Jun 2024 12:51:07 +0200 Subject: [PATCH 4/4] Make variable usages more consistent --- bump-version/action.yml | 12 ++++++------ tag-version/action.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bump-version/action.yml b/bump-version/action.yml index 63a30b1..9fc8049 100644 --- a/bump-version/action.yml +++ b/bump-version/action.yml @@ -28,20 +28,20 @@ runs: - name: Get the commit message shell: bash -eux {0} run: | - export VERSION=${{inputs.version}} - export COMMIT_MESSAGE=$(echo "${{inputs.commit_template}}" | envsubst) + export VERSION=${{ inputs.version }} + export COMMIT_MESSAGE=$(echo "${{ inputs.commit_template }}" | envsubst) echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV - name: Commit the version bump uses: mongodb-labs/drivers-github-tools/git-sign@v2 with: - command: git commit -a -m \"${{env.COMMIT_MESSAGE}}\" -s --gpg-sign=${{ env.GPG_KEY_ID }} - artifactory_image: ${{inputs.artifactory_image}} + command: git commit -a -m \"${{ env.COMMIT_MESSAGE }}\" -s --gpg-sign=${{ env.GPG_KEY_ID }} + artifactory_image: ${{ inputs.artifactory_image }} - name: Push the commit to the source branch shell: bash -eux {0} run: | if [ ${{ inputs.push_commit }} == "true" ]; then git push origin - echo "Pushed version bump: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + echo "Pushed version bump: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY else - echo "Created version bump (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + echo "Created version bump (no push): ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY fi diff --git a/tag-version/action.yml b/tag-version/action.yml index cc21d9b..55cfca3 100644 --- a/tag-version/action.yml +++ b/tag-version/action.yml @@ -23,14 +23,14 @@ runs: - name: Get the tag shell: bash -eux {0} run: | - export VERSION=${{inputs.version}} - export TAG=$(echo "${{inputs.tag_template}}" | envsubst) + export VERSION=${{ inputs.version }} + export TAG=$(echo "${{ inputs.tag_template }}" | envsubst) echo "TAG=$TAG" >> $GITHUB_ENV - name: Get the tag message shell: bash -eux {0} run: | - export VERSION=${{inputs.version}} - export TAG_MESSAGE=$(echo "${{inputs.tag_message_template}}" | envsubst) + export VERSION=${{ inputs.version }} + export TAG_MESSAGE=$(echo "${{ inputs.tag_message_template }}" | envsubst) echo "TAG_MESSAGE=$TAG_MESSAGE" >> $GITHUB_ENV - name: Tag the version uses: mongodb-labs/drivers-github-tools/git-sign@v2 @@ -52,7 +52,7 @@ runs: run: | if [ ${{ inputs.push_tag }} == "true" ]; then git push origin --tags - echo "Pushed tag: ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + echo "Pushed tag: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY else - echo "Created tag (no push): ${{inputs.version}}" >> $GITHUB_STEP_SUMMARY + echo "Created tag (no push): ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY fi