Skip to content

Commit

Permalink
update workflows: prettier --write in ci and permisions in npm-update…
Browse files Browse the repository at this point in the history
… and js deploy
  • Loading branch information
Jagoda11 committed Aug 28, 2024
1 parent 8799448 commit 6036b24
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@ jobs:

strategy:
matrix:
node-version: [21.x]
node-version: [20.x]

steps:
- name: 🔄 Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: 🔧 Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 📦 Install dependencies
run: npm ci
- name: 🖋️ Check formatting
run: npx prettier --check .
- name: 🖋️ Check formatting
run: |
npx prettier --check . || (
echo "Formatting issues detected. Running Prettier to fix..." &&
npx prettier --write . &&
git config --local user.name "Debugging Duck 🦆" &&
git config --local user.email "github-actions[bot]@users.noreply.github.com" &&
git add . &&
git commit -m "💄 Fix formatting issues with Prettier" || echo "No changes to commit."
)
- name: 🧹 Lint code
run: npm run lint
- name: 🧪 Run tests with coverage
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code 📥
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js 🛠️
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '21'
node-version: '20'

- name: Install dependencies 📦🚀
run: npm install
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/npm-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- main # Runs on pushes to the main branch

permissions:
contents: write

jobs:
update-and-scan:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 6036b24

Please sign in to comment.