Yet another bot fix (#1099)

This commit is contained in:
Yakko Majuri
2021-03-17 13:22:09 +00:00
committed by GitHub
parent f79feb18e3
commit eb7346c6a5
3 changed files with 5 additions and 2 deletions

View File

@@ -32,8 +32,9 @@ jobs:
- name: Add safe redirects
run: |
export PR_DIFF=$(git diff ${{ github.base_ref }} ${{ github.head_ref }})
git diff ${{ github.base_ref }} ${{ github.head_ref }} > pr_diff
python3 ./scripts/safe_rename.py
rm pr_diff
git add .
[ "$(git status -s)" = "" ] && exit 0 || git commit -m "Add safe redirects"

1
.gitignore vendored
View File

@@ -11,4 +11,5 @@ yarn-error.log
.idea
package-lock.json
pr_diff

View File

@@ -1,7 +1,8 @@
import re
import os
git_diff = os.environ['PR_DIFF']
with open("./pr_diff", "r") as git_diff_file:
git_diff = git_diff_file.read()
rename_from_regex = r'rename from contents(.*).md'
rename_to_regex = r'rename to contents(.*).md'