Skip to content

Commit 91d1667

Browse files
committed
added blurb about private key file and cleanup for hosted runners
1 parent 7f23828 commit 91d1667

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ The two `settings.xml` files created from the above example look like the follow
166166

167167
***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.***
168168

169+
If `gpg-private-key` and `gpg-passphrase` inputs are provided, the private key will be written to a file in the runner's temp directory, the private key file will be imported into the GPG keychain, and then the file will be promptly removed before proceeding with the rest of the setup process. A cleanup step will remove the imported private key from the GPG keychain after the job completes regardless of the job status. This ensures that the private key is no longer accessible on self-hosted runners and cannot "leak" between jobs (hosted runners are always clean instances).
170+
169171
See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file.
170172

171173
## Publishing using Gradle

src/auth.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as path from 'path';
44
import * as core from '@actions/core';
55
import * as io from '@actions/io';
66
import {create as xmlCreate} from 'xmlbuilder2';
7+
import * as constants from './constants';
78

89
export const M2_DIR = '.m2';
910
export const SETTINGS_FILE = 'settings.xml';
@@ -24,8 +25,8 @@ export async function configAuthentication(
2425
// when an alternate m2 location is specified use only that location (no .m2 directory)
2526
// otherwise use the home/.m2/ path
2627
const settingsDirectory: string = path.join(
27-
core.getInput('settings-path') || os.homedir(),
28-
core.getInput('settings-path') ? '' : M2_DIR
28+
core.getInput(constants.INPUT_SETTINGS_PATH) || os.homedir(),
29+
core.getInput(constants.INPUT_SETTINGS_PATH) ? '' : M2_DIR
2930
);
3031
await io.mkdirP(settingsDirectory);
3132
core.debug(`created directory ${settingsDirectory}`);

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const INPUT_JDK_FILE = 'jdkFile';
66
export const INPUT_SERVER_ID = 'server-id';
77
export const INPUT_SERVER_USERNAME = 'server-username';
88
export const INPUT_SERVER_PASSWORD = 'server-password';
9+
export const INPUT_SETTINGS_PATH = 'settings-path';
910
export const INPUT_GPG_PRIVATE_KEY = 'gpg-private-key';
1011
export const INPUT_GPG_PASSPHRASE = 'gpg-passphrase';
1112

0 commit comments

Comments
 (0)