From d8b33645ffbb187807d4b22f12dbf266e57a8495 Mon Sep 17 00:00:00 2001 From: asyncapi-bot <61865014+asyncapi-bot@users.noreply.github.com> Date: Tue, 8 Feb 2022 10:40:29 +0100 Subject: [PATCH] ci: update global workflows (#38) --- .github/workflows/if-go-pr-testing.yml | 22 ++++++++++++++++------ .github/workflows/if-nodejs-pr-testing.yml | 14 ++++++++++---- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/if-go-pr-testing.yml b/.github/workflows/if-go-pr-testing.yml index 5c6920b..8893bae 100644 --- a/.github/workflows/if-go-pr-testing.yml +++ b/.github/workflows/if-go-pr-testing.yml @@ -9,13 +9,18 @@ on: jobs: lint: - 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')))" 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 &&!((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')))" 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 d06edb7..6a9ad91 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 && !((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')))" 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