Skip to content

Commit

Permalink
update workflow email
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtausifiqbal committed Oct 16, 2023
1 parent 5359953 commit 1b91466
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ name: Format Code
on: push

jobs:
format:
runs-on: ubuntu-20.04
format:
runs-on: ubuntu-20.04

steps:
- name: Pull Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Install Prettier
env:
PRETTIER_VERSION: 2
run: |
sudo npm i -g prettier@$PRETTIER_VERSION
- name: Format
run: |
# don't format if there's no .prettierrc file
if [ ! -f .prettierrc ]; then
echo ".prettierrc not found"
echo "terminating workflow..."
exit 1;
fi
steps:
- name: Pull Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Install Prettier
env:
PRETTIER_VERSION: 2
run: |
sudo npm i -g prettier@$PRETTIER_VERSION
- name: Format
run: |
# don't format if there's no .prettierrc file
if [ ! -f .prettierrc ]; then
echo ".prettierrc not found"
echo "terminating workflow..."
exit 1;
fi
prettier --check . --ignore-unknown --write
- name: Push Back Formatted Code
run: |
# configure git
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
prettier --check . --ignore-unknown --write
- name: Push Back Formatted Code
run: |
# configure git
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add .
git commit -m "(CI) format code" || echo "nothing to commit"
git push
git add .
git commit -m "(CI) format code" || echo "nothing to commit"
git push

0 comments on commit 1b91466

Please sign in to comment.