Skip to content

Commit

Permalink
Fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp committed Sep 2, 2024
1 parent 062c2de commit 547bbcc
Showing 1 changed file with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
require "fastlane/action"
require "fastlane_core/configuration/config_item"
require "yaml"
require_relative "../helper/ddg_apple_automation_helper"
require_relative "../helper/github_actions_helper"

module Fastlane
module Actions
class AsanaGetUserIdForGithubHandleAction < Action
def self.run(params)
token = params[:asana_access_token]
github_handle = params[:github_handle]

mapping_file = File.expand_path('assets/github-asana-user-id-mapping.yml', __dir__)
user_mapping = YAML.load_file(mapping_file)
asana_user_id = user_mapping[github_handle]

if asana_user_id.nil? || asana_user_id.to_s.empty?
UI.user_error!("Asana User ID not found for GitHub handle: #{github_handle}")
else
Helper::GitHubActionsHelper.set_output("user-id", asana_user_id)
asana_user_id
end
end

def self.description
"This action returns Asana user ID that matches GitHub user handle"
end

def self.authors
["DuckDuckGo"]
end

def self.return_value
"User ID that matches GitHub user handle"
end

def self.details
# Optional:
""
end

def self.available_options
[
FastlaneCore::ConfigItem.asana_access_token,
FastlaneCore::ConfigItem.new(key: :github_handle,
description: "Github user handle",
optional: false,
type: String)
]
end

def self.is_supported?(platform)
true
end
end
end
end

0 comments on commit 547bbcc

Please sign in to comment.