Skip to content

Fail completely if one of the piped steps fail #4

@VctorAHernndez

Description

@VctorAHernndez

Hi!

I've recently just used this action for a small application in production. One small improvement would be to fail the bash script completely if the initial command failed (i.e. due to typo, auth, invalid arguments). So I figured adding a set -e statement might help the user out, instead of "silently failing" and the rest of the GitHub Action proceeding as normal.

# /bin/bash
set -e

TAGS=$(doctl registry repository lt $1 --format Tag,UpdatedAt | tail -n +2 | sort -rk2 | awk '{print $1}' | grep -v latest | tail -n +$2 | tr '\n' ' ')
[[ -n $TAGS ]] && doctl registry repository dt $1 $TAGS --force
echo Tags removed: $TAGS

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions