Skip to content

Commit

Permalink
testing new api
Browse files Browse the repository at this point in the history
  • Loading branch information
asielcabrera committed Sep 9, 2023
1 parent f73088b commit c6059e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 43 deletions.
14 changes: 14 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "github-toolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/asielcabrera/github-toolkit.git",
"state" : {
"revision" : "662c84a0c199889d2e50bf1c45c23bfb4f1479ba",
"version" : "0.0.11"
}
}
],
"version" : 2
}
3 changes: 0 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ let package = Package(

dependencies: [
.package(url: "https://github.com/asielcabrera/github-toolkit.git", from: "0.0.1"),
.package(url: "https://github.com/asielcabrera/Terminal.git", from: "0.0.1")
],

targets: [
.executableTarget(
name: "Test_Github_Action",
dependencies: [
.product(name: "Core", package: "github-toolkit"),
.product(name: "Github", package: "github-toolkit"),
"Terminal"
],
path: "Sources"),
]
Expand Down
43 changes: 3 additions & 40 deletions Sources/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,13 @@
//

import Core
// import Terminal


@main
struct Action {
static func main() async {
// do {

// Create a directory
// let directoryPath = "my_directory"
// try Core.Directory.create(atPath: directoryPath)
//
//
//
//// Create a file within the directory
// let filePath = "\(directoryPath)/my_file.txt"
// let fileContent = "Hello, World!".data(using: .utf8)
// try Core.File.create(atPath: filePath, contents: fileContent)

// // Read the contents of the file
// let fileData = try Core.File.read(atPath: filePath)
// if let fileString = String(data: fileData, encoding: .utf8) {
// print("Contenido del archivo: \(fileString)")
// }
//
// // Move the file to another directory
// let newDirectoryPath = "\(workspace)/new_directory"
// try Core.Directory.create(atPath: newDirectoryPath)
// _ = "\(newDirectoryPath)/my_file.txt"
// // try Core.File.moveItem(atPath: filePath, toPath: newFilePath)
//
// // Delete the directory and its contents
// try Core.Directory.delete(atPath: directoryPath)
// try Core.Directory.delete(atPath: newDirectoryPath)
// } catch {
// print("Error: \(error)")
// }
let myInput = Core.Inputs.getInput(name: "myInput")
print("Name: \(myInput ?? "N/A")")

// let optionalInput = Core.getInput(name: "optionalInput")
// print("OptionalInput: \(optionalInput ?? "N/A")")
// Core.Outputs
Core.Outputs.setOutput(name: "myOutput", value: "Testing the output")
// Core.Outputs.setOutput(name: "myOutput", value: "Probando el output ")
let myInput = try! Core.getInput("myinput")
print(myInput)
}
}

Expand Down

0 comments on commit c6059e1

Please sign in to comment.