Skip to content

Commit 57f2aa5

Browse files
WIP ci: Don't fail on personal fork action run
1 parent b59aa1f commit 57f2aa5

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/development.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313
pull-requests: read
1414
jobs:
1515
lint:
16+
if: ${{ github.repository == 'matterbridge-org/matterbridge' }}
1617
name: golangci-lint
1718
runs-on: ubuntu-latest
1819
steps:
@@ -33,6 +34,29 @@ jobs:
3334
with:
3435
version: v2.1
3536
args: --build-tags=goolm --config=.golangci-incremental.yaml
37+
lint_personal_fork:
38+
if: ${{ github.repository != 'matterbridge-org/matterbridge' }}
39+
name: golangci-lint (personal fork branch)
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v5
43+
- run: "git remote add upstream https://github.com/matterbridge-org/matterbridge"
44+
- run: "git fetch --depth=1 upstream master"
45+
- run: "git branch __ci_upstream_master FETCH_HEAD"
46+
- uses: actions/setup-go@v6
47+
with:
48+
go-version: 1.24.x
49+
- name: golangci-lint
50+
uses: golangci/golangci-lint-action@v8
51+
with:
52+
version: v2.1
53+
skip-cache: true
54+
# Compare to upstream's master branch.
55+
# It looks like Github Actions partial clones don't really like comparing
56+
# with previous commit overwritten by a force push, which in any case does
57+
# not really make sense when working on a feature branch.
58+
args: >-
59+
--build-tags=goolm --new-from-rev=__ci_upstream_master
3660
test:
3761
strategy:
3862
matrix:
@@ -51,6 +75,8 @@ jobs:
5175
- name: go test -tags goolm ./... (go version ${{ matrix.go-version }})
5276
run: go test -tags goolm ./...
5377
build-upload:
78+
# Dont build artifacts for downstream branches not tracked by a PR
79+
if: ${{ github.event_name == 'pull_request' || github.repository == 'matterbridge-org/matterbridge' }}
5480
# Uploading artifacts only if lint/test succeeded
5581
needs: [ "lint", "test" ]
5682
strategy:

0 commit comments

Comments
 (0)