Skip to content

Commit 6676406

Browse files
authored
Merge pull request #84 from tighten/adc/gh-action-commit-note
Add notices about commits and workflows
2 parents 145db0c + 7acbae0 commit 6676406

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,22 @@ Create a `pint.json` file in your project root, you can use [Duster's `pint.json
137137

138138
There's a [GitHub Action](https://github.com/tighten/duster-action) you use to clean-up your workflows.
139139

140+
141+
142+
>**Warning** Heads Up! Workflows that commit to your repo will stop any currently running workflows and not trigger another workflow run.
143+
144+
One solution is to run your other workflows after Duster has completed by updating the trigger on those workflows:
145+
146+
```yml
147+
on:
148+
# Commits made in Duster Fix will not trigger any workflows
149+
# This workflow is configured to run after Duster finishes
150+
workflow_run:
151+
workflows: ["Duster Fix"]
152+
types:
153+
- completed
154+
```
155+
140156
## Contributing
141157
142158
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

app/Commands/GitHubActionsCommand.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Commands;
44

5+
use Illuminate\Support\Str;
56
use LaravelZero\Framework\Commands\Command;
67

78
use function Termwind\{render};
@@ -25,6 +26,14 @@ public function handle(): int
2526

2627
$workflowName = $choices[$choice];
2728

29+
if (Str::contains($workflowName, 'fix')) {
30+
$this->warn('The resulting commit will stop any currently running workflows and will not trigger another.');
31+
$this->warn('Checkout Duster\'s documentation for a workaround.');
32+
if (! $this->confirm('Do you wish to continue?', true)) {
33+
return Command::FAILURE;
34+
}
35+
}
36+
2837
$workflow = file_get_contents(__DIR__ . "/../../stubs/github-actions/{$workflowName}.yml");
2938
$workflow = str_replace('YOUR_BRANCH_NAME', $branch, $workflow);
3039

stubs/github-actions/duster-fix-blame.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Duster Fix
22

3+
# Commits made in here will not trigger any workflows
4+
# Checkout Duster's documentation for a workaround
5+
36
on:
47
push:
58
branches: [ YOUR_BRANCH_NAME ]

stubs/github-actions/duster-fix.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Duster Fix
22

3+
# Commits made in here will not trigger any workflows
4+
# Checkout Duster's documentation for a workaround
5+
36
on:
47
push:
58
branches: [ YOUR_BRANCH_NAME ]

0 commit comments

Comments
 (0)