Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit ce88fee

Browse files
author
Bryan Clark
committed
Move to settings-path
1 parent ae11e1a commit ce88fee

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ jobs:
118118

119119
See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file.
120120

121-
## Apache Maven within a Shared Runner
121+
## Apache Maven within a self-hosted runner
122122

123-
When using an Actions shared runner the default `$HOME` directory can be shared by a number of workflows at the same time which could overwrite existing settings file. Setting the `m2-home` variable allows you to choose a unique location for your settings file.
123+
When using an Actions self-hosted runner with multiple shared runners the default `$HOME` directory can be shared by a number runners at the same time which could overwrite existing settings file. Setting the `settings-path` variable allows you to choose a unique location for your settings file.
124124

125125
```yaml
126126
jobs:
@@ -137,11 +137,11 @@ jobs:
137137
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
138138
username: ${{ github.actor }} # username for server authentication
139139
password: ${{ github.token }} # password or token for authentication
140-
m2-home: ${{ $GITHUB_WORKSPACE }} # location for the settings.xml file
140+
settings-path: ./config # location for the settings.xml file
141141
- name: Build with Maven
142142
run: mvn -B package --file pom.xml
143143
- name: Publish to GitHub Packages Apache Maven
144-
run: mvn deploy -s ${{ $GITHUB_WORKSPACE }}/settings.xml
144+
run: mvn deploy -s ./config/settings.xml
145145
```
146146

147147
# License

__tests__/auth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('auth tests', () => {
3535

3636
const altHome = path.join(__dirname, 'runner', 'settings');
3737
const altSettingsFile = path.join(altHome, auth.SETTINGS_FILE);
38-
process.env[`INPUT_M2-HOME`] = altHome;
38+
process.env[`INPUT_SETTINGS-PATH`] = altHome;
3939
await io.rmRF(altHome); // ensure it doesn't already exist
4040

4141
await auth.configAuthentication(id, username, password);
@@ -49,7 +49,7 @@ describe('auth tests', () => {
4949
auth.generate(id, username, password)
5050
);
5151

52-
delete process.env[`INPUT_M2-HOME`];
52+
delete process.env[`INPUT_SETTINGS-PATH`];
5353
await io.rmRF(altHome);
5454
}, 100000);
5555

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ inputs:
3030
description: 'Password or token for authentication to the Apache Maven
3131
repository.'
3232
required: false
33+
settings-path:
34+
description: 'Path to where the settings.xml file will be written.'
35+
required: false
3336
runs:
3437
using: 'node12'
3538
main: 'dist/index.js'

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export async function configAuthentication(
1919
// when an alternate m2 location is specified use only that location (no .m2 directory)
2020
// otherwise use the home/.m2/ path
2121
const directory: string = path.join(
22-
core.getInput('m2-home') || os.homedir(),
23-
core.getInput('m2-home') ? '' : M2_DIR
22+
core.getInput('settings-path') || os.homedir(),
23+
core.getInput('settings-path') ? '' : M2_DIR
2424
);
2525
await io.mkdirP(directory);
2626
core.debug(`created directory ${directory}`);

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