Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hatch/version/edit action #203

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions hatch/version/edit/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Edit hatch version"
description: "Edit version in a hatch based package"

inputs:
version:
description: "The version to bump to"
required: true
working-directory:
description: "Where to run commands from, primarily supports monorepo setups (e.g. <sub-package-dir>/"
default: "./"

runs:
using: composite
steps:
- name: "[DEBUG] Inputs"
shell: bash
run: |
echo "==========INPUTS=========="
echo version : ${{ inputs.version }}
echo working-directory : ${{ inputs.working-directory }}

- name: "Bump version to `${{ inputs.version }}`"
shell: bash
run: hatch version ${{ inputs.version }}
working-directory: ${{ inputs.working-directory }}

- name: "Commit and push changes"
id: commit
uses: ./github/commit/create
with:
message: "bump version to ${{ inputs.version }}"
Comment on lines +22 to +31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a hatch command and a commit. I don't see why we would pull this out into a separate action. Whenever we need to bump the version (realistically just during release) we should just directly call the hatch command and then commit, not bury it in an action.


- name: "[INFO] Bump hatch version"
shell: bash
run: echo "::notice title=$TITLE::$MESSAGE"
env:
TITLE: "[${{ env.NOTIFICATION_PREFIX }}]: Bump hatch version"
MESSAGE: "Bumped from `${{ needs.current-version.outputs.version }}` to `${{ inputs.version }}`"

- name: "[DEBUG] Outputs"
shell: bash
run: |
echo "==========OUTPUTS=========="
echo N/A