4242 name : Test Agent Repository Flow (Basic)
4343 runs-on : ubuntu-latest
4444 steps :
45+ - name : Harden Runner
46+ uses : step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
47+ with :
48+ disable-sudo : true
49+ egress-policy : audit
50+
4551 - name : Checkout action repository
4652 uses : actions/checkout@v4
4753 with :
6773
6874 - name : Setup mock newrelic-auth-cli
6975 run : |
70- # Make our mock CLI executable and install to standard location
76+ # Make our mock CLI executable and install to user-writable location
7177 chmod +x .github/mock-newrelic-auth-cli
72- sudo cp .github/mock-newrelic-auth-cli /usr/local/bin/newrelic-auth-cli
78+ mkdir -p "$HOME/.local/bin"
79+ cp .github/mock-newrelic-auth-cli "$HOME/.local/bin/newrelic-auth-cli"
80+ echo "$HOME/.local/bin" >> $GITHUB_PATH
7381
7482 # Verify it's accessible
7583 which newrelic-auth-cli
@@ -111,6 +119,12 @@ jobs:
111119 ports :
112120 - 5000:5000
113121 steps :
122+ - name : Harden Runner
123+ uses : step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
124+ with :
125+ disable-sudo : true
126+ egress-policy : audit
127+
114128 - name : Checkout action repository
115129 uses : actions/checkout@v4
116130 with :
@@ -136,9 +150,11 @@ jobs:
136150
137151 - name : Setup mock newrelic-auth-cli
138152 run : |
139- # Make our mock CLI executable and install to standard location
153+ # Make our mock CLI executable and install to user-writable location
140154 chmod +x .github/mock-newrelic-auth-cli
141- sudo cp .github/mock-newrelic-auth-cli /usr/local/bin/newrelic-auth-cli
155+ mkdir -p "$HOME/.local/bin"
156+ cp .github/mock-newrelic-auth-cli "$HOME/.local/bin/newrelic-auth-cli"
157+ echo "$HOME/.local/bin" >> $GITHUB_PATH
142158
143159 # Verify it's accessible
144160 which newrelic-auth-cli
@@ -227,6 +243,12 @@ jobs:
227243 name : Test Documentation Flow (MDX Parsing)
228244 runs-on : ubuntu-latest
229245 steps :
246+ - name : Harden Runner
247+ uses : step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
248+ with :
249+ disable-sudo : true
250+ egress-policy : audit
251+
230252 - name : Checkout action repository
231253 uses : actions/checkout@v4
232254 with :
@@ -252,9 +274,11 @@ jobs:
252274
253275 - name : Setup mock newrelic-auth-cli
254276 run : |
255- # Make our mock CLI executable and install to standard location
277+ # Make our mock CLI executable and install to user-writable location
256278 chmod +x .github/mock-newrelic-auth-cli
257- sudo cp .github/mock-newrelic-auth-cli /usr/local/bin/newrelic-auth-cli
279+ mkdir -p "$HOME/.local/bin"
280+ cp .github/mock-newrelic-auth-cli "$HOME/.local/bin/newrelic-auth-cli"
281+ echo "$HOME/.local/bin" >> $GITHUB_PATH
258282
259283 # Verify it's accessible
260284 which newrelic-auth-cli
0 commit comments