How to add or get the {github.sha} to cucumber url in ruby

Solution for How to add or get the {github.sha} to cucumber url in ruby
is Given Below:

I have the following code:

def index_page

visit 'https://www.company.com/?&ui_version=912c739e8450c9fc0705eeae12715656716f42c3'

end

I need to replace the rest of the path with the {github.sha} that generates github actions in my project where I use cucumber, ruby and site prism.

Example:

def index_page

visit 'https://www.company.com/{github.sha}'

end

Below should work

- name: Replace with GitHub sha
  env:
    GITHUB_SHA: ${{github.sha}}
  run: |
   sed -e 's|https://www.company.com/?&ui_version=912c739e8450c9fc0705eeae12715656716f42c3|https://www.company.com/$GITHUB_SHA|g' index.html