From 4a4c2bd38f9161fb45629c23f52181b49ee1964b Mon Sep 17 00:00:00 2001 From: adnanbrq Date: Sat, 20 Jul 2024 22:40:36 +0200 Subject: [PATCH] WIP: Workflow update: Push changes only on PR and added ref to checkout to avoid detached state --- .github/workflows/test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 83ac51b..973c0ca 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,6 +14,8 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - name: Set up Go uses: actions/setup-go@v4 @@ -38,7 +40,8 @@ jobs: BADGE="[![Coverage](https://img.shields.io/badge/Coverage-${COVERAGE}-brightgreen)](./coverage.out)" sed -i "1 s|.*|${BADGE}|" README.md - - name: Push README changes + - name: Push README changes (PR Only) + if: ${{ github.event_name == 'pull_request' }} uses: EndBug/add-and-commit@v9 with: default_author: github_actions