mirror of
https://github.com/actions/github-script.git
synced 2025-12-09 00:26:20 +00:00
Update alternative-setup.md
This commit is contained in:
@@ -13,7 +13,7 @@ root # Your repository
|
|||||||
├── ...
|
├── ...
|
||||||
├── actions
|
├── actions
|
||||||
│ ├── action.yml (optional)
|
│ ├── action.yml (optional)
|
||||||
│ └── ci-test.js
|
│ └── ci-test.mjs
|
||||||
├── ...
|
├── ...
|
||||||
└── package.json
|
└── package.json
|
||||||
```
|
```
|
||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
const { default: script } = await import('${{ github.workspace }}/actions/ci-test.js');
|
const { default: script } = await import('${{ github.workspace }}/actions/ci-test.mjs');
|
||||||
return await script({ github, context, core, exec, glob, io, fetch, __original_require__ });
|
return await script({ github, context, core, exec, glob, io, fetch, __original_require__ });
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ branding:
|
|||||||
icon: code
|
icon: code
|
||||||
inputs:
|
inputs:
|
||||||
script:
|
script:
|
||||||
description: The path to script (e.g actions/ci-test.js)
|
description: The path to script (e.g actions/ci-test.mjs)
|
||||||
required: true
|
required: true
|
||||||
github-token:
|
github-token:
|
||||||
description: The GitHub token used to create an authenticated client
|
description: The GitHub token used to create an authenticated client
|
||||||
@@ -125,7 +125,7 @@ runs:
|
|||||||
|
|
||||||
|
|
||||||
### The `ci-workflow.yml` file
|
### The `ci-workflow.yml` file
|
||||||
Note that we only need to specify the script here because the path will be
|
Note that we only need to specify the script name here because the path will be
|
||||||
resolved to the `uses: ./actions` path by `process.env.GITHUB_ACTION_PATH`.
|
resolved to the `uses: ./actions` path by `process.env.GITHUB_ACTION_PATH`.
|
||||||
i.e the same folder as we are executing the action from.
|
i.e the same folder as we are executing the action from.
|
||||||
```yml
|
```yml
|
||||||
@@ -149,6 +149,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: ci-test.js
|
script: ci-test.mjs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user