From 0d87e53da340f570c33505821b092cecadf715ba Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Fri, 17 Feb 2023 18:50:33 +0530 Subject: [PATCH] ci: Add prettier workflow support --- .github/workflows/prettier.yml | 22 ++++++++++++++++++++++ .prettierignore | 4 ++++ .prettierrc | 6 ++++++ CONTRIBUTING.md | 2 +- SECURITY.md | 2 +- 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/prettier.yml create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..f3379a9 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,22 @@ +name: Format + +on: [push] + +jobs: + format: + runs-on: ubuntu-latest + name: Format Files + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "16" + - run: npm ci + - name: Prettier + run: npx prettier --write '**/*.js' '*.{js,md}' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + with: + commit_message: "style: format files" diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..cbbad4a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +CHANGELOG.md +CODE_OF_CONDUCT.md +*.yml +*.yaml diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..af6251d --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": true, + "tabWidth": 2, + "doubleQuotes": true, + "bracketSpacing": true +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c0fd872..b1ba028 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,4 +20,4 @@ - Look at the existing [**Issues**](https://github.com/Pradumnasaraf/LinkFree-CLI/issues) or [**create a new issue**](https://github.com/Pradumnasaraf/LinkFree-CLI/issues/new/choose)! - [**Fork the Repo**](https://github.com/Pradumnasaraf/LinkFree-CLI/fork). Then, create a branch for any issue that you are working on. Finally, commit your work. - Create a **[Pull Request](https://github.com/Pradumnasaraf/LinkFree-CLI/compare)** (_PR_), which will be promptly reviewed and given suggestions for improvements by the community. -- Add screenshots or screen captures to your Pull Request to help us understand the effects of the changes proposed in your PR. \ No newline at end of file +- Add screenshots or screen captures to your Pull Request to help us understand the effects of the changes proposed in your PR. diff --git a/SECURITY.md b/SECURITY.md index ab820ff..38ab315 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,3 +1,3 @@ ## Reporting a Vulnerability -Please don't raise an issue that can be more vulnerable to put out in public. Instead, report via http://pradumnasaraf.dev/contact. \ No newline at end of file +Please don't raise an issue that can be more vulnerable to put out in public. Instead, report via http://pradumnasaraf.dev/contact.