Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit 7b028ab

Browse files
committed
Add actions
1 parent 74e5234 commit 7b028ab

File tree

6 files changed

+1160
-170
lines changed

6 files changed

+1160
-170
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v3
19+
with:
20+
cache: yarn
21+
cache-dependency-path: |
22+
yarn.lock
23+
node-version: 18
24+
25+
- name: Install
26+
run: |
27+
yarn install --frozen-lockfile
28+
29+
- name: Build
30+
run: |
31+
yarn build

.github/workflows/codeql.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: ["main"]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: ["main"]
20+
schedule:
21+
- cron: "0 9 * * 4"
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["javascript"]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
56+
# If this step fails, then you should remove it and run the build manually (see below)
57+
- name: Autobuild
58+
uses: github/codeql-action/autobuild@v2
59+
60+
# ℹ️ Command-line programs to run using the OS shell.
61+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
62+
63+
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
65+
66+
# - run: |
67+
# echo "Run, Build Application using script"
68+
# ./location_of_script_within_repo/buildscript.sh
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v2
72+
with:
73+
category: "/language:${{matrix.language}}"

.github/workflows/pr-title.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Conventional Commits PR Title"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.PR_TITLE_TOKEN }}
18+
19+
- uses: marocchino/sticky-pull-request-comment@v2
20+
# When the previous steps fails, the workflow would stop. By adding this
21+
# condition you can continue the execution with the populated error message.
22+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
23+
with:
24+
header: pr-title-lint-error
25+
message: |
26+
Hey there and thank you for opening this pull request! 👋🏼
27+
28+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
29+
30+
Details:
31+
32+
```
33+
${{ steps.lint_pr_title.outputs.error_message }}
34+
```
35+
36+
# Delete a previous comment when the issue has been resolved
37+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
38+
uses: marocchino/sticky-pull-request-comment@v2
39+
with:
40+
header: pr-title-lint-error
41+
delete: true

package.json

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,49 @@
22
"name": "gatsby-plugin-static-cms",
33
"description": "A Gatsby plugin which generates the Static CMS single page app",
44
"version": "1.0.3",
5-
"author": "Shawn Erquhart <shawn@erquh.art>",
6-
"bugs": {
7-
"url": "https://github.com/StaticJsCMS/gatsby-plugin-static-cms/issues"
8-
},
9-
"dependencies": {
10-
"@babel/runtime": "^7.15.4",
11-
"@soda/friendly-errors-webpack-plugin": "1.8.1",
12-
"copy-webpack-plugin": "^7.0.0",
13-
"html-webpack-plugin": "^5.3.2",
14-
"html-webpack-skip-assets-plugin": "^1.0.3",
15-
"html-webpack-tags-plugin": "^3.0.2",
16-
"lodash": "^4.17.21",
17-
"mini-css-extract-plugin": "1.6.2",
18-
"netlify-identity-widget": "^1.9.2"
19-
},
20-
"devDependencies": {
21-
"@babel/cli": "^7.15.4",
22-
"@babel/core": "^7.15.5",
23-
"babel-preset-gatsby-package": "^3.0.0-next.1",
24-
"cross-env": "^7.0.3",
25-
"react": "^18.2.0",
26-
"react-dom": "^18.2.0"
27-
},
28-
"homepage": "https://github.com/StaticJsCMS/gatsby-plugin-static-cms",
5+
"license": "MIT",
6+
"repository": "https://github.com/StaticJsCMS/gatsby-plugin-static-cms.git",
7+
"bugs": "https://github.com/StaticJsCMS/gatsby-plugin-static-cms/issues",
298
"keywords": [
309
"gatsby",
3110
"gatsby-plugin",
3211
"netlify",
3312
"static-cms",
3413
"cms"
3514
],
36-
"license": "MIT",
37-
"main": "index.js",
38-
"peerDependencies": {
39-
"@staticcms/core": "1.0.0-beta0",
40-
"gatsby": "^5.0.0-alpha-v5",
41-
"react": "^18.0.0 || ^0.0.0",
42-
"react-dom": "^18.0.0 || ^0.0.0",
43-
"webpack": "^5.0.0"
44-
},
45-
"repository": {
46-
"type": "git",
47-
"url": "https://github.com/StaticJsCMS/gatsby-plugin-static-cms.git"
48-
},
4915
"scripts": {
5016
"build": "babel src --out-dir . --ignore \"**/__tests__\"",
5117
"prepare": "cross-env NODE_ENV=production npm run build",
5218
"watch": "babel -w src --out-dir . --ignore \"**/__tests__\""
5319
},
20+
"dependencies": {
21+
"@babel/runtime": "7.15.4",
22+
"@soda/friendly-errors-webpack-plugin": "1.8.1",
23+
"copy-webpack-plugin": "7.0.0",
24+
"html-webpack-plugin": "5.3.2",
25+
"html-webpack-skip-assets-plugin": "1.0.3",
26+
"html-webpack-tags-plugin": "3.0.2",
27+
"lodash": "4.17.21",
28+
"mini-css-extract-plugin": "1.6.2",
29+
"netlify-identity-widget": "1.9.2"
30+
},
31+
"devDependencies": {
32+
"@babel/cli": "7.15.4",
33+
"@babel/core": "7.15.5",
34+
"babel-preset-gatsby-package": "3.0.0",
35+
"cross-env": "7.0.3",
36+
"react": "18.2.0",
37+
"react-dom": "18.2.0"
38+
},
39+
"homepage": "https://github.com/StaticJsCMS/gatsby-plugin-static-cms",
40+
"main": "index.js",
41+
"peerDependencies": {
42+
"@staticcms/core": "1.0.0-beta8",
43+
"gatsby": "^5.0.0",
44+
"react": "^18.2.0",
45+
"react-dom": "^18.2.0",
46+
"webpack": "^5.0.0"
47+
},
5448
"engines": {
5549
"node": ">=18.0.0"
5650
}

renovate.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:base", ":semanticCommits"],
4+
"labels": ["dependencies"],
5+
"packageRules": [
6+
{
7+
"matchPackagePrefixes": [
8+
"lint-staged",
9+
"@types/eslint",
10+
"@typescript-eslint/",
11+
"eslint"
12+
],
13+
"labels": ["linting"]
14+
},
15+
{
16+
"matchDepTypes": ["devDependencies"],
17+
"addLabels": ["dev dependencies"]
18+
},
19+
{
20+
"matchUpdateTypes": ["patch"],
21+
"addLabels": ["patch"]
22+
},
23+
{
24+
"matchUpdateTypes": ["minor"],
25+
"addLabels": ["minor"]
26+
},
27+
{
28+
"matchUpdateTypes": ["major"],
29+
"addLabels": ["major"]
30+
},
31+
{
32+
"matchPackagePrefixes": ["@types/react", "react"],
33+
"addLabels": ["react"]
34+
},
35+
{
36+
"matchPackagePrefixes": ["@types/jest", "jest"],
37+
"addLabels": ["testing"]
38+
}
39+
]
40+
}

0 commit comments

Comments
 (0)