fix: disable codecov on push

Ayman Bagabas created

Change summary

.github/workflows/build.yml    | 16 ----------------
.github/workflows/coverage.yml | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 16 deletions(-)

Detailed changes

.github/workflows/build.yml 🔗

@@ -10,19 +10,3 @@ jobs:
     uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
     secrets:
       goreleaser_key: ${{ secrets.GORELEASER_KEY }}
-
-  coverage:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v3
-
-      - name: Set up Go
-        uses: actions/setup-go@v4
-        with:
-          go-version: ^1
-
-      - name: Test
-        run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout 5m
-      - uses: codecov/codecov-action@v3
-        with:
-          file: ./coverage.txt

.github/workflows/coverage.yml 🔗

@@ -0,0 +1,20 @@
+name: coverage
+
+on: [pull_request]
+
+jobs:
+  coverage:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+
+      - name: Set up Go
+        uses: actions/setup-go@v4
+        with:
+          go-version: ^1
+
+      - name: Test
+        run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout 5m
+      - uses: codecov/codecov-action@v3
+        with:
+          file: ./coverage.txt