feat(gitlab): update existing MR note when marker matches (ENG-3294) … #35
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
| name: Validate Shell Syntax | |
| on: | |
| push: | |
| jobs: | |
| validate-shell: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install yq | |
| run: | | |
| sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 | |
| sudo chmod +x /usr/local/bin/yq | |
| - name: Extract exec section from YAML | |
| id: extract | |
| run: | | |
| yq eval -r '.run.exec' env0.plugin.yaml > /tmp/script.sh | |
| if [ ! -s /tmp/script.sh ]; then | |
| echo "::error::'run.exec' not found in YAML or is empty" | |
| exit 1 | |
| fi | |
| echo "✓ Script extracted successfully" | |
| echo "script_path=/tmp/script.sh" >> $GITHUB_OUTPUT | |
| - name: Install shellcheck | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck | |
| - name: Validate shell syntax with shellcheck | |
| run: | | |
| echo "Validating shell syntax..." | |
| shellcheck -x /tmp/script.sh || { | |
| echo "::error::Shell syntax validation failed" | |
| exit 1 | |
| } | |
| echo "✓ Shell syntax is valid" | |
| - name: Display extracted script (for debugging) | |
| if: failure() | |
| run: | | |
| echo "Extracted script content:" | |
| echo "---" | |
| cat /tmp/script.sh | |
| echo "---" | |