diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..692bd58 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..4451f2e --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,30 @@ +name: Code Coverage + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + coverage: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Run tests and collect coverage + run: | + npm run test -- --coverage + npx codecov diff --git a/.github/workflows/disable-deploy-for-new-branches.yml b/.github/workflows/disable-deploy-for-new-branches.yml index 4b13544..809a3a9 100644 --- a/.github/workflows/disable-deploy-for-new-branches.yml +++ b/.github/workflows/disable-deploy-for-new-branches.yml @@ -37,6 +37,14 @@ jobs: git config --global user.name "github-actions" git config --global user.email "github-actions@github.com" git add vercel.json - git commit -m "Disable auto deploy for branch $BRANCH_NAME" - git push + + # Check if there are any changes to commit + if git diff --cached --quiet; then + echo "No changes to commit, skipping git commit." + else + git commit -m "Disable auto deploy for branch $BRANCH_NAME" + git push + fi + else + echo "Branch $BRANCH_NAME already exists in vercel.json, skipping." fi