mirror of
https://github.com/actions/github-script.git
synced 2026-02-08 03:57:27 +00:00
Merge 92d37e84e8 into f28e40c7f3
This commit is contained in:
commit
39cfdfa8ff
1 changed files with 2 additions and 4 deletions
|
|
@ -390,8 +390,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/github-script@v7
|
- uses: actions/github-script@v7
|
||||||
env:
|
|
||||||
SHA: '${{env.parentSHA}}'
|
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const script = require('./path/to/script.js')
|
const script = require('./path/to/script.js')
|
||||||
|
|
@ -402,11 +400,11 @@ And then export an async function from your module:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
module.exports = async ({github, context, core}) => {
|
module.exports = async ({github, context, core}) => {
|
||||||
const {SHA} = process.env
|
const {GITHUB_SHA} = process.env
|
||||||
const commit = await github.rest.repos.getCommit({
|
const commit = await github.rest.repos.getCommit({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
ref: `${SHA}`
|
ref: GITHUB_SHA
|
||||||
})
|
})
|
||||||
core.exportVariable('author', commit.data.commit.author.email)
|
core.exportVariable('author', commit.data.commit.author.email)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue