Skip to content

Commit

Permalink
move contact email to action variables
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenIceage committed Nov 25, 2024
1 parent c10d5d1 commit d96adca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python auto_release_obs.py --username '${{ secrets.OSC_USER }}' --password '${{ secrets.OSC_PASS }}'
python auto_release_obs.py --username '${{ secrets.OSC_USER }}' --password '${{ secrets.OSC_PASS }}' --contact '${{ secrets.OSC_EMAIL }}'
8 changes: 6 additions & 2 deletions auto_release_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self, **kwargs):
Initialize the obs instance
"""
self.username = kwargs.get("username", "")
self.contact = kwargs.get("contact", "")
self.osc = Osc(
url="https://api.opensuse.org",
username=self.username,
Expand Down Expand Up @@ -79,7 +80,7 @@ def modify_changes_file(self) -> None:
lines = [f" {line}" for line in self.release_body.strip().split("\r\n") if line]
content = f"- Release {self.release_name}\n" + "\n".join(lines)
entry = Entry(
packager=f"{self.username} <[email protected]>",
packager=f"{self.username} <{self.contact}>",
content=content,
timestamp=datetime.now(tz=_UTC())
)
Expand Down Expand Up @@ -128,6 +129,9 @@ def __call__(self) -> None:
parser = argparse.ArgumentParser(description='Auto release package to OBS.')
parser.add_argument('--username', required=True, help='Username for login')
parser.add_argument('--password', required=True, help='Password for login')
parser.add_argument('--contact', required=True, help='Email address of user')
args = parser.parse_args()
obs = Obs(username=args.username, password=args.password)
obs = Obs(username=args.username,
password=args.password,
contact=args.contact)
obs()

0 comments on commit d96adca

Please sign in to comment.