Skip to content

Commit 4d5e834

Browse files
jimassahainenber
authored andcommitted
fix: run conditions on step level when using matrix strategy. (microsoft#195)
# Description Condition on job runs, before matrix strategy, which makes some require job not run in merge queue. This brings the condition on the steps level to allow matrix strategy to create jobs. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documantation](https://retina.sh/docs/contributing). - [ ] I signed and signed-off the commits (`git commit -S -s ...`) - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Jacques Massa <[email protected]>
1 parent 86d1c58 commit 4d5e834

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/codeql.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,32 @@ jobs:
1717
language: [go]
1818
go-version: ["1.21"]
1919
runs-on: ${{ matrix.os }}
20+
env:
21+
IS_NOT_MERGE_GROUP: ${{ github.event_name != 'merge_group' }}
2022
timeout-minutes: 90
2123
permissions:
2224
actions: read
2325
contents: read
2426
security-events: write
2527
steps:
2628
- name: Setup go
29+
if: env.IS_NOT_MERGE_GROUP
2730
uses: actions/setup-go@v5
2831
with:
2932
go-version: ${{ matrix.go-version }}
3033
- name: Checkout repository
34+
if: env.IS_NOT_MERGE_GROUP
3135
uses: actions/checkout@v4
3236
- name: Initialize CodeQL
37+
if: env.IS_NOT_MERGE_GROUP
3338
uses: github/codeql-action/init@v3
3439
with:
3540
languages: ${{ matrix.language }}
3641
- name: Autobuild
42+
if: env.IS_NOT_MERGE_GROUP
3743
uses: github/codeql-action/autobuild@v3
3844
- name: Perform CodeQL Analysis
45+
if: env.IS_NOT_MERGE_GROUP
3946
uses: github/codeql-action/analyze@v3
4047
with:
4148
category: "/language:${{matrix.language}}"

.github/workflows/golangci-lint.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,26 @@ on:
88
branches: [main]
99
jobs:
1010
golangci:
11-
if: ${{ github.event_name != 'merge_group' }}
1211
strategy:
1312
fail-fast: false
1413
matrix:
1514
go-version: ["1.21.x"]
1615
os: [ubuntu-latest, windows-latest]
1716
name: Lint
1817
runs-on: ${{ matrix.os }}
18+
env:
19+
IS_NOT_MERGE_GROUP: ${{ github.event_name != 'merge_group' }}
1920
steps:
2021
- uses: actions/setup-go@v5
22+
if: env.IS_NOT_MERGE_GROUP
2123
with:
2224
go-version: ${{ matrix.go-version }}
2325
- uses: actions/checkout@v4
26+
if: env.IS_NOT_MERGE_GROUP
2427
with:
2528
fetch-depth: 0
2629
- name: golangci-lint
30+
if: env.IS_NOT_MERGE_GROUP
2731
uses: golangci/golangci-lint-action@v4
2832
with:
2933
version: v1.55

0 commit comments

Comments
 (0)