Skip to content

Commit

Permalink
feat(skip-ci): walk forward through skipped commits when finding last…
Browse files Browse the repository at this point in the history
… successful one
  • Loading branch information
eXigentCoder authored and r0manchak committed Nov 4, 2024
1 parent be2a366 commit 89bdaac
Show file tree
Hide file tree
Showing 4 changed files with 1,534 additions and 1,298 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ jobs:
# E.g. 'ci.yml'. If not provided, current workflow id will be used
#
workflow-id: ''

# 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
# Default: false
get-last-skip-ci-commit: false
```
<!-- end configuration-options -->
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ inputs:
default: '.'
workflow-id:
description: 'The ID of the workflow to track or name of the file name. E.g. ci.yml. Defaults to current workflow'
get-last-skip-ci-commit:
default: false
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'

outputs:
base:
Expand All @@ -49,7 +52,8 @@ runs:
working_directory: ${{ inputs.working-directory }}
working_id: ${{ inputs.workflow-id }}
fallback_sha: ${{ inputs.fallback-sha }}
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: ${{inputs.get-last-skip-ci-commit}}
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"

- name: Log base and head SHAs used for nx affected
shell: bash
Expand Down
Loading

0 comments on commit 89bdaac

Please sign in to comment.