Skip to content

Commit

Permalink
feat: Don't trigger deployment on Dependabot pr's and depend deployme… (
Browse files Browse the repository at this point in the history
#58)

* feat: Don't trigger deployment on Dependabot pr's and depend deployment on success of code quality

* fix: prettier

* feat: require branch to not be from a fork pr

* fix: prettier

* fix: make svelte-check optional (for now)

* fix: prettier

* fix: only run lint since write is not part of commit
  • Loading branch information
maalni authored Mar 29, 2024
1 parent d475b04 commit fdd059a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 15 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/check-code-quality-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: 'Check code quality'
on: workflow_dispatch

jobs:
check-svelte-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/Iron
- run: npm install -g pnpm
- run: pnpm install
- run: pnpm svelte-check
14 changes: 11 additions & 3 deletions .github/workflows/check-code-quality.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: check-code-quality
run-name: Check code quality
on: [pull_request]
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: 'Check code quality'
on:
push:
branches:
- main
pull_request:
branches:
- '**'

jobs:
check-typescript:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: 'delete deployments'
name: 'Delete redundant deployments'
on:
pull_request:
types:
Expand All @@ -10,6 +10,7 @@ on:

jobs:
delete:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == 'dval-in/dval-in' }}
permissions:
contents: read
deployments: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: 'Deploy to Cloudflare'
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_run:
workflows: [Check code quality]
types:
- completed

jobs:
publish:
on-success:
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == 'dval-in/dval-in' }}
permissions:
contents: read
deployments: write
Expand Down
8 changes: 4 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm format && pnpm lint
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint

0 comments on commit fdd059a

Please sign in to comment.