Skip to content

check-for-epoch-bump.sh doesn't work with inline comments #24

@Taffer

Description

@Taffer

Some (many?) package .yaml files have an epoch: like epoch: 1 # GHSA-jc7w-c686-c4v9.

This sort of thing produces a warning like:

/home/chrish/.cache/pre-commit/repoq4ne75rd/scripts/check-for-epoch-bump.sh: line 44: ((: 5 # GHSA-jc7w-c686-c4v9: syntax error: invalid arithmetic operator (error token is "# GHSA-jc7w-c686-c4v9")
⚠ Epoch HAS NOT been increased compared to main: 6 <= 5 # GHSA-jc7w-c686-c4v9

The epoch_sed function should probably be:

epoch_sed() {
    sed -r 's/^[[:space:]]+epoch:[[:space:]]+([0-9])+.*$/\1/'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions