Skip to content

Commit 87b2683

Browse files
committed
docs(readme): document how a Base64 private key could be decoded
1 parent d0ac2ad commit 87b2683

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,24 @@ jobs:
278278

279279
**Required:** GitHub App private key. Escaped newlines (`\\n`) will be automatically replaced with actual newlines.
280280

281+
N.B.: Some other action may require the private key to be Base64 encoded. To avoid recreating a new secret, it can be decoded on the fly, but it needs to be managed securely. Here is an example of how this could be achieved:
282+
283+
```yaml
284+
steps:
285+
- name: Decode the GitHub App Private Key
286+
id: decode
287+
run: |
288+
private_key=$(echo "${{ secrets.PRIVATE_KEY }}" | base64 -d | awk 'BEGIN {ORS="\\n"} {print}' | head -c -2) &> /dev/null
289+
echo "::add-mask::$private_key"
290+
echo "private-key=$private_key" >> "$GITHUB_OUTPUT"
291+
- name: Generate GitHub App Token
292+
id: app-token
293+
uses: actions/create-github-app-token@v1
294+
with:
295+
app-id: ${{ vars.APP_ID }}
296+
private-key: ${{ steps.decoding.outputs.private-key }}
297+
```
298+
281299
### `owner`
282300

283301
**Optional:** The owner of the GitHub App installation. If empty, defaults to the current repository owner.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy