Skip to content

Commit 7bc873d

Browse files
committed
Log to a file
1 parent 678d7a3 commit 7bc873d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/sudo-tripwire.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
mkdir -p "$HOME/bin"
3939
cat > "$HOME/bin/sudo" << 'EOF'
4040
#!/bin/bash
41-
echo "SUDO CALLED with args: $*" >&2
41+
echo "SUDO CALLED with args: $*" >> /tmp/sudo-tripwire.log
4242
exit 1
4343
EOF
4444
chmod +x "$HOME/bin/sudo"
@@ -52,8 +52,9 @@ jobs:
5252
- name: Check for sudo calls
5353
if: always()
5454
run: |
55-
if grep -r "SUDO CALLED" '${{ runner.temp }}/package.Rcheck/' 2>/dev/null; then
55+
if [ -f /tmp/sudo-tripwire.log ]; then
5656
echo "::error::sudo was called during R CMD check!"
57+
cat /tmp/sudo-tripwire.log
5758
exit 1
5859
else
5960
echo "No sudo calls detected."

0 commit comments

Comments
 (0)