Skip to content

Commit

Permalink
add credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Oct 2, 2024
1 parent 25b9f5d commit badefc6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./ # buildalon/setup-plastic-scm@v1
with:
unity-username: ${{ secrets.UNITY_USERNAME }}
unity-password: ${{ secrets.UNITY_PASSWORD }}
- run: |
cm version
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ A GitHub action to setup and install [Plastic SCM](https://www.plasticscm.com) (
```yaml
steps:
- uses: buildalon/setup-plastic-scm@v1
with:
unity-username: ${{ secrets.UNITY_USERNAME }}
unity-password: ${{ secrets.UNITY_PASSWORD }}
- run: |
cm version
```
Expand All @@ -19,4 +22,6 @@ steps:
| name | description | required |
| ---- | ----------- | -------- |
| version | The specific version to install | defaults to the latest |
| `version` | The specific version to install. | defaults to the latest |
| `unity-username` | The email address associated with your Unity account. | true |
| `unity-password` | The password associated with your Unity account. | true |
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ branding:
color: 'red'
inputs:
version:
description: 'The version of Plastic SCM to install'
description: 'The version of Plastic SCM to install.'
required: false
unity-username:
description: 'The email address associated with your Unity account.'
required: true
unity-password:
description: 'The password associated with your Unity account.'
required: true
runs:
using: 'node20'
main: 'dist/index.js'
12 changes: 11 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ async function run(): Promise<void> {
core.error(`Failed to call cm command!\n${error}`);
}
}
await authenticate();
}

function getTempDirectory(): string {
return process.env['RUNNER_TEMP'] || '';
}

async function install() {
const version = core.getInput('version');
let version = core.getInput('version');
if (version === 'latest') {
version = undefined;
}
switch (process.platform) {
case 'win32': return await installWindows(version);
case 'darwin': return await installMac(version);
Expand Down Expand Up @@ -106,3 +110,9 @@ async function installLinux(version: string) {
await exec.exec('sudo', ['apt-get', 'update']);
await exec.exec('sudo', ['apt-get', 'install', installArg]);
}

async function authenticate() {
const username = core.getInput('unity-username', { required: true });
const password = core.getInput('unity-password', { required: true });

}

0 comments on commit badefc6

Please sign in to comment.