Skip to content

Commit 2645100

Browse files
committed
shell shoudl work
1 parent 85b8863 commit 2645100

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

.github/workflows/build-windows-infra-agent.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ jobs:
2626
- name: Check if latest commit modifies images.windowsAgent.tag
2727
id: version-check
2828
run: |
29-
DIFF_OUTPUT=$(git diff HEAD~1 -- charts/newrelic-infrastructure/values.yaml)
30-
TAG_OLD=""
29+
DIFF_OUTPUT=$(git diff HEAD~1 HEAD -- charts/newrelic-infrastructure/values.yaml)
3130
TAG_NEW=""
3231
VERSION_CHANGED="false"
3332
34-
CHUNK=$(echo "$DIFF_OUTPUT" | awk '/images:/,/\}/' | awk '/windowsAgent:/,/^\s*[a-z]/')
33+
if echo "$DIFF_OUTPUT" | grep -q "windowsAgent:"; then
3534
36-
if echo "$CHUNK" | grep -E "^[+-]\s+tag:" > /dev/null; then
37-
TAG_NEW=$(echo "$CHUNK" | grep -E "^\+\s+tag:" | sed 's/^\+\s\+tag:\s\+//')
38-
39-
# Set version changed flag to true
40-
VERSION_CHANGED="true"
35+
WINDOW_AGENT_SECTION=$(echo "$DIFF_OUTPUT" | sed -n '/windowsAgent:/,/pullPolicy:/p')
36+
echo "WINDOW_AGENT_SECTION: $WINDOW_AGENT_SECTION"
4137
42-
echo "Tag was changed from to $TAG_NEW in windowsAgent section"
38+
if echo "$WINDOW_AGENT_SECTION" | grep -E -q "^[+-][ ]+tag:"; then
39+
TAG_NEW=$(echo "$WINDOW_AGENT_SECTION" | grep -E "^\+[ ]+tag:" | awk '{print $2}')
40+
VERSION_CHANGED="true"
41+
echo "WindowsAgent tag was changed to $TAG_NEW"
42+
else
43+
echo "No tag changes in windowsAgent section"
44+
fi
4345
else
44-
echo "No tag changes in windowsAgent section"
46+
echo "WindowsAgent section not found in diff"
4547
fi
4648
47-
# Output the variables for GitHub Actions
48-
echo "tag_old=$TAG_OLD" >> $GITHUB_OUTPUT
49-
echo "tag_new=$TAG_NEW" >> $GITHUB_OUTPUT
49+
echo "new_agent_version=$TAG_NEW" >> $GITHUB_OUTPUT
5050
echo "version_changed=$VERSION_CHANGED" >> $GITHUB_OUTPUT
5151
5252
build:

charts/newrelic-infrastructure/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ images:
4242
windowsAgent:
4343
registry: ""
4444
repository: newrelic/infrastructure-agent
45-
tag: 1.61.0
45+
tag: 1.63.0
4646
pullPolicy: IfNotPresent
4747

4848
enableWindows: false

0 commit comments

Comments
 (0)