Giter Site home page Giter Site logo

workflow-status's People

Contributors

fiskhest avatar jhheider avatar kamranf avatar martialonline avatar neillfontes-klar avatar petteriv-nordic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

workflow-status's Issues

Workflow Fails After Repository Ownership changed

A job is failing after the ownership of the repository was moved from one organization to another.

jq: error (at <stdin>:4): Cannot iterate over null (null)
Error: Process completed with exit code 5.

The relevant job that is failing:

  report:
    name: Report to Slack
    needs: [
      build_android,
      build_ios,
      quality
    ]
    runs-on: ubuntu-latest

    steps:
      - uses: martialonline/workflow-status@v4
        id: check
      - name: Slack Notification
        uses: rtCamp/action-slack-notify@v2
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

The Job was working totally fine before transferring ownership and is working fine in other repositories across different organizations. Is there potentially a necessary setting not correct in the new organisation or potentially some cached things trying to point to the old repository?

Any help would be appreciated

More output from the action
Run martialonline/workflow-status@v4
  env:
    APP_DIRECTORY: packages/app
Run url="${GITHUB_API_URL}/repos"
  url="${GITHUB_API_URL}/repos"
  repo="${GITHUB_REPOSITORY}"
  run_id="${GITHUB_RUN_ID}"
  token="***"
  
  failure=$(curl -s -H "Authorization: token ${token}" "${url}/${repo}/actions/runs/${run_id}/jobs" | \
  jq -r '.jobs[] | select(.status == "completed" and .conclusion == "failure").conclusion' | \
  wc -l)
  
  cancelled=$(curl -s -H "Authorization: token ${token}" "${url}/${repo}/actions/runs/${run_id}/jobs" | \
  jq -r '.jobs[] | select(.status == "completed" and .conclusion == "cancelled").conclusion' | \
  wc -l)
  
  if [ "${failure}" -gt 0 ]; then
    status="failure"
  elif [ "${cancelled}" -gt 0 ]; then
    status="cancelled"
  else 
    status="success"
  fi
  
  echo "status=${status}" >> $GITHUB_OUTPUT
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    APP_DIRECTORY: packages/creator
jq: error (at <stdin>:[4](https://github.com/{user}/{repo}/actions/runs/{runId}/job/{jobId}#step:3:5)): Cannot iterate over null (null)
Error: Process completed with exit code [5](https://github.com/{user}/{repo}/actions/runs/{runId}/job/{jobId}#step:3:6).

jq errors on no jobs found

It doesn't look like there are jobs found with the curl command and then an error occurs when jq tries to parse the jobs array.

Run url="${GITHUB_API_URL}/repos"
  url="${GITHUB_API_URL}/repos"
  repo="${GITHUB_REPOSITORY}"
  run_id="${GITHUB_RUN_ID}"
  
  failure=$(curl -s "${url}/${repo}/actions/runs/${run_id}/jobs" | \
  jq -r '.jobs[] | select(.status == "completed" and .conclusion == "failure").conclusion' | \
  wc -l)
  
  cancelled=$(curl -s "${url}/${repo}/actions/runs/${run_id}/jobs" | \
  jq -r '.jobs[] | select(.status == "completed" and .conclusion == "cancelled").conclusion' | \
  wc -l)
  
  if [ "${failure}" -gt 0 ]; then
    status="failure"
  elif [ "${cancelled}" -gt 0 ]; then
    status="cancelled"
  else 
    status="success"
  fi
  
  echo "::set-output name=status::${status}"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}

jq: error (at <stdin>:4): Cannot iterate over null (null)
Error: Process completed with exit code 5.

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.