ci: update workflow #33
Workflow file for this run
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
| name: Build and Pull Request | |
| on: | |
| push: | |
| branches: | |
| - feature/** | |
| - fix/** | |
| env: | |
| TYPE: ${{ startsWith(github.ref_name, 'feature') && 'Feature' || 'Fix'}} | |
| LABELS: ${{ startsWith(github.ref_name, 'feature') && 'automatic,feature' || 'automatic,fix' }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| variables: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| type: ${{ steps.environment.outputs.type }} | |
| labels: ${{ steps.environment.outputs.labels }} | |
| target-branch: ${{ steps.environment.outputs.target-branch }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: "corretto" | |
| cache: "maven" | |
| - id: environment | |
| name: Set output environment passed to the reusable workflow | |
| run: | | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "type=$TYPE" >> $GITHUB_OUTPUT | |
| echo "labels=$LABELS" >> $GITHUB_OUTPUT | |
| echo "target-branch=release/$VERSION" >> $GITHUB_OUTPUT | |
| ci: | |
| needs: variables | |
| uses: ./.github/workflows/ci-maven.yml | |
| secrets: inherit | |
| pull-request: | |
| needs: [ci, variables] | |
| if: success() | |
| uses: ./.github/workflows/ci-pull-request.yml | |
| secrets: inherit | |
| with: | |
| type: ${{ needs.variables.outputs.type }} | |
| labels: ${{ needs.variables.outputs.labels }} | |
| source-branch: ${{ github.ref_name }} | |
| target-branch: develop |