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)

* 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
tuntoja and mushroomempires committed Dec 19, 2024
1 parent f476d93 commit 332aced
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 68 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
deliver-sources:
runs-on: [self-hosted, common]
needs: [get-version, package]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' && github.repository == 'centreon/centreon-collect' }}

steps:
- name: Checkout sources
Expand All @@ -117,7 +117,7 @@ jobs:
token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }}

deliver-rpm:
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) }}
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) && github.repository == 'centreon/centreon-collect' }}
needs: [get-version, package]
environment: ${{ needs.get-version.outputs.environment }}
runs-on: [self-hosted, common]
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
release_cloud: ${{ needs.get-version.outputs.release_cloud }}

deliver-deb:
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) }}
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) && github.repository == 'centreon/centreon-collect' }}
needs: [get-version, package]
environment: ${{ needs.get-version.outputs.environment }}
runs-on: [self-hosted, common]
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:

promote:
needs: [get-version]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' && 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-version:
if: github.repository == 'centreon/centreon-collect'
uses: ./.github/workflows/get-version.yml
with:
version_file: CMakeLists.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gorgone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
deliver-sources:
runs-on: [self-hosted, common]
needs: [get-version, package]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' && github.repository == 'centreon/centreon-collect' }}

steps:
- name: Checkout sources
Expand All @@ -114,7 +114,7 @@ jobs:
deliver-rpm:
runs-on: [self-hosted, common]
needs: [get-version, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) }}
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) && github.repository == 'centreon/centreon-collect' }}

strategy:
matrix:
Expand All @@ -139,7 +139,7 @@ jobs:
deliver-deb:
runs-on: [self-hosted, common]
needs: [get-version, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) }}
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) && github.repository == 'centreon/centreon-collect' }}

strategy:
matrix:
Expand All @@ -163,7 +163,7 @@ jobs:

promote:
needs: [get-version]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' && github.repository == 'centreon/centreon-collect' }}
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lua-curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:

promote:
needs: [get-version]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' && github.repository == 'centreon/centreon-collect' }}
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/rebase-master.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/rebase-version.yml

This file was deleted.

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-22.04
steps:
- name: Check base_ref
Expand Down

0 comments on commit 332aced

Please sign in to comment.