File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ # This is a basic workflow to validate HTML and CSS
2+ name : HTML and CSS Validation Workflow
3+
4+ # Controls when the workflow will run
5+ on :
6+ # Triggers the workflow on push or pull request events but only for the "main" branch
7+ push :
8+ branches : [ "main" ]
9+ pull_request :
10+ branches : [ "main" ]
11+ # Allows you to run this workflow manually from the Actions tab
12+ workflow_dispatch :
13+
14+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+ jobs :
16+ # This workflow contains a single job called "validate_job"
17+ validate_job :
18+ # The type of runner that the job will run on
19+ runs-on : ubuntu-latest
20+
21+ # Steps represent a sequence of tasks that will be executed as part of the job
22+ steps :
23+ # Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
24+ - uses : actions/checkout@v4
25+
26+ # Sets up Node.js environment
27+ - name : Set up Node.js
28+ uses : actions/setup-node@v3
29+ with :
30+ node-version : ' 16'
31+
32+ # Installs HTMLHint and Stylelint
33+ - name : Install dependencies
34+ run : |
35+ npm install htmlhint stylelint stylelint-config-standard --save-dev
36+
37+ # Runs HTML validation
38+ - name : Validate HTML
39+ run : npx htmlhint .
40+
41+ # Runs CSS validation
42+ - name : Validate CSS
43+ run : npx stylelint "**/*.css"
44+
You can’t perform that action at this time.
0 commit comments