Skip to content

Commit

Permalink
Merge pull request #8 from silkstudio/dev
Browse files Browse the repository at this point in the history
Adding CI Workflows
  • Loading branch information
nathnhughes authored May 3, 2022
2 parents 67f893a + fb45ad6 commit f6520bf
Show file tree
Hide file tree
Showing 4 changed files with 965 additions and 56 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Dependabot Pull Request Auto Merge

on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
# Checking the actor will prevent your Action run failing on non-Dependabot
# PRs but also ensures that it only does work for Dependabot PRs.
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
# This first step will fail if there's no metadata and so the approval
# will not occur.
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.1.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Here the PR gets approved.
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Finally, this sets the PR to allow auto-merging for patch and minor
# updates if all checks pass
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"upload": "contentful-app-scripts upload --bundle-dir ./build",
"upload-ci": "contentful-app-scripts upload --ci --bundle-dir ./build --organization-id $CONTENTFUL_ORG_ID --definition-id $CONTENTFUL_APP_DEF_ID --token $CONTENTFUL_ACCESS_TOKEN"
"upload:dev": "dotenv -- cross-var contentful-app-scripts upload --ci --bundle-dir ./build --organization-id %CONTENTFUL_ORG_ID% --definition-id %DEV_CONTENTFUL_APP_DEF_ID% --token %CONTENTFUL_ACCESS_TOKEN% --skip-activation",
"upload:prod": "dotenv -- cross-var contentful-app-scripts upload --ci --bundle-dir ./build --organization-id %CONTENTFUL_ORG_ID% --definition-id %PROD_CONTENTFUL_APP_DEF_ID% --token %CONTENTFUL_ACCESS_TOKEN%"
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -29,7 +29,7 @@
"@contentful/app-sdk": "^4.3.5",
"@contentful/f36-components": "^4.0.43",
"@contentful/f36-tokens": "^4.0.1",
"@emotion/css": "^11.7.1",
"@emotion/css": "^11.9.0",
"@types/styled-components": "^5.1.24",
"contentful-management": "^8.2.0",
"imagekit": "^3.2.5",
Expand All @@ -39,17 +39,19 @@
"react-dom": "^17.0.2",
"react-error-boundary": "^3.1.4",
"react-scripts": "4.0.3",
"styled-components": "^5.3.3"
"styled-components": "^5.3.5"
},
"devDependencies": {
"@contentful/app-scripts": "^0.15.3",
"@contentful/app-scripts": "^1.1.2",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.4",
"@types/jest": "^27.4.1",
"@types/jest": "^27.5.0",
"@types/node": "^17.0.21",
"@types/react": "^17.0.40",
"@types/react": "^18.0.8",
"@types/react-dom": "^17.0.13",
"cross-env": "^7.0.3",
"cross-var": "^1.1.0",
"dotenv-cli": "^5.1.0",
"prettier": "^2.5.1",
"typescript": "^4.6.2"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Dialog: React.FC<Props> = ({ sdk }) => {
}
)
}
}, [])
}, [sdk])

return (
<ErrorBoundary FallbackComponent={ErrorFallback}>
Expand Down
Loading

0 comments on commit f6520bf

Please sign in to comment.