checking yaml #71
This file contains 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
env: | ||
DOCS_CHANGED: false | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
jobs: | ||
markdown-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Check changed files | ||
id: check_file_changed | ||
run: | | ||
echo "### File Check! :rocket:" >> $GITHUB_STEP_SUMMARY | ||
# Check if there is a previous commit | ||
if git rev-parse HEAD^ >/dev/null 2>&1; then | ||
# Get a list of changed files between the last commit and the previous commit | ||
changed_files=$(git diff --name-only HEAD^ HEAD) | ||
else | ||
# In case of no previous commit, use the initial commit | ||
changed_files=$(git diff --name-only HEAD) | ||
fi | ||
# Output the list of changed files | ||
echo "Changed files: $changed_files" | ||
# Check if any of the changed files have a .md extension | ||
if echo "$changed_files" | grep -q '\.md$'; then | ||
echo "DOCS_CHANGED=true" >> $GITHUB_ENV | ||
echo "Docs have changed." | ||
else | ||
echo "DOCS_CHANGED=false" >> $GITHUB_ENV | ||
echo "No changes in docs." | ||
fi | ||
echo "value of $DOCS_CHANGED" | ||
- name: Lint Markdown files | ||
if: ${{ $DOCS_CHANGED == 'true' }} | ||
Check failure on line 46 in .github/workflows/markdown-lint.yml GitHub Actions / .github/workflows/markdown-lint.ymlInvalid workflow file
|
||
uses: ./.github/actions/md-lint |