You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c904ea4
Browse filesBrowse the repository at this point in the historyBrowse files
-q, --quiet supress log messages less severe than warning, e.g.
79
82
info
80
83
--as-app authenticate as github app instead of as a user.
84
+
--app-id APP_ID github app id or client id; creates and refreshes
85
+
installation tokens (implies --as-app)
86
+
--app-private-key APP_PRIVATE_KEY
87
+
path to the github app private key (.pem), optionally
88
+
as file://...
89
+
--app-installation-id APP_INSTALLATION_ID
90
+
id of the github app installation to back up
91
+
(default: looked up from the user or organization)
81
92
-o, --output-directory OUTPUT_DIRECTORY
82
93
directory at which to backup the repositories
83
94
-l, --log-level LOG_LEVEL
@@ -212,9 +223,19 @@ For a user account (no ``--organization``), ``--as-app`` lists the repositories
212
223
7. Go to *Install App* in your app's settings
213
224
8. Select the account/organization and which repositories to back up
214
225
215
-
**CI/CD usage with GitHub Actions:**
226
+
**Using the app's private key:**
216
227
217
-
Store the App ID as a repository variable and the private key contents as a secret, then use ``actions/create-github-app-token``::
228
+
Pass the App ID and private key file, and github-backup creates installation tokens itself, refreshing them before they expire so long-running backups keep working::
The app's installation on the user or organization being backed up is looked up automatically. To skip the lookup, pass ``--app-installation-id`` with the number at the end of the installation's settings URL (``.../settings/installations/<id>``).
233
+
234
+
``--app-id`` implies ``--as-app`` and cannot be combined with ``-t``, ``-f``, ``--token-from-gh`` or the keychain options. The ``iss`` claim of the signed JWT is set to the value of ``--app-id``, so the app's client ID works there too. The JWT is signed by the ``openssl`` command line tool, which must be on your ``PATH`` (the Docker image includes it).
235
+
236
+
**Using an existing installation token:**
237
+
238
+
If something else already creates the installation token, pass it with ``-t`` and ``--as-app``. In GitHub Actions, store the App ID as a repository variable and the private key contents as a secret, then use ``actions/create-github-app-token``::
218
239
219
240
- uses: actions/create-github-app-token@v1
220
241
id: app-token
@@ -224,7 +245,7 @@ Store the App ID as a repository variable and the private key contents as a secr
Note: Installation tokens expire after 1 hour. For long-running backups, use a fine-grained personal access token instead.
248
+
Note: Installation tokens passed with ``-t`` expire after 1 hour and are not refreshed. For backups that may run longer, use ``--app-private-key`` instead.
0 commit comments