Add dependencies on end to end jobs as well #181
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: JavaScript Formatter | |
on: push | |
jobs: | |
format-javascript: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Step 2: Set up Node.js environment | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' # Specify your Node.js version | |
# Step 3: Install Prettier and ESLint globally | |
- name: Install Prettier | |
run: | | |
npm install -g prettier | |
# Step 4: Run Prettier to format code | |
- name: Run prettier | |
run: | | |
prettier "**/*.js" --write | |
git diff | |
git reset --hard | |
prettier --check "**/*.js" | |
# Step 5: Report status | |
- name: Complete | |
run: echo "Formatting completed successfully!" | |