This commit is contained in:
Daniel Kimsey 2026-01-26 14:42:16 -05:00 committed by GitHub
commit adcdf52a6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -382,6 +382,23 @@ Additionally, you'll want to use the [checkout
action](https://github.com/actions/checkout) to make sure your script file is action](https://github.com/actions/checkout) to make sure your script file is
available. available.
### Running in Composite Actions
When used from a composite-action the current working directory is the invoking workflow,
*not* the composite action's. Be sure to use an absolute path to any of the action's
resources in this case like so:
```yaml
name: My Composite Action Using Github Scripts
runs:
using: "composite"
steps:
- uses: actions/github-script@v6
script: |
const script = require(process.env.GITHUB_ACTION_PATH + '/my-action-main.js')
console.log(script({context, core})
```
### Run a separate file with an async function ### Run a separate file with an async function
You can also use async functions in this manner, as long as you `await` it in You can also use async functions in this manner, as long as you `await` it in