-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add version input and use in commit message
Use version instead of git sha in commit message and title if provided
- Loading branch information
1 parent
adb9b52
commit c838ae3
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,10 @@ on: | |
required: false | ||
type: string | ||
default: "service" | ||
version: | ||
required: false | ||
type: string | ||
description: Version to use in commit message and PR title. If not provided, git sha is used. | ||
close-existing-prs: | ||
required: false | ||
type: boolean | ||
|
@@ -86,15 +90,25 @@ jobs: | |
echo "BRANCH=update-${{ matrix.environment }}-to-${{ github.sha }}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Set commit message | ||
id: set-commit-message | ||
run: | | ||
if [ "${{ inputs.version }}" != "" ] | ||
then | ||
echo "COMMIT_MESSAGE=Bump \`${{ inputs.service }}\` to version \`${{ inputs.version }}\` in \'${{ matrix.environment }}\'" >> $GITHUB_OUTPUT | ||
else | ||
echo "COMMIT_MESSAGE=Bump \`${{ inputs.service }}\` to \`${{ github.sha }}\` in \'${{ matrix.environment }}\'" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Create Pull Request | ||
id: cpr | ||
# v3.14.0 | ||
uses: peter-evans/create-pull-request@6cd32fd93684475c31847837f87bb135d40a2b79 | ||
with: | ||
path: ${{ inputs.working-directory }} | ||
token: ${{ steps.generate_token.outputs.token }} | ||
commit-message: Bump ${{ inputs.service }} to ${{ github.sha }} in ${{ matrix.environment }} | ||
title: Bump ${{ inputs.service }} to ${{ github.sha }} in ${{ matrix.environment }} | ||
commit-message: ${{ steps.set-commit-message.outputs.COMMIT_MESSAGE }} | ||
title: ${{ steps.set-commit-message.outputs.COMMIT_MESSAGE }} | ||
committer: GitHub <[email protected]> | ||
author: GitHub <[email protected]> | ||
branch: ${{ steps.set-branch-name.outputs.BRANCH }} | ||
|