Skip to content

Commit 569863b

Browse files
committed
try to use last successful action for workflow dispatch
1 parent 6e9b4d0 commit 569863b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/conan.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ jobs:
1717
steps:
1818
- name: Checkout Code
1919
uses: actions/checkout@v4
20+
- name: Get current git info
21+
if: github.event_name == 'schedule'
22+
id: git_info
23+
run: |
24+
echo "current_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
25+
echo "current_branch=$(git branch --show-current)" >> $GITHUB_OUTPUT
26+
- name: Get last successful commit
27+
if: github.event_name == 'schedule'
28+
id: last_successful_commit
29+
uses: nrwl/last-successful-commit-action@v1
30+
with:
31+
branch: ${{ steps.git_info.outputs.current_branch }}
32+
workflow_id: conan.yml
33+
- name: Cancel scheduled build with no new commits
34+
uses: nrwl/last-successful-commit-action@v1
35+
if: |
36+
github.event_name == 'schedule' &&
37+
steps.git_info.outputs.current_commit == steps.last_successful_commit.outputs.commit_hash
2038
2139
build_macos:
2240
if: github.repository_owner == 'viamrobotics'

0 commit comments

Comments
 (0)