Repository navigation
feat: add explicit shell execution modes - #2
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces explicit shell execution modes (
--shell posix|shebang|auto) to OpsScript Gate and hardens the GitHub Action input handling.Key Changes
--shell):posix(default): Strictly executes with/bin/sh, ignoring any script shebang (preserving backward compatibility).shebang: Strictly honors recognized shebang interpreters (#!/bin/sh,#!/bin/bash,#!/usr/bin/sh,#!/usr/bin/bash,#!/usr/bin/env sh,#!/usr/bin/env bash). Fails with a clear error if the shebang is missing, malformed, or unsupported.auto: Honors recognized shebangs if present; safely falls back to/bin/shif no shebang is present. Unsupported or malformed shebangs fail with an error instead of silently running as POSIX./bin/bashfrom/usr/bin/bashand/usr/bin/env bashvia fixed constant container commands (SUPPORTED_SHEBANG_COMMANDS) to prevent$PATHresolution masking missing interpreter paths.run_matrixparses the shebang once upfront for non-POSIX modes.script-path,matrix,timeout,format,shell) are passed securely via step environment variables instead of inline string interpolation in bash scripts..github/workflows/test.yml) to verify real container behavior (e.g. bash missing on Alpine 3.20) on GitHub-hostedubuntu-latest.0.1.2during development.