This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Example: Using the Reusable Upgrade Environment Workflow | ||
| # This file demonstrates how to call the reusable workflow from other workflows | ||
| name: Example - Upgrade Environment | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| package_name: | ||
| description: 'Package name list to upgrade (comma-separated for multiple packages)' | ||
| required: true | ||
| type: string | ||
| target_environment: | ||
| description: 'Target environment for upgrade' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - 'Release_Source' | ||
| - 'Prod_Env_1' | ||
| - 'QA_Env_1' | ||
| - 'Prod_Env_3' | ||
| push: | ||
| branches: | ||
| - Release_Source | ||
| - Prod_Env_1 | ||
| - QA_Env_1 | ||
| - Prod_Env_3 | ||
| pull_request: | ||
| branches: | ||
| - Prod_Env_1 | ||
| - QA_Env_1 | ||
| - Prod_Env_3 | ||
| jobs: | ||
| # Call the reusable workflow for manual dispatch or push events | ||
| upgrade_on_dispatch_or_push: | ||
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' | ||
| uses: ./.github/workflows/powershell/reusable-upgrade-environment.yml | ||
|
Check failure on line 38 in .github/workflows/example-upgrade-usage.yml
|
||
| with: | ||
| package_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.package_name || '' }} | ||
| target_environment: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_environment || github.ref_name }} | ||
| project_name: 'Demo-PSQL' | ||
| detect_from_push: ${{ github.event_name == 'push' }} | ||
| is_pull_request: false | ||
| secrets: | ||
| DBMAESTRO_SERVER: ${{ vars.DBMAESTRO_SERVER }} | ||
| DBMAESTRO_USER: ${{ secrets.DBMAESTRO_USER }} | ||
| DBMAESTRO_PASSWORD: ${{ secrets.DBMAESTRO_PASSWORD }} | ||
| # Call the reusable workflow for pull request events | ||
| upgrade_on_pr: | ||
| if: github.event_name == 'pull_request' | ||
| uses: ./.github/workflows/powershell/reusable-upgrade-environment.yml | ||
| with: | ||
| target_environment: ${{ github.base_ref }} | ||
| project_name: 'Demo-PSQL' | ||
| is_pull_request: true | ||
| secrets: | ||
| DBMAESTRO_SERVER: ${{ vars.DBMAESTRO_SERVER }} | ||
| DBMAESTRO_USER: ${{ secrets.DBMAESTRO_USER }} | ||
| DBMAESTRO_PASSWORD: ${{ secrets.DBMAESTRO_PASSWORD }} | ||