update-flake-lock icon indicating copy to clipboard operation
update-flake-lock copied to clipboard

README is confusing about running on PRs

Open andreabedini opened this issue 2 years ago • 1 comments

The README is confusing (or perhaps confused) about running the action on PRs.

## Example that doesn't run on PRs

If you were to run this action as a part of your CI workflow, you may want to prevent it from running against Pull Requests.

```yaml
name: update-flake-lock
on:
  workflow_dispatch: # allows manual triggering
  pull_request: # triggers on every Pull Request
  schedule:
    - cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
...

AFAIU the comment is correct and that specification will trigger on every pull-request; while the section is about not triggering on pull-requests. I might not understand what the auther intended to say but the other examples don't have the on: pull_request: and will not trigger on PRs; so maybe this section is redundant.

andreabedini avatar Aug 09 '23 03:08 andreabedini

The section isn't redundant, it just doesn't explain the use-case very clearly.

The idea is that the action might included in a normal CI workflow that is run on pushes & PRs, (instead of just schedule).

If the workflow is run on PRs, you probably want to skip the update step.

The example doesn't include a fleshed out workflow (complete with other jobs/steps), so it looks a bit silly at first glance.

MattSturgeon avatar Mar 22 '24 11:03 MattSturgeon