Skip to content

Commit

Permalink
perf: test with @actions/core package
Browse files Browse the repository at this point in the history
  • Loading branch information
kamontat committed Mar 21, 2024
1 parent c12c690 commit ab2ee21
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ A source code of kc-workspace/github-actions.

- `./common/scripts/index.sh install` - For install dependencies
- `./common/scripts/index.sh build` - For build all packages

## Known issues

<details><summary>@actions/* packages didn't elimiate unused code</summary>

https://github.com/actions/toolkit/issues/1436

</details>
10 changes: 5 additions & 5 deletions actions/example-ts/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
## Configurations

The configurations can be sent to the action in 2 ways:
[Environment variables][gh-actions-env] or [Input][gh-actions-input]
[Environment variables][gha-env-url] or [Input][gha-input-url]
(The environment will always has priority over `with` fields).

[gh-actions-env]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv
[gh-actions-input]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith
[gha-env-url]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv
[gha-input-url]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith

### Name

Expand All @@ -46,7 +46,7 @@ The configurations can be sent to the action in 2 ways:
## Source code

<!-- TODO: Update below action name -->
> [github-actions-src#action/example-ts][source-code-url]
> [github-actions-src#action/example-ts][gha-src-url]
<!-- TODO: Update below action directory -->
[source-code-url]: https://github.com/kc-workspace/github-actions-src/tree/main/actions/example-ts
[gha-src-url]: https://github.com/kc-workspace/github-actions-src/tree/main/actions/example-ts
7 changes: 5 additions & 2 deletions actions/example-ts/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { name } from "./next"
import { getInput } from "@actions/core"

console.log(`hello ${name}`)
import { greeting } from "./next"

const name = getInput("name") ?? "world"
console.log(`${greeting} ${name}`)
4 changes: 2 additions & 2 deletions actions/example-ts/src/next.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const name = "world"
const greeting = "hello"

export { name }
export { greeting }

0 comments on commit ab2ee21

Please sign in to comment.