Skip to content

Commit 2f6e499

Browse files
committed
branch2obs.sh doc: automate GH_USER and OBS_USER
1 parent 0a31ce4 commit 2f6e499

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

devel/README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ development project.
2121
### Used tools
2222

2323
The script requires the `git`, `gh`, `jq` and `osc` command line tools to be installed. The `osc`
24-
and `gh` tools need to be configured/authenticated against OBS respective GitHub. Do not worry the
24+
and `gh` tools need to be configured/authenticated against OBS and GitHub, respectively. Do not worry the
2525
script checks for that.
2626

27+
Use the following commands if you don't want to remember your usernames:
28+
29+
GH_USER=$(gh auth status | sed -n 's/.*Logged in to github.com account \([^[:space:]]*\) .*/\1/;T;p;q')
30+
OBS_USER=$(osc user | sed "s/^\([^:]*\):.*$/\\1/")
31+
2732
### GitHub configuration
2833

2934
If you run the script in your GitHub fork then you need to configure the OBS credentials. When
@@ -33,29 +38,29 @@ to change anything.
3338
You need to create the `OBS_USER` action variable containing your OBS login name. You can do that
3439
from command line running command
3540

36-
gh -R <gh_user>/agama variable set OBS_USER --body <obs_user>
41+
gh -R ${GH_USER?}/agama variable set OBS_USER --body ${OBS_USER?}
3742

38-
where `gh_user` is your GitHub login name and `obs_user` your OBS login name.
43+
where `$GH_USER` is your GitHub login name and `$OBS_USER` your OBS login name.
3944

4045
Alternatively you can create the variable manually by visiting URL
4146

42-
https://github.com/<gh_user>/agama/settings/variables/actions/new
47+
xdg-open https://github.com/${GH_USER?}/agama/settings/variables/actions/new
4348

44-
where `gh_user` is your GitHub login name. On that page create variable `OBS_USER` with your OBS
49+
where `$GH_USER` is your GitHub login name. On that page create variable `OBS_USER` with your OBS
4550
login name.
4651

4752
Similarly we need to enter the OBS password, but as this is sensitive private value we use GitHub
4853
secret for that. From command line run this command
4954

50-
gh -R <gh_user>/agama secret set OBS_PASSWORD
55+
gh -R ${GH_USER?}/agama secret set OBS_PASSWORD
5156

52-
where `gh_user` is your GitHub login name. The command will interactively ask for the password.
57+
where `$GH_USER` is your GitHub login name. The command will interactively ask for the password.
5358

5459
Or you can create the secret in browser going to this page
5560

56-
https://github.com/<gh_user>/agama/settings/secrets/actions/new`
61+
xdg-open https://github.com/${GH_USER?}/agama/settings/secrets/actions/new`
5762

58-
where `gh_user` is your GitHub login name. Create a new secret with name `OBS_PASSWORD` and
63+
where `$GH_USER` is your GitHub login name. Create a new secret with name `OBS_PASSWORD` and
5964
enter your OBS password as the value.
6065

6166
### Testing builds
@@ -83,7 +88,7 @@ project for submitting.
8388
- `git checkout master`
8489
- Update the ISO version in `live/src/agama-installer.kiwi`, use the `pre` suffix to distinguish
8590
between a development version and the final version. I.e. for Beta3 change the version from `12`
86-
to `13pre`.
91+
to `13.pre`.
8792
- Push the changes
8893
- `git commit -a`
8994
- `git push`

0 commit comments

Comments
 (0)