Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Errors in cat-facts python code #12

Open
@jose-nuno-sousa-alb

Description

@jose-nuno-sousa-alb

Description
The provided code in the template will throw an error when running the actions as the schema of the message delivered by the API (https://cat-fact.herokuapp.com/facts) seems to have changed.

This might be related with #9 however the API is currently responding (maybe the service changed?).

There are other errors in the same code, the method that picks a random fact might throw an index out of bounds error and it is fetching the length of the facts list from the parent execution context.

To Reproduce
Steps to reproduce the behavior:
Run the python code provided in the template in a suitable env (with requests module installed)

Expected behavior
The output should be 2 lines with a random cat fact and the set-output with it, for example:

The technical term for a cat’s hairball is a bezoar.
::set-output name=fact::The technical term for a cat’s hairball is a bezoar.

Screenshots
Screenshot from 2020-12-16 13-53-11
Screenshot from 2020-12-16 14-03-32

Additional context
I've finished the course without this problem by fixing the python code:
Screenshot from 2020-12-16 14-00-33

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions