Skip to content

Commit fa6dc3e

Browse files
committed
2 parents 83f01dd + cc27d8d commit fa6dc3e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,24 @@ This default behaviour protects your repository from malicious use of `pull_requ
145145

146146
The first time this action is run, {pkgcheck} results will be created in a new issue of your repository. By default, each subsequent run will then append results to the same issue. The issue may be closed at any time, and results will still appear.
147147

148+
### Triggering the action after a long-running workflow
149+
150+
The {pkgcheck} action may fail when it completes while other workflows are still running. This happens because {pkgcheck}'s [CI check](https://github.com/ropensci-review-tools/pkgcheck/blob/de6b8130c8986029cb099de9c3d1cd69430e4fd7/R/check-ci.R#L12-L13) fails when other workflows don't have a success status.
151+
152+
To solve this, you can use the [`workflow_run`](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_run) trigger to make {pkgcheck} run only after a specific workflow has completed. This ensures all required checks finish before {pkgcheck} evaluates them.
153+
154+
Here's an example configuration that triggers {pkgcheck} after [`R-CMD-check.yaml`](https://github.com/r-lib/actions/blob/v2-branch/examples/check-standard.yaml) completes:
155+
156+
```yaml
157+
on:
158+
workflow_run:
159+
workflows: ["R-CMD-check.yaml"]
160+
types: [completed]
161+
branches: [main, master]
162+
```
163+
164+
To implement this, replace the `on` section of your `pkgcheck.yaml` workflow file with the above configuration. This example assumes you have a workflow named `R-CMD-check.yaml` in your `.github/workflows/` directory that triggers on pushes to the `main` or `master` branch. The workflow name should match the [`name`](https://github.com/r-lib/actions/blob/6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590/examples/check-standard.yaml#L8) field in that workflow file.
165+
148166
## Versions
149167

150168
This action has no version tags, as you will always want to pass the newest {pkgcheck} available.

0 commit comments

Comments
 (0)