Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to not found source files option #30

Open
Tacha-S opened this issue Jun 23, 2021 · 1 comment
Open

Allow to not found source files option #30

Tacha-S opened this issue Jun 23, 2021 · 1 comment

Comments

@Tacha-S
Copy link

Tacha-S commented Jun 23, 2021

If we try to set up GitHub CI when we create a repository, then no source file exists.
In that case, the GitHub CI will be an error, so we want an option to allow the source file to not exist.

@ReenigneArcher
Copy link

ReenigneArcher commented Jul 11, 2022

I would like this feature as well.

As a workaround, I just added a step to the job that checks if the directory exists or not.

name: Clang Format Lint

on:
  pull_request:
    branches: [master, nightly]
    types: [opened, synchronize, reopened]

jobs:
  lint:
    name: Clang Format Lint
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Check src
        run: |
          if [ -d "./src" ] 
          then
            FOUND=true
          else
            FOUND=false
          fi
          
          echo "src_found=${FOUND}" >> $GITHUB_ENV

      - name: Clang format lint
        if: ${{ env.src_found == 'true' }}
        uses: DoozyX/[email protected]
        with:
          source: './src'
          extensions: 'cpp,h,m,mm'
          clangFormatVersion: 13
          style: file
          inplace: false

      - name: Upload Artifacts
        if: failure()
        uses: actions/upload-artifact@v3
        with:
          name: clang-format-fixes
          path: src/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants