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) (#1966)

* 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 <110405507+mushroomempires@users.noreply.github.com>
  • Loading branch information
2 people authored and bouda1 committed Jan 21, 2025
1 parent 3908769 commit 9bd3cb0
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 14 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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 @@ -151,7 +157,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 @@ -199,7 +206,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 @@ -236,7 +244,8 @@ jobs:
if: |
needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
failure() &&
startsWith(github.ref_name, 'dev')
startsWith(github.ref_name, 'dev') &&
github.repository == 'centreon/centreon-collect'
uses: ./.github/actions/create-jira-ticket
with:
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
Expand All @@ -252,7 +261,9 @@ jobs:
(contains(fromJson('["stable", "testing"]'), 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
13 changes: 9 additions & 4 deletions .github/workflows/gorgone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ jobs:
needs.get-environment.outputs.stability == 'stable' &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
steps:
- name: Checkout sources
Expand All @@ -168,7 +169,8 @@ jobs:
contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
strategy:
matrix:
Expand Down Expand Up @@ -198,7 +200,8 @@ jobs:
contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
strategy:
matrix:
Expand Down Expand Up @@ -227,7 +230,9 @@ jobs:
(contains(fromJson('["stable", "testing"]'), 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 @@ -232,7 +232,8 @@ jobs:
(contains(fromJson('["stable", "testing"]'), 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 @@ -221,7 +221,8 @@ jobs:
(contains(fromJson('["stable", "testing"]'), 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-master.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/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
1 change: 1 addition & 0 deletions .github/workflows/windows-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
version_file: CMakeLists.txt

build-and-test-agent:
if: github.repository == 'centreon/centreon-collect'
needs: [get-environment]
runs-on: windows-latest
env:
Expand Down

0 comments on commit 9bd3cb0

Please sign in to comment.