Skip to content

Commit

Permalink
Allow running cargo-generate workflow on workflow_dispatch anywhe…
Browse files Browse the repository at this point in the history
…re (#287)

`cargo-generate.yaml` is an automated Github Action that automatically
updates the `cargo-generate` branch from `main`. It's proven to be a bit
flaky in the past, so I've found myself testing it on my fork a lot. The
issue is that this action is automatically skipped if run on a fork.
This is generally good, unless you want to test the workflow
specifically and are not an average user.

The amend this, I made the action run if on the source repository OR if
it was manually called using `workflow_dispatch`. This way, it won't run
when `main` is updated on forks, but still will let developers manually
call it if needed.

Co-authored-by: Jan Hohenheim <[email protected]>
  • Loading branch information
BD103 and janhohenheim committed Aug 29, 2024
1 parent fe7a01f commit 66931a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cargo-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ permissions:
jobs:
update:
runs-on: ubuntu-latest
# Only run this job on the source repository, skipping forks.
if: ${{ github.repository == 'TheBevyFlock/bevy_quickstart' }}
# Only run this job on the source repository, skipping forks, unless it was manually triggered.
if: ${{ github.repository == 'TheBevyFlock/bevy_quickstart' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down

0 comments on commit 66931a7

Please sign in to comment.