Skip to content

Commit

Permalink
fix: add github workflow and dependabot config
Browse files Browse the repository at this point in the history
  • Loading branch information
schabibi1 committed Jun 1, 2022
1 parent 225712d commit d155898
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 386 deletions.
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
time: "05:00"
commit-message:
prefix: fix
prefix-development: chore
include: scope
28 changes: 28 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# **** AUTOMERGE ****
# Merge automatically the PR that contain a minor or patch update on the dependency you define in env.DEPENDENCY
# - Inspiration: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request

name: Dependabot auto-merge
on: pull_request

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{contains(steps.metadata.outputs.dependency-names, env.DEPENDENCY) && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor')}}
run: gh pr merge --auto --merge "$PR_URL"
env:
DEPENDENCY: "@storyblok/react"
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release CI

on:
push:
branches: [main, feature/v4]
pull_request:
branches: [main, feature/v4]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "16.13.2"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build lib
run: npm run build
- name: Jest run
run: npm run test:unit
- name: Cypress run
run: npm run test:e2e
- name: Release
working-directory: lib
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.cache/
.DS_Store
yarn-error.log
yarn.lock
node_modules
dist
dist-v2
lib/cypress/videos
.next
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
6 changes: 6 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
# npx --no-install commitlint --edit

4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.*
*.md
*.json
example
7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const query = graphql`
#### 2. Listen to Storyblok Visual Editor events

Use `useStoryblok` to get the new story every time is triggered a `change` event from the Visual Editor. You need to pass the `originalStory` as a first param. `bridgeOptions` (second param) is an optional param if you want to set the options for bridge by yourself:
Use `useStoryblokState` to get the new story every time is triggered a `change` event from the Visual Editor. You need to pass the `originalStory` as a first param. `bridgeOptions` (second param) is an optional param if you want to set the options for bridge by yourself:

```js
import { StoryblokComponent, useStoryblokState } from "gatsby-source-storyblok"
Expand Down Expand Up @@ -190,11 +190,9 @@ import { storyblokEditable } from "gatsby-source-storyblok";

const Feature = ({ blok }) => {
return (
<div {...storyblokEditable(blok)} key={blok._uid} data-test="feature">
<div>
<div>{blok.name}</div>
<p>{blok.description}</p>
</div>
<div {...storyblokEditable(blok)} key={blok._uid}>
<div>{blok.name}</div>
<p>{blok.description}</p>
</div>
);
};
Expand Down
145 changes: 0 additions & 145 deletions gatsby-node.js

This file was deleted.

1 change: 0 additions & 1 deletion index.js

This file was deleted.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 0 additions & 31 deletions src/getStoryParams.js

This file was deleted.

Loading

0 comments on commit d155898

Please sign in to comment.