Example #1
0
        /// <inheritdoc />
        public async Task ProcessPayload(PullRequestEventPayload payload, CancellationToken cancellationToken)
        {
            if (payload == null)
            {
                throw new ArgumentNullException(nameof(payload));
            }

            if (payload.Action != "closed" || !payload.PullRequest.Merged)
            {
                throw new NotSupportedException();
            }

            if (payload.PullRequest.Base.Repository.Id != payload.PullRequest.Head.Repository.Id)
            {
                return;
            }

            await gitHubManager.DeleteBranch(payload.PullRequest.Head.Ref).ConfigureAwait(false);
        }