diff --git a/script/actions_utils/update_slab_github_runner.sh b/script/actions_utils/update_slab_github_runner.sh new file mode 100755 index 000000000..d94b59418 --- /dev/null +++ b/script/actions_utils/update_slab_github_runner.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# This script updates the lab-github-runner in our workflows by replacing the +# lab-github-runner's release commit. +# Note: For security reasons, we prefer updating the commit instead of the tag. + +# Define the release commit to replace +RELEASE_COMMIT="00000000" + +echo "Current directory: $(pwd)" + +# Search for files and process them +for file in $(find .github -type f \( -name "*.yml" -o -name "*.yaml" \)); do + echo "Processing: $file" + + # Extract lines containing "uses: actions/checkout@" with line numbers before modification + echo "Before modifications:" + grep -nE "uses: actions/checkout@" "$file" || echo "No match found" + + # Replace the target line with the new commit, keeping indentation intact + sed -E -i "s|(uses: actions/checkout@)[^[:space:]]*|\1$RELEASE_COMMIT|g" "$file" + + # Extract lines containing "uses: actions/checkout@" after modification + echo "After modifications:" + grep -nE "uses: actions/checkout@" "$file" || echo "No match found" + + echo "Updated: $file" + echo "-------------------------" +done