[FIX] schedule api #89
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
name: google-java-format | |
on: [ push, pull_request ] | |
jobs: | |
formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set BRANCH_NAME | |
run: | | |
BRANCH_NAME=$(echo "${{ github.ref }}" | awk -F'/' '{print $NF}') | |
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | |
echo "GitHub Ref: ${{ github.ref }}" | |
echo "Branch Name: $BRANCH_NAME" | |
echo "check.... " | |
ls -al | |
echo "check.... " | |
pwd | |
cd src/main/java/com/haemil/backend/auth | |
FILE_PATTERN="/home/runner/work/haemil-backend/haemil-backend/src/main/java/com/haemil/backend/${BRANCH_NAME}/*" | |
echo "FILE_PATTERN Name: $FILE_PATTERN" | |
if [[ -d "$FILE_PATTERN" ]]; then | |
echo "Setting FILE_PATTERN variable" | |
echo "FILE_PATTERN=$FILE_PATTERN" >> $GITHUB_ENV | |
else | |
echo "Directory does not exist for the given branch." | |
fi | |
- name: Check formatting | |
if: env.FILE_PATTERN != '' | |
uses: axel-op/googlejavaformat-action@v3 | |
with: | |
args: "--replace" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
skip-commit: true | |
files: "${{ env.FILE_PATTERN }}" | |
- name: Print diffs | |
run: git --no-pager diff --exit-code |