Skip to content

Add Github action to add documentation tag #2

Add Github action to add documentation tag

Add Github action to add documentation tag #2

Workflow file for this run

name: Add documentation tag
on:
pull_request:
workflow_dispatch:
jobs:
check:
name: Check modified files
outputs:
run_job: ${{ steps.check_files.outputs.run_job }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: check modified files
id: check_files
run: |
echo "=============== list modified files ==============="
git diff --name-only HEAD^ HEAD
echo "========== check paths of modified files =========="
git diff --name-only HEAD^ HEAD > files.txt
while IFS= read -r file
do
echo $file
if [[ $file != docs/* ]]; then
echo "This modified file is not under the 'docs' folder."
echo "::set-output name=run_job::false"
break
else
echo "::set-output name=run_job::true"
fi
done < files.txt
job_for_db:
tag_documentation:
name: tag documentation
needs: check
if: needs.check.outputs.run_job == 'true'
runs-on: ubuntu-latest
steps:
- name: add documentation tag
run: echo "Add tag"