diff --git a/.github/workflows/get-environment.yml b/.github/workflows/get-environment.yml
index 186559b798..11fdecea15 100644
--- a/.github/workflows/get-environment.yml
+++ b/.github/workflows/get-environment.yml
@@ -250,7 +250,7 @@ jobs:
with:
script: |
let version = '';
- if ('${{ inputs.version_file }}'.match('/\pom\.xml$/')) {
+ if ('${{ inputs.version_file }}'.endsWith('pom.xml')) {
version = execSync(`grep -m 1 ".*" ${{ inputs.version_file }} | sed 's/.*\\(.*\\)<\\/version>.*/\\1/'`).toString().trim();
} else if ('${{ steps.get_stability.outputs.stability }}' === 'testing') {
const branchName = "${{ github.head_ref || github.ref_name }}";