It's not possible to trigger workflows by cron schedule
event on branch different than default one (like fature branches). This is expected behaviour according to the documentation:
Scheduled workflows run on the latest commit on the default or base branch.
This should answer the first part of your question. It's not possible to have an on.schedule
event triggered on a branch different than your repo default branch. This is why it does not work for your feature branches.
Speaking about the second part of the question. You are trying to manually trigger the workflow by using repository_dispatch
webhook event but it seems your workflow is not configured to be triggered this way.
According to the documentation:
When you make a request to create a repository_dispatch
event, you must specify an event_type
to describe the activity type. By default, all repository_dispatch
activity types trigger a workflow to run. You can use the types keyword to limit your workflow to run when a specific event_type
value is sent in the repository_dispatch
webhook payload.
According to this, the missing part of your workflow configuration configuration is the repository_dispatch
event declaration:
on:
repository_dispatch:
types:
- develop-package
So, to be able to trigger the workflow run using both cron (schedule
event) and manually using Github API (repository_dispatch
event) you should have both events mentioned in the workflow triggers configuration:
on:
schedule:
- cron: '1 * * * *'
repository_dispatch:
types:
- develop-package