Skip to content

Commit

Permalink
Use python to replace
Browse files Browse the repository at this point in the history
  • Loading branch information
nvdaes committed Dec 28, 2020
1 parent 9eca39a commit 3bc478c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/upload-on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,11 @@ jobs:
run: git checkout -b ${{ steps.get_branch.outputs.result }}
- name: Create add-on url
run: |
"((Get-Content get.php -Raw) -Replace '"rf".*,', '"rf" >= "${{ buildAndUpload.upload.browser_download_url }}",') | Set-Content -path get.php"
import re
with open("get.php", 'r+', encoding='utf-8') as f:
text = f.read()
text = re.sub("\"rf\".*?,", "\"rf\" >= \"${{ buildAndUpload.upload.browser_download_url: }}\",", text)
f.seek(0)
f.write(text)
f.truncate()
shell: python

0 comments on commit 3bc478c

Please sign in to comment.