name: 'setup-java' description: | Github action to setup java and adding custom root certificate in the truststore see more information in official setup-java action https://github.com/actions/setup-java branding: icon: zap color: gray-dark inputs: version: description: 'java version to setup' default: '21' required: false distribution: description: 'java distribution to setup' default: 'temurin' required: false runs: using: "composite" steps: - name: Retrieve root ca certificate id: get-ca-cert uses: RouxAntoine/get-ca-cert@v1.0.0 - name: Setup java ${{ inputs.distribution }} version ${{ inputs.version }} uses: actions/setup-java@v4 id: java with: distribution: "${{ inputs.distribution }}" java-version: "${{ inputs.version }}" overwrite-settings: false - name: Add root certificate to java truststore uses: RouxAntoine/add-ca-truststore@v1.1.0 id: add-ca-to-truststore with: alias-name: antoine-roux.tk ca-cert: "${{ steps.get-ca-cert.outputs.ca-cert }}" store-path: "${{ steps.java.outputs.path }}/lib/security/cacerts"