Skip to content

Commit 5906935

Browse files
committed
chore: Optimize action
1 parent f4a376e commit 5906935

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/release_test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ jobs:
4141

4242
- name: Enable TLS 1.0 and 1.1 in java.security
4343
run: |
44-
if [[ "${{ runner.os }}" == "Windows" ]]; then
45-
sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
46-
elif [[ "${{ runner.os }}" == "Linux" ]]; then
47-
sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" ${{ env.JAVA_HOME }}/conf/security/java.security
48-
else
49-
sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
44+
if [ "$RUNNER_OS" = "Windows" ]; then
45+
sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
46+
elif [ "$RUNNER_OS" = "Linux" ]; then
47+
sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
48+
elif [ "$RUNNER_OS" = "macOS" ]; then
49+
sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
5050
fi
5151
shell: bash
52-
53-
52+
env:
53+
RUNNER_OS: ${{ runner.os }}
54+
JAVA_HOME: ${{ env.JAVA_HOME }}
55+
5456

5557
- name: Copy JRE to static directory
5658
run: |

0 commit comments

Comments
 (0)