Skip to content

Commit aaa1f12

Browse files
committed
Update actions config
1 parent f36e7d1 commit aaa1f12

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

.github/workflows/updateDB.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ jobs:
2020
with:
2121
app-id: ${{ vars.APP_HELPER_ID }}
2222
private-key: ${{ secrets.PRIVATE_APP_HELPER_KEY }}
23+
owner: ${{ github.repository_owner }}
24+
repositories: "PCCassets,PolishCookieConsent"
2325
- env:
2426
GIT_TOKEN: ${{ steps.app-token.outputs.token }}
2527
run: |
2628
git config --global --add safe.directory "$GITHUB_WORKSPACE"
27-
./scripts/build.py
29+
python3 ./scripts/build.py

scripts/build.py

+4-16
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,13 @@
6464
os.remove(pn(os.getcwd()+"/PolishCookieConsent/src/cookieBase/PCB.txt"))
6565
shutil.copy(pn(os.getcwd()+"/PCCassets/plCDB.txt"), pn(os.getcwd()+"/PolishCookieConsent/src/cookieBase/PCB.txt"))
6666

67+
print(f"Entering directory: {pn(os.getcwd()+"/PolishCookieConsent")}")
6768
os.chdir(pn(os.getcwd()+"/PolishCookieConsent"))
6869

69-
git_repo = git.Repo(pn(os.getcwd()), search_parent_directories=True)
70-
71-
class conf():
72-
def __init__(self):
73-
if os.path.isfile(config_path):
74-
with open(config_path, "r", encoding="utf8") as cf:
75-
for lineConf in cf:
76-
cfProperty = lineConf.strip().split()[
77-
0].replace("@", "")
78-
if matchC := re.search(r'@'+cfProperty+' (.*)$', lineConf):
79-
self[cfProperty] = matchC.group(1)
80-
def __setitem__(self, key, value):
81-
setattr(self, key, value)
82-
def __getitem__(self, key):
83-
return getattr(self, key)
70+
git_repo = git.Repo(os.getcwd())
8471

85-
if "CI" in os.environ:
72+
if "CI" in os.environ and "git_repo" in locals():
73+
conf = SFLB.getValuesFromConf([config_path])
8674
with git_repo.config_writer() as cw:
8775
if hasattr(conf(), 'CIusername'):
8876
cw.set_value("user", "name", conf().CIusername).release()

0 commit comments

Comments
 (0)