Skip to content

Non-blocking action in case of null token #4

@manuelcoppotelli

Description

@manuelcoppotelli

At the current stage, the action calls the Create a registration token for a repository so that it can create a secret for the container instance to register at boot.

However, if the API invokation fails (for whatever reason), the jq tool returns null as string, an the action keep going on.
As a consequence, it creates a container instance that keeps running indefinitely without never having the possibility to register as Action Runner.

Considering the implementation at

https://api.github.com/repos/${{ github.repository }}/actions/runners/registration-token | jq ".token" -r)

An effective solution could be adding the -e flag so that jq exit with error code in case of missing token property:

            https://api.github.com/repos/${{ github.repository }}/actions/runners/registration-token | jq ".token" -re)

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