Skip to content

Commit

Permalink
enh(ci): run push and publish jobs only on centreon/centreon-collect (#…
Browse files Browse the repository at this point in the history
…1920) (#1968)

* enh(ci): run push and publish jobs only on centreon/centreon

* Update .github/workflows/centreon-collect.yml

* Update .github/workflows/centreon-collect.yml

---------

Co-authored-by: May <[email protected]>
  • Loading branch information
tuntoja and mushroomempires authored Dec 23, 2024
1 parent 84e8df2 commit 15a0849
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ jobs:
deliver-sources:
runs-on: [self-hosted, common]
needs: [get-environment, package]
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
if: |
github.event_name != 'workflow_dispatch' &&
needs.get-environment.outputs.stability == 'stable' &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
steps:
- name: Checkout sources
Expand All @@ -125,7 +131,8 @@ jobs:
contains(fromJson('["testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
needs: [get-environment, package]
runs-on: [self-hosted, common]
strategy:
Expand Down Expand Up @@ -160,7 +167,8 @@ jobs:
contains(fromJson('["testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
needs: [get-environment, package]
runs-on: [self-hosted, common]
strategy:
Expand Down Expand Up @@ -194,7 +202,9 @@ jobs:
(contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:

jobs:
get-environment:
if: github.repository == 'centreon/centreon-collect'
uses: ./.github/workflows/get-environment.yml
with:
version_file: CMakeLists.txt
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/gorgone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ jobs:
(contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/libzmq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ jobs:
(contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lua-curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ jobs:
(contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
main:
name: Sync Stable Branches
runs-on: ubuntu-24.04
if: github.event.pull_request.merged == true
if: github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect'
steps:
- name: git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
release:
if: ${{ github.event.pull_request.merged == true }}
if: ${{ github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect' }}
runs-on: ubuntu-24.04
steps:
- name: Check base_ref
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/synchronize-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
main:
name: Sync Stable Branches
runs-on: ubuntu-24.04
if: github.event.pull_request.merged == true
if: github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect'
steps:
- name: git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down

0 comments on commit 15a0849

Please sign in to comment.