From fdee4882421a298ce298158e9ed65edb94a9acf6 Mon Sep 17 00:00:00 2001 From: asyncapi-bot <61865014+asyncapi-bot@users.noreply.github.com> Date: Tue, 8 Feb 2022 10:39:48 +0100 Subject: [PATCH] ci: update global workflows (#469) --- .github/workflows/if-go-pr-testing.yml | 24 +++++++++++++++------- .github/workflows/if-nodejs-pr-testing.yml | 14 +++++++++---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/if-go-pr-testing.yml b/.github/workflows/if-go-pr-testing.yml index 4a4078ff1..8893baec8 100644 --- a/.github/workflows/if-go-pr-testing.yml +++ b/.github/workflows/if-go-pr-testing.yml @@ -6,16 +6,21 @@ name: PR testing - if Go project on: pull_request: types: [opened, reopened, synchronize, ready_for_review] - + jobs: lint: - if: github.event.pull_request.draft == false name: lint runs-on: ubuntu-latest steps: - - name: Checkout repository + - if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))" + id: should_run + name: Should Run + run: echo "::set-output name=shouldrun::true" + - if: steps.should_run.outputs.shouldrun == 'true' + name: Checkout repository uses: actions/checkout@v2 - - name: Check if Go project and has go.mod + - if: steps.should_run.outputs.shouldrun == 'true' + name: Check if Go project and has go.mod id: gomod run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" shell: bash @@ -31,16 +36,21 @@ jobs: skip-go-installation: true # we wanna control the version of Go in use test: - if: github.event.pull_request.draft == false name: ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - name: Checkout repository + - if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))" + id: should_run + name: Should Run + run: echo "::set-output name=shouldrun::true" + - if: steps.should_run.outputs.shouldrun == 'true' + name: Checkout repository uses: actions/checkout@v2 - - name: Check if Go project and has go.mod + - if: steps.should_run.outputs.shouldrun == 'true' + name: Check if Go project and has go.mod id: gomod run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" shell: bash diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 812e73af7..6a9ad91c3 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -9,20 +9,26 @@ on: jobs: test: - if: github.event.pull_request.draft == false name: ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows + - if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))" + id: should_run + name: Should Run + run: echo "::set-output name=shouldrun::true" + - if: steps.should_run.outputs.shouldrun == 'true' + name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows run: | git config --global core.autocrlf false git config --global core.eol lf - - name: Checkout repository + - if: steps.should_run.outputs.shouldrun == 'true' + name: Checkout repository uses: actions/checkout@v2 - - name: Check if Node.js project and has package.json + - if: steps.should_run.outputs.shouldrun == 'true' + name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" shell: bash