Skip to content

Commit 883ece4

Browse files
authored
Use git config to set updater info (#438)
1 parent b90f833 commit 883ece4

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.github/workflows/update-packages.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ jobs:
2828
run: python ./.github/workflows/update_packages.py
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
GIT_AUTHOR_NAME: ${{ vars.UPDATER_AUTHOR }}
32-
GIT_AUTHOR_EMAIL: ${{ vars.UPDATER_EMAIL }}
31+
UPDATER_AUTHOR: ${{ vars.UPDATER_AUTHOR }}
32+
UPDATER_EMAIL: ${{ vars.UPDATER_EMAIL }}

.github/workflows/update-version.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ jobs:
3636
env:
3737
RELEASE_TYPE: ${{ inputs.releaseType }}
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
GIT_AUTHOR_NAME: ${{ vars.UPDATER_AUTHOR }}
40-
GIT_AUTHOR_EMAIL: ${{ vars.UPDATER_EMAIL }}
39+
UPDATER_AUTHOR: ${{ vars.UPDATER_AUTHOR }}
40+
UPDATER_EMAIL: ${{ vars.UPDATER_EMAIL }}

.github/workflows/update_packages.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
import os
45
import random
56
import subprocess
67

@@ -26,6 +27,10 @@ def main():
2627
print("No changes detected, exiting")
2728
return
2829

30+
print("Git Config")
31+
subprocess.run(["git", "config", "user.email", os.getenv("UPDATER_AUTHOR")], check=True)
32+
subprocess.run(["git", "config", "user.name", os.getenv("UPDATER_EMAIL")], check=True)
33+
2934
print("Committing changes")
3035
subprocess.run(["git", "add", "--all", "."], check=True)
3136

.github/workflows/update_version.py

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ def main():
5454
print("Running npm install")
5555
subprocess.run(["npm", "install"], check=True, shell=True)
5656

57+
print("Git Config")
58+
subprocess.run(["git", "config", "user.email", os.getenv("UPDATER_AUTHOR")], check=True)
59+
subprocess.run(["git", "config", "user.name", os.getenv("UPDATER_EMAIL")], check=True)
60+
5761
print("Committing changes")
5862
subprocess.run(["git", "add", "package.json"], check=True)
5963
subprocess.run(["git", "add", "package-lock.json"], check=True)

0 commit comments

Comments
 (0)