Improve helper example section with env var usage#1580
Closed
glennie wants to merge 1 commit intopython-gitlab:mainfrom
Closed
Improve helper example section with env var usage#1580glennie wants to merge 1 commit intopython-gitlab:mainfrom
glennie wants to merge 1 commit intopython-gitlab:mainfrom
Conversation
a8e7060 to
b9722c8
Compare
Added an example for using envrionement variable for tokens.
nejch
reviewed
Sep 11, 2021
Comment on lines
+185
to
+191
| private_token = helper: printf -- '%%s' ${GITLAB_TOKEN} | ||
| timeout = 1 | ||
|
|
||
| **Notice:** | ||
|
|
||
| * ``printf`` is the executable provided by coreutils package (on a debian based distribution). | ||
| * ``%`` must be escaped using an other `%` (in order to allow `configparser` load configuration properly. |
Member
There was a problem hiding this comment.
Thank you for this contribution @glennie! Initially I wanted to say this would probably be superseded by #1296, but I like your idea because you can define multiple env vars (e.g. one per gitlab id entry).
Just one question: Wouldn't simply using echo -n ${VARIABLE} achieve the same? Have you tried this? -n should strip the newline.
|
This Pull Request (PR) was marked stale because it has been open 90 days with no activity. Please remove the stale label or comment on this PR. Otherwise, it will be closed in 15 days. |
|
This PR was closed because it has been marked stale for 15 days with no activity. If this PR is still valid, please re-open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
I wanted to use an env var for the token.
I spend some time to figure out that I needed to escape '%' because of configparser.
Therefore, I made this PR to improve the current documentation hoping others will spend much less time than me.
Kind regards,