Skip to content

Commit

Permalink
Revert "feat(ci): external_contrib v9 (#69)"
Browse files Browse the repository at this point in the history
This reverts commit 98ef78b.
  • Loading branch information
sc979 committed Nov 19, 2024
1 parent 9880039 commit 755e7eb
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
branches:
- develop
- dev-[2-9][0-9].[0-9][0-9].x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/awie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/check-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
check-status:
runs-on: ubuntu-24.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- name: Check workflow statuses and display token usage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clean-cache.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: clean-cache

on:
pull_request_target:
pull_request:
types:
- closed

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-repo-yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
paths:
- ".github/workflows/create-repo-yum.yml"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
paths:
- ".github/docker/keycloak/**"
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- dev-[2-9][0-9].[0-9][0-9].x
paths:
- ".github/docker/Dockerfile.packaging-*"
pull_request_target:
pull_request:
paths:
- ".github/docker/Dockerfile.packaging-*"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- dev-[2-9][0-9].[0-9][0-9].x
paths:
- ".github/docker/Dockerfile.translation"
pull_request_target:
pull_request:
paths:
- ".github/docker/Dockerfile.translation"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-web-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
paths:
- '.github/docker/centreon-web/**/Dockerfile.dependencies'
schedule:
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/dsm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand All @@ -31,21 +31,7 @@ env:
module: dsm

jobs:
validation:
runs-on: ubuntu-22.04
outputs:
environment_pull_request: ${{ steps.validate.outputs.environment_pull_request }}
steps:
- name: validate
run: |
ENVIRONMENT_PULL_REQUEST="external_contributor"
if [[ "${{ github.author_association }}" != "MEMBER" || "${{ github.author_association }}" != "CONTRIBUTOR" || "${{ github.author_association }}" != "OWNER" ]]; then
ENVIRONMENT_PULL_REQUEST="internal_contributor"
fi
echo "environment_pull_request=$ENVIRONMENT_PULL_REQUEST" >> $GITHUB_OUTPUT
get-version:
environment: ${{ need.validation.outputs.environment_pull_request }}
uses: ./.github/workflows/get-version.yml
with:
version_file: centreon-dsm/www/modules/centreon-dsm/conf.php
Expand Down
49 changes: 10 additions & 39 deletions .github/workflows/get-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,9 @@ jobs:
environment: ${{ steps.get_version.outputs.env }}
os_and_database_matrix: ${{ steps.get_os_database_matrix.outputs.result }}
release_type: ${{ steps.get_version.outputs.release_type }}
release_cloud: ${{ steps.get_version.outputs.release_cloud }}
release_cloud: ${{ steps.get_version.outputs.release_cloud}}

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
Expand Down Expand Up @@ -118,16 +113,6 @@ jobs:
echo "BRANCHNAME is: $BRANCHNAME"
# Check if pull_request is internal or contribution
IS_EXTERNAL_CONTRIBUTION=""
if [ "${{ github.repository }}" != "${{ github.event.pull_request.head.repo.full_name }}" ]; then
echo "Detected external contribution, setting IS_CONTRIBUTION value to yes."
IS_EXTERNAL_CONTRIBUTION="yes"
else
echo "Detected internal contribution, setting IS_CONTRIBUTION value to no."
IS_EXTERNAL_CONTRIBUTION="no"
fi
# Set default release values
GITHUB_RELEASE_CLOUD=0
GITHUB_RELEASE_TYPE=$(echo $BRANCHNAME |cut -d '-' -f 1)
Expand Down Expand Up @@ -193,33 +178,19 @@ jobs:
;;
*)
# Any branch name
echo "Github repository context var: $GITHUB_REPOSITORY"
if [[ "$IS_EXTERNAL_CONTRIBUTION" == "no" ]]; then
echo "Internal contribution."
echo "release_cloud=1" >> $GITHUB_OUTPUT
echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT
# GITHUB_BRANCH_BASE_REF_NAME="$(gh pr view $BRANCHNAME -q .baseRefName --json headRefName,baseRefName,state)"
# GITHUB_BRANCH_PR_STATE="$(gh pr view $BRANCHNAME -q .state --json headRefName,baseRefName,state)"
elif [[ "$IS_EXTERNAL_CONTRIBUTION" == "yes" ]]; then
echo "External contribution."
GITHUB_BRANCH_BASE_REF_NAME="$(gh pr view $BRANCHNAME -q .baseRefName --json headRefName,baseRefName,state)"
GITHUB_BRANCH_PR_STATE="$(gh pr view $BRANCHNAME -q .state --json headRefName,baseRefName,state)"
echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT
# Check if pull request branch targeting develop
if [[ "$GITHUB_BRANCH_BASE_REF_NAME" == "develop" ]] && [[ "$GITHUB_BRANCH_PR_STATE" == "OPEN" ]]; then
echo "release_cloud=1" >> $GITHUB_OUTPUT
echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT
# CONTRIB_PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --head ${{ github.head_ref }} -q .[].number --json number)
# GITHUB_BRANCH_PR_STATE="$(gh pr view $CONTRIB_PR_NUMBER -q .state --json headRefName,baseRefName,state)"
else
echo "Invalid value for IS_EXTERNAL_CONTRIBUTION : $IS_EXTERNAL_CONTRIBUTION ."
echo "release_cloud=$GITHUB_RELEASE_CLOUD" >> $GITHUB_OUTPUT
echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT
fi
echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT
# Check if pull request branch targeting develop
# if [[ "$GITHUB_BRANCH_BASE_REF_NAME" == "develop" ]] && [[ "$GITHUB_BRANCH_PR_STATE" == "OPEN" ]]; then
# echo "release_cloud=1" >> $GITHUB_OUTPUT
# echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT
# else
# echo "release_cloud=$GITHUB_RELEASE_CLOUD" >> $GITHUB_OUTPUT
# echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT
# fi
# ;;
;;
esac
case "$BRANCHNAME" in
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js-config-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: centreon-js-config-beta

on:
workflow_dispatch:
pull_request_target:
pull_request:
paths:
- 'centreon/packages/js-config/**'
- '.github/workflows/js-config-beta.yml'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/open-tickets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

on:
workflow_dispatch:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Release

on:
pull_request_target:
pull_request:
types:
- closed
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: centreon-ui-beta

on:
workflow_dispatch:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui-context-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: centreon-ui-context-beta

on:
workflow_dispatch:
pull_request_target:
pull_request:
paths:
- "centreon/packages/ui-context/**"
- '.github/workflows/ui-context.yml'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui-context-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: centreon-ui-context-stable

on:
workflow_dispatch:
pull_request_target:
pull_request:
types:
- closed
paths:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/veracode-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
# skip analysis of draft PR and analysis on development branches using workflow dispatch
SKIP_ANALYSIS="true"
if [[ ("${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "pull_request_target") && -n "${{ github.event.pull_request.number }}" && -n "${{ github.event.pull_request.draft }}" && "${{ github.event.pull_request.draft }}" == "false" ]] || [[ "$DEVELOPMENT_STAGE" != "Development" ]]; then
if [[ "${{ github.event_name }}" == "pull_request" && -n "${{ github.event.pull_request.number }}" && -n "${{ github.event.pull_request.draft }}" && "${{ github.event.pull_request.draft }}" == "false" ]] || [[ "$DEVELOPMENT_STAGE" != "Development" ]]; then
SKIP_ANALYSIS="false"
fi
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
RESULT=`find ./ -type f -name "composer.lock" -o -name "composer.json"`
if [[ -n ${RESULT[0]} ]]; then
echo "trigger_sca_scan=true" >> $GITHUB_ENV
echo "trigger_sca_scan=true" >> $GITHUB_ENV
fi
- name: SCA scan
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
type: boolean
schedule:
- cron: "0 3 * * 1-5"
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand Down

0 comments on commit 755e7eb

Please sign in to comment.