Giter Club home page Giter Club logo

Comments (4)

imjohnbo avatar imjohnbo commented on June 12, 2024 1

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.

imjohnbo avatar imjohnbo commented on June 12, 2024

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.

alekc avatar alekc commented on June 12, 2024

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.

github-actions avatar github-actions commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.