konflux-ci / build-definitions

Apache License 2.0
23 stars 134 forks source link

exclude comments when detecting if a task is registering itself with rhsm #1620

Closed brianwcook closed 6 days ago

brianwcook commented 1 week ago
          this ought to exclude comments, otherwise a line such as
# install packages with no need to register using subscription-manager
dnf -y install hello

will trigger this detection to think the dockerfile is registering on its own

_Originally posted by @ptoscano in https://github.com/konflux-ci/build-definitions/pull/1528#discussion_r1816773041_

brianwcook commented 1 week ago

will use a single regex.


# should match
subscription-manager register
subscription-manager register --org 123
touch file && subscription-manager register
true subscription-manager register

# should not match
# subscription-manager register
subscription-manager # register
echo tricky! # subscription-manager register