Skip to content

Commit eeb292a

Browse files
authored
ci: update global workflows (#81)
1 parent 434b90c commit eeb292a

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

Diff for: .github/workflows/if-go-pr-testing.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ name: PR testing - if Go project
66
on:
77
pull_request:
88
types: [opened, reopened, synchronize, ready_for_review]
9-
9+
1010
jobs:
1111
lint:
12-
if: github.event.pull_request.draft == false
1312
name: lint
1413
runs-on: ubuntu-latest
1514
steps:
16-
- name: Checkout repository
15+
- 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')))"
16+
id: should_run
17+
name: Should Run
18+
run: echo "::set-output name=shouldrun::true"
19+
- if: steps.should_run.outputs.shouldrun == 'true'
20+
name: Checkout repository
1721
uses: actions/checkout@v2
18-
- name: Check if Go project and has go.mod
22+
- if: steps.should_run.outputs.shouldrun == 'true'
23+
name: Check if Go project and has go.mod
1924
id: gomod
2025
run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
2126
shell: bash
@@ -31,16 +36,21 @@ jobs:
3136
skip-go-installation: true # we wanna control the version of Go in use
3237

3338
test:
34-
if: github.event.pull_request.draft == false
3539
name: ${{ matrix.os }}
3640
runs-on: ${{ matrix.os }}
3741
strategy:
3842
matrix:
3943
os: [ubuntu-latest, macos-latest, windows-latest]
4044
steps:
41-
- name: Checkout repository
45+
- 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')))"
46+
id: should_run
47+
name: Should Run
48+
run: echo "::set-output name=shouldrun::true"
49+
- if: steps.should_run.outputs.shouldrun == 'true'
50+
name: Checkout repository
4251
uses: actions/checkout@v2
43-
- name: Check if Go project and has go.mod
52+
- if: steps.should_run.outputs.shouldrun == 'true'
53+
name: Check if Go project and has go.mod
4454
id: gomod
4555
run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
4656
shell: bash

Diff for: .github/workflows/if-nodejs-pr-testing.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@ on:
99

1010
jobs:
1111
test:
12-
if: github.event.pull_request.draft == false
1312
name: ${{ matrix.os }}
1413
runs-on: ${{ matrix.os }}
1514
strategy:
1615
matrix:
1716
os: [ubuntu-latest, macos-latest, windows-latest]
1817
steps:
19-
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
18+
- 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')))"
19+
id: should_run
20+
name: Should Run
21+
run: echo "::set-output name=shouldrun::true"
22+
- if: steps.should_run.outputs.shouldrun == 'true'
23+
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
2024
run: |
2125
git config --global core.autocrlf false
2226
git config --global core.eol lf
23-
- name: Checkout repository
27+
- if: steps.should_run.outputs.shouldrun == 'true'
28+
name: Checkout repository
2429
uses: actions/checkout@v2
25-
- name: Check if Node.js project and has package.json
30+
- if: steps.should_run.outputs.shouldrun == 'true'
31+
name: Check if Node.js project and has package.json
2632
id: packagejson
2733
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
2834
shell: bash

0 commit comments

Comments
 (0)