From 42a1b5dd3bd71b15be59f088901a46c5e516eeb2 Mon Sep 17 00:00:00 2001 From: Whisker17 Date: Thu, 27 Jul 2023 22:17:11 +0800 Subject: [PATCH] prettier test --- .github/workflows/prettier_format.yml | 35 ++++++++++++++++++++++----- evaluations/AdMeta_1_0xCaso.md | 2 ++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prettier_format.yml b/.github/workflows/prettier_format.yml index 408437f418..046ba4911c 100644 --- a/.github/workflows/prettier_format.yml +++ b/.github/workflows/prettier_format.yml @@ -10,24 +10,47 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check Out Repository + - name: Full Clone Repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Install Prettier run: npm install prettier --global - - name: Format Files + - name: Get Previous Commit + id: previous-commit run: | - prettier --write . + previous_commit=$(git log --skip 1 -n 1 --pretty=format:"%H") + echo "PREVIOUS_COMMIT=$previous_commit" >> $GITHUB_ENV + + - name: Get Modified Files + id: modified-files + run: | + previous_commit=${{ env.PREVIOUS_COMMIT }} + modified_files=$(git diff --name-only $previous_commit ${{ github.sha }}) + echo "$modified_files" > modified_files.txt + + - name: Read Modified Files + id: read-modified-files + run: | + echo "MODIFIED_FILES=$(cat modified_files.txt)" >> $GITHUB_ENV + + - name: Format Modified Files + if: ${{ env.MODIFIED_FILES != '' }} + run: | + modified_files=${{ env.MODIFIED_FILES }} + prettier --write $modified_files - name: Commit Changes + if: ${{ env.MODIFIED_FILES != '' }} run: | git config --global user.name "Whisker17" git config --global user.email "demiwhisker@gmail.com" - git add . - git commit -m "Auto-format code with Prettier [skip ci]" + git commit -m "Auto-format code with Prettier [skip ci]" --amend --no-edit - name: Push Changes + if: ${{ env.MODIFIED_FILES != '' }} run: | branch_name=${{ github.ref }} - git push origin $branch_name \ No newline at end of file + git push origin $branch_name --force-with-lease diff --git a/evaluations/AdMeta_1_0xCaso.md b/evaluations/AdMeta_1_0xCaso.md index 05561f048d..fc44588af9 100644 --- a/evaluations/AdMeta_1_0xCaso.md +++ b/evaluations/AdMeta_1_0xCaso.md @@ -1,5 +1,7 @@ # Evaluation + + - **Status:** Accepted - **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/AdMeta.md - **Milestone:** 1