Skip to content

Commit 26597e2

Browse files
authored
feat(github-actions): add an action build directive to toggle the --skip-build option (#1044)
* docs(commands): update definition of the version commands `--skip-build` option * docs(github-actions): add description of the `build` input directive
1 parent 6a37159 commit 26597e2

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

action.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ ARGS+=("$(eval_boolean_action_input "tag" "$INPUT_TAG" "--tag" "--no-tag")") ||
3434
ARGS+=("$(eval_boolean_action_input "push" "$INPUT_PUSH" "--push" "--no-push")") || exit 1
3535
ARGS+=("$(eval_boolean_action_input "changelog" "$INPUT_CHANGELOG" "--changelog" "--no-changelog")") || exit 1
3636
ARGS+=("$(eval_boolean_action_input "vcs_release" "$INPUT_VCS_RELEASE" "--vcs-release" "--no-vcs-release")") || exit 1
37+
ARGS+=("$(eval_boolean_action_input "build" "$INPUT_BUILD" "" "--skip-build")") || exit 1
3738

3839
# Handle --patch, --minor, --major
3940
# https://stackoverflow.com/a/47541882

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ inputs:
9595
description: |
9696
Whether or not to create a release in the remote VCS, if supported
9797
98+
build:
99+
type: string
100+
required: false
101+
description: |
102+
Whether or not to run the build_command for the project. Defaults are
103+
handled by python-semantic-release internal version command.
104+
98105
build_metadata:
99106
type: string
100107
required: false

docs/automatic-releases/github-actions.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,31 @@ outlines each supported input and its purpose.
6868

6969
----
7070

71+
.. _gh_actions-psr-inputs-build:
72+
73+
``build``
74+
""""""""
75+
76+
**Type:** ``Literal["true", "false"]``
77+
78+
Override whether the action should execute the build command or not. This option is
79+
equivalent to adding the command line switch ``--skip-build`` (when ``false``) to
80+
the :ref:`version <cmd-version>` command. If set to ``true``, no command line switch
81+
is passed and the default behavior of the :ref:`version <cmd-version>` is used.
82+
83+
**Required:** ``false``
84+
85+
.. note::
86+
If not set or set to ``true``, the default behavior is defined by the
87+
:ref:`version <cmd-version>` command and any user :ref:`configurations <config-root>`.
88+
89+
.. seealso::
90+
91+
- :ref:`cmd-version-option-skip_build` option for the :ref:`version <cmd-version>`
92+
command.
93+
94+
----
95+
7196
.. _gh_actions-psr-inputs-build_metadata:
7297

7398
``build_metadata``

docs/commands.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,13 @@ remote VCS, this option will not cause a command failure, but will produce a war
367367
**Default:** ``--no-vcs-release`` if ``--no-push`` is supplied (including where this is
368368
implied by supplying only ``--no-commit``), otherwise ``--vcs-release``
369369

370+
.. _cmd-version-option-skip_build:
371+
370372
``--skip-build``
371373
****************
372374

373-
If passed, skip building the current project using :ref:`build_command <config-build_command>`.
375+
If passed, skip execution of the :ref:`build_command <config-build_command>` after
376+
version stamping and changelog generation.
374377

375378
.. _cmd-publish:
376379

0 commit comments

Comments
 (0)