From d8ab5b6ae08505853dd74bee00b2f71cf00f1f5f Mon Sep 17 00:00:00 2001 From: Chi Huu Huynh <73843190+Chi-EEE@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:56:15 +0000 Subject: [PATCH] Update cpp_check to use in make report in other branch --- .github/workflows/cpp_check.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cpp_check.yml b/.github/workflows/cpp_check.yml index 936660d9..420bf155 100644 --- a/.github/workflows/cpp_check.yml +++ b/.github/workflows/cpp_check.yml @@ -1,23 +1,41 @@ -# From: https://github.com/marketplace/actions/cppcheck-action +# From: https://github.com/marketplace/actions/cppcheck-action & https://stackoverflow.com/a/76512688 name: cppcheck-action-test -on: [push] +on: + push: + branches: [main] jobs: build: name: cppcheck-test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Git User + run: | + git config user.name "GitHub Action" + git config user.email "" + + - name: Update cpp_check Branch + run: | + git checkout main + git fetch origin + git checkout cpp_check + git pull + git merge origin/main + git push origin cpp_check - name: cppcheck uses: deep5050/cppcheck-action@main with: github_token: ${{ secrets.GITHUB_TOKEN}} - - name: publish report uses: mikeal/publish-to-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH_NAME: 'main' \ No newline at end of file + BRANCH_NAME: 'cpp_check' \ No newline at end of file