Skip to content

Commit

Permalink
Add Gitea to WorkflowRun model
Browse files Browse the repository at this point in the history
  • Loading branch information
krauselukas authored and eduardoj committed Sep 27, 2022
1 parent 380f399 commit 7397b89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/app/models/workflow_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def hook_action
end

def repository_name
payload.dig('repository', 'full_name') || # For GitHub on pull_request and push events
payload.dig('repository', 'full_name') || # For GitHub and Gitea on pull_request and push events
payload.dig('project', 'path_with_namespace') # For GitLab on merge request and push events
end

def repository_url
payload.dig('repository', 'html_url') || # For GitHub on pull_request and push events
payload.dig('repository', 'html_url') || # For GitHub and Gitea on pull_request and push events
payload.dig('project', 'web_url') # For GitLab on merge request and push events
end

Expand Down Expand Up @@ -113,6 +113,8 @@ def scm_vendor
:github
elsif parsed_request_headers['HTTP_X_GITLAB_EVENT']
:gitlab
elsif parsed_request_headers['HTTP_X_GITEA_EVENT']
:gitea
else
:unknown
end
Expand Down

0 comments on commit 7397b89

Please sign in to comment.