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

Prettier and ESLint Check on PR #9

Open
DesignrKnight opened this issue Apr 17, 2021 · 0 comments
Open

Prettier and ESLint Check on PR #9

DesignrKnight opened this issue Apr 17, 2021 · 0 comments

Comments

@DesignrKnight
Copy link
Member

      - name: Run ESLint
        uses: reviewdog/action-eslint@v1

      - name: Run Prettier
        id: prettier_run
        run: |
          echo "::set-output name=prettier_output::$(npx prettier --list-different .)"
          echo "$(npx prettier --list-different . > prettier.txt)"
      - name: Comment on PR
        if: contains(${{ steps.prettier_run.outputs.prettier_output }}, '.');
        uses: actions/github-script@v3
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const fs = require('fs')
            const cmdoutput = fs.readFileSync(`${process.env.GITHUB_WORKSPACE}/prettier.txt`)
            console.log(cmdoutput)
            github.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: `Prettier Response:\n ${cmdoutput}`
            })

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

1 participant