forked from docs/doc-exports
polishing
This commit is contained in:
@ -22,10 +22,11 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
|
||||
|
||||
- name: Dump Gitea env
|
||||
run: |
|
||||
env | sort | grep GITEA
|
||||
|
||||
- name: Get base branch name
|
||||
id: base
|
||||
run: |
|
||||
@ -34,7 +35,7 @@ jobs:
|
||||
echo "${{ gitea.base_ref }}"
|
||||
BASE_SHA="${{ gitea.event.pull_request.base.sha }}"
|
||||
echo "Base SHA: $BASE_SHA"
|
||||
# >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get changed files other method
|
||||
id: changed-files
|
||||
run: |
|
||||
@ -42,19 +43,13 @@ jobs:
|
||||
echo "Base SHA: $BASE_SHA"
|
||||
git fetch origin $BASE_SHA
|
||||
echo "changed_files=$(git diff --name-only ${BASE_SHA}...HEAD | grep -E '\.(yml|yaml)$' | xargs)" >> $GITHUB_OUTPUT
|
||||
# - name: Get changed files
|
||||
# id: changed-files
|
||||
# run: |
|
||||
# if ${{ github.event_name == 'pull_request' }}; then
|
||||
# echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
|
||||
# else
|
||||
# echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
|
||||
# fi
|
||||
|
||||
- name: List changed files
|
||||
run: |
|
||||
for file in ${{ steps.changed-files.outputs.changed_files }}; do
|
||||
echo "$file was changed"
|
||||
done
|
||||
|
||||
- name: Check presence of non-unicode characters
|
||||
continue-on-error: true
|
||||
run: |
|
||||
@ -68,6 +63,7 @@ jobs:
|
||||
if [ "$failed_job" = true ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install yamllint
|
||||
run: |
|
||||
sudo apt-get update
|
||||
@ -77,18 +73,6 @@ jobs:
|
||||
run: |
|
||||
set -e
|
||||
|
||||
# BASE_SHA="${{ gitea.event.pull_request.base.sha }}"
|
||||
|
||||
# echo "Base SHA: $BASE_SHA"
|
||||
|
||||
# # Fetch base branch so git diff works in PRs
|
||||
# git fetch origin "$BASE_SHA"
|
||||
# # git fetch origin "${{ gitea.base_ref }}"
|
||||
|
||||
# # Get changed YAML files
|
||||
# files=$(git diff --name-only "$BASE_SHA"...HEAD \
|
||||
# | grep -E '\.(yml|yaml)$' || true)
|
||||
|
||||
files="${{ steps.changed-files.outputs.changed_files }}"
|
||||
if [ -z "$files" ]; then
|
||||
echo "No YAML files changed"
|
||||
@ -98,7 +82,6 @@ jobs:
|
||||
echo "Linting changed files:"
|
||||
printf '%s\n' $files
|
||||
|
||||
# for file in ${{ steps.changed-files.outputs.changed_files }}; do
|
||||
for file in $files; do
|
||||
echo "$file is being checked for yamllint issues."
|
||||
yamllint -f parsable $file || \
|
||||
|
||||
Reference in New Issue
Block a user