Skip to content

Commit

Permalink
Fix writing settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jun 27, 2024
1 parent d93f5b8 commit e0867ae
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 68 deletions.
41 changes: 0 additions & 41 deletions .devcontainer/devcontainer.json

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,3 @@ jobs:
- name: Lint
id: npm-lint
run: npm run lint

- name: Test
id: npm-ci-test
run: npm run ci-test

test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Test Local Action
id: test-action
uses: ./
with:
milliseconds: 2000

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ inputs:
remote-repository-password:
description: 'Password for the remote repository'
required: false
temp-dir:
description: 'The temp directory to use'
required: true
default: '${{ runner.temp }}'

runs:
using: node20
Expand Down
17 changes: 16 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
},
"scripts": {
"bundle": "npm run format:write && npm run package",
"coverage": "npx make-coverage-badge --output-path ./badges/coverage.svg",
"format:write": "npx prettier --write .",
"format:check": "npx prettier --check .",
"lint": "npx eslint . -c ./.github/linters/.eslintrc.yml",
Expand Down
21 changes: 20 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ async function main() {
}

const mavenSettings = path.join(tempDir, 'maven-settings.xml')
fs.writeFileSync(
mavenSettings,
`
<settings>
<servers>
<server>
<id>remote-repository</id>
<username>\${env.REMOTE_REPO_USERNAME}</username>
<password>\${env.REMOTE_REPO_PASSWORD}</password>
</server>
</servers>
</settings>
`,
{ encoding: 'utf8' }
)

// Build the maven commandline
let cmd = [
Expand Down Expand Up @@ -100,7 +115,11 @@ async function main() {
}

await exec.exec('mvn', cmd, {
cwd: folder
cwd: folder,
env: {
REMOTE_REPO_USERNAME: remoteUsername,
REMOTE_REPO_PASSWORD: remotePassword
}
})
}
} catch (error) {
Expand Down

0 comments on commit e0867ae

Please sign in to comment.