diff --git a/Octokit.Reactive/Clients/IObservableActionsWorkflowsClient.cs b/Octokit.Reactive/Clients/IObservableActionsWorkflowsClient.cs
index 9c5f055bbc..74773d0478 100644
--- a/Octokit.Reactive/Clients/IObservableActionsWorkflowsClient.cs
+++ b/Octokit.Reactive/Clients/IObservableActionsWorkflowsClient.cs
@@ -12,7 +12,7 @@ namespace Octokit.Reactive
public interface IObservableActionsWorkflowsClient
{
///
- /// Manually triggers a GitHub Actions workflow run in a repository by Id.
+ /// Manually triggers a GitHub Actions workflow run in a repository by slug.
///
///
/// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
@@ -24,7 +24,7 @@ public interface IObservableActionsWorkflowsClient
IObservable CreateDispatch(string owner, string name, string workflowFileName, CreateWorkflowDispatch createDispatch);
///
- /// Manually triggers a GitHub Actions workflow run in a repository by Id.
+ /// Manually triggers a GitHub Actions workflow run in a repository by slug.
///
///
/// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
@@ -35,6 +35,27 @@ public interface IObservableActionsWorkflowsClient
/// The parameters to use to trigger the workflow run.
IObservable CreateDispatch(string owner, string name, long workflowId, CreateWorkflowDispatch createDispatch);
+ ///
+ /// Manually triggers a GitHub Actions workflow run in a repository by Id.
+ ///
+ ///
+ /// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
+ ///
+ /// The Id of the repository.
+ /// The workflow file name.
+ /// The parameters to use to trigger the workflow run.
+ IObservable CreateDispatch(long repositoryId, string workflowFileName, CreateWorkflowDispatch createDispatch);
+
+ ///
+ /// Manually triggers a GitHub Actions workflow run in a repository by Id.
+ ///
+ ///
+ /// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
+ ///
+ /// The Id of the repository.
+ /// The Id of the workflow.
+ /// The parameters to use to trigger the workflow run.
+ IObservable CreateDispatch(long repositoryId, long workflowId, CreateWorkflowDispatch createDispatch);
///
/// Disables a specific workflow in a repository by Id.
///
diff --git a/Octokit.Reactive/Clients/ObservableActionsWorkflowsClient.cs b/Octokit.Reactive/Clients/ObservableActionsWorkflowsClient.cs
index bd6bb02224..7ec222b151 100644
--- a/Octokit.Reactive/Clients/ObservableActionsWorkflowsClient.cs
+++ b/Octokit.Reactive/Clients/ObservableActionsWorkflowsClient.cs
@@ -23,7 +23,7 @@ public ObservableActionsWorkflowsClient(IGitHubClient client)
}
///
- /// Manually triggers a GitHub Actions workflow run in a repository by Id.
+ /// Manually triggers a GitHub Actions workflow run in a repository by slug.
///
///
/// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
@@ -43,7 +43,7 @@ public IObservable CreateDispatch(string owner, string name, string workfl
}
///
- /// Manually triggers a GitHub Actions workflow run in a repository by Id.
+ /// Manually triggers a GitHub Actions workflow run in a repository by slug.
///
///
/// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
@@ -61,6 +61,39 @@ public IObservable CreateDispatch(string owner, string name, long workflow
return _client.CreateDispatch(owner, name, workflowId, createDispatch).ToObservable();
}
+ ///
+ /// Manually triggers a GitHub Actions workflow run in a repository by slug.
+ ///
+ ///
+ /// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
+ ///
+ /// The Id of the repository.
+ /// The workflow file name.
+ /// The parameters to use to trigger the workflow run.
+ public IObservable CreateDispatch(long repositoryId, string workflowFileName, CreateWorkflowDispatch createDispatch)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(workflowFileName, nameof(workflowFileName));
+ Ensure.ArgumentNotNull(createDispatch, nameof(createDispatch));
+
+ return _client.CreateDispatch(repositoryId, workflowFileName, createDispatch).ToObservable();
+ }
+
+ ///
+ /// Manually triggers a GitHub Actions workflow run in a repository by Id.
+ ///
+ ///
+ /// https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event
+ ///
+ /// The Id of the repository.
+ /// The Id of the workflow.
+ /// The parameters to use to trigger the workflow run.
+ public IObservable CreateDispatch(long repositoryId, long workflowId, CreateWorkflowDispatch createDispatch)
+ {
+ Ensure.ArgumentNotNull(createDispatch, nameof(createDispatch));
+
+ return _client.CreateDispatch(repositoryId, workflowId, createDispatch).ToObservable();
+ }
+
///
/// Disables a specific workflow in a repository by Id.
///
diff --git a/Octokit.Tests.Integration/Clients/ActionsWorkflowsClientTests.cs b/Octokit.Tests.Integration/Clients/ActionsWorkflowsClientTests.cs
index 59f9e923a5..2ea206b408 100644
--- a/Octokit.Tests.Integration/Clients/ActionsWorkflowsClientTests.cs
+++ b/Octokit.Tests.Integration/Clients/ActionsWorkflowsClientTests.cs
@@ -105,14 +105,17 @@ public async Task CanDispatchWorkflow()
{
var owner = context.Repository.Owner.Login;
var name = context.Repository.Name;
+ var repoId = context.Repository.Id;
var workflowFileName = await CreateWorkflow(github, context);
var reference = "main";
await fixture.CreateDispatch(owner, name, workflowFileName, new CreateWorkflowDispatch(reference));
+ await fixture.CreateDispatch(repoId, workflowFileName, new CreateWorkflowDispatch(reference));
var workflowId = await GetWorkflowId(github, context, workflowFileName);
await fixture.CreateDispatch(owner, name, workflowId, new CreateWorkflowDispatch(reference));
+ await fixture.CreateDispatch(repoId, workflowId, new CreateWorkflowDispatch(reference));
}
}
diff --git a/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs b/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs
index 45642f27fe..f889b2de8c 100644
--- a/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs
+++ b/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs
@@ -32,7 +32,7 @@ public void AreNotNull()
public class TheCreateDispatchMethod
{
[Fact]
- public async Task RequestsCorrectUrlByWorkflowId()
+ public async Task RequestsCorrectUrlByWorkflowIdRepoSlug()
{
var connection = Substitute.For();
var client = new ActionsWorkflowsClient(connection);
@@ -47,7 +47,7 @@ public async Task RequestsCorrectUrlByWorkflowId()
}
[Fact]
- public async Task RequestsCorrectUrlByWorkflowFileName()
+ public async Task RequestsCorrectUrlByWorkflowFileNameRepoSlug()
{
var connection = Substitute.For();
var client = new ActionsWorkflowsClient(connection);
@@ -61,6 +61,36 @@ public async Task RequestsCorrectUrlByWorkflowFileName()
createDispatch);
}
+ [Fact]
+ public async Task RequestsCorrectUrlByWorkflowIdRepoId()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsWorkflowsClient(connection);
+
+ var createDispatch = new CreateWorkflowDispatch("ref");
+
+ await client.CreateDispatch(321, 123, createDispatch);
+
+ connection.Received().Post