Skip to content

Commit 89bdaac

Browse files
eXigentCoderr0manchak
authored andcommitted
feat(skip-ci): walk forward through skipped commits when finding last successful one
1 parent be2a366 commit 89bdaac

File tree

4 files changed

+1534
-1298
lines changed

4 files changed

+1534
-1298
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ jobs:
107107
# E.g. 'ci.yml'. If not provided, current workflow id will be used
108108
#
109109
workflow-id: ''
110+
111+
# Specifies if the NX_BASE SHA should be set to the last [skip-ci] commit that occurred after the original NX_BASE. Includes [ci skip], [no ci], [skip actions], [actions skip]. Useful if your GitHub action commits tags, version numbers, etc to the repository which should not be included
112+
# Default: false
113+
get-last-skip-ci-commit: false
110114
```
111115
112116
<!-- end configuration-options -->

action.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ inputs:
2323
default: '.'
2424
workflow-id:
2525
description: 'The ID of the workflow to track or name of the file name. E.g. ci.yml. Defaults to current workflow'
26+
get-last-skip-ci-commit:
27+
default: false
28+
description: Specifies if the NX_BASE SHA should be set to the last [skip-ci] commit that occurred after the original NX_BASE. Useful if your GitHub action commits tags, version numbers, etc to the repository which should not be included'
2629

2730
outputs:
2831
base:
@@ -49,7 +52,8 @@ runs:
4952
working_directory: ${{ inputs.working-directory }}
5053
working_id: ${{ inputs.workflow-id }}
5154
fallback_sha: ${{ inputs.fallback-sha }}
52-
run: node "$GITHUB_ACTION_PATH/dist/index.js" "$gh_token" "$main_branch_name" "$error_on_no_successful_workflow" "$last_successful_event" "$working_directory" "$working_id" "$fallback_sha"
55+
get_last_skip_ci_commit: ${{inputs.get-last-skip-ci-commit}}
56+
run: node "$GITHUB_ACTION_PATH/dist/index.js" "$gh_token" "$main_branch_name" "$error_on_no_successful_workflow" "$last_successful_event" "$working_directory" "$working_id" "$fallback_sha" "$get_last_skip_ci_commit"
5357

5458
- name: Log base and head SHAs used for nx affected
5559
shell: bash

0 commit comments

Comments
 (0)