Skip to content

Add new workflow to block direct module reference changes #6

Add new workflow to block direct module reference changes

Add new workflow to block direct module reference changes #6

Workflow file for this run

name: Block specific changes
on:
pull_request:
jobs:
block-direct-markdown-module-changes:
name: Block modifying Markdown Module Reference files directly
runs-on: ubuntu-latest
permissions:
- content: read-all

Check failure on line 11 in .github/workflows/block-changes.yml

View workflow run for this annotation

GitHub Actions / Block specific changes

Invalid workflow file

The workflow is not valid. .github/workflows/block-changes.yml (Line: 11, Col: 7): A sequence was not expected
steps:
- name: Checkout repository
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
- name: Check for changes in /nginx/module_reference
id: check_module_changes
run: |
FOLDER_DIR="content/nginx/module_reference"
if git diff origin/main -- $FOLDER_DIR; then
echo "Changes detected in $FOLDER_DIR"
echo "CHANGES_DETECTED=true" >> $GITHUB_OUTPUT
else
echo "CHANGES_DETECTED=false" >> $GITHUB_OUTPUT
fi
- name: Fail job and generate PR comment if changes detected
if: steps.check_module_changes.outputs.CHANGES_DETECTED == 'true'
run: |
echo "Hi"