Comments (4)
Hi @alekc, that's a different error message that I believe is caused by your job name being different than your check run name, which causes check
on this line to equal an empty array.
Since actions/github-script
is "just" JS, I'd recommend debugging with some console.log
statements. Another approach could be updating the check run status with the GitHub CLI using gh api
. Good luck!
from ok-to-test.
Hi @knelasevero! Sorry I missed this!
Would you let me know if 474c02c fixed the issue? 🙏 I think the upstream octokit dependency changed the way rest
calls are made.
from ok-to-test.
Hi @imjohnbo, just hit the same issue with the latest master version.
https://github.com/alekc/terraform-provider-auth0/runs/4437185144?check_suite_focus=true
This is my pipeline
- uses: actions/github-script@v5
id: update-check-run
if: ${{ always() }}
env:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pull } = await github.rest.pulls.get({
...context.repo,
pull_number: process.env.number
});
const ref = pull.head.sha;
const { data: checks } = await github.rest.checks.listForRef({
...context.repo,
ref
});
const check = checks.check_runs.filter(c => c.name === process.env.job);
const { data: result } = await github.rest.checks.update({
...context.repo,
check_run_id: check[0].id,
status: 'completed',
conclusion: process.env.conclusion
});
return result;
And this is the error message:
(node:30469) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
TypeError: Cannot read property 'id' of undefined
at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v5/dist/index.js:4942:56), <anonymous>:13:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async main (/home/runner/work/_actions/actions/github-script/v5/dist/index.js:4997:20)
Error: Unhandled error: TypeError: Cannot read property 'id' of undefined
from ok-to-test.
Beep boop! 🤖 This issue hasn't had any activity in a while. I'll close it if I don't hear back soon.
from ok-to-test.
Related Issues (12)
- Question HOT 1
- Bug: grab sha sooner or as argument
- Example integration HOT 8
- Using personal access token HOT 4
- Using Oauth App Token HOT 3
- Having difficulty knowing how to set up the GitHub App HOT 2
- Explain actions/checkout for forked PRs vs normal PRs HOT 3
- Dispatched actions don't associate with PR checks HOT 6
- See explicit logs in original workflow run HOT 7
- Is the trusted action template vulnerable with a merge from the upstream repository? HOT 1
- Script error - Update Check Runs HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ok-to-test.