Skip to content

Commit

Permalink
Renames the csproj-path input parameter to project-path
Browse files Browse the repository at this point in the history
  • Loading branch information
ecampidoglio committed Oct 2, 2024
1 parent 252741d commit 86fd49e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
uses: cake-build/cake-action@v2
```
The Cake action will look for a script named `build.cake` in your repository's root directory and run it for you using the [Cake Tool](https://www.nuget.org/packages/Cake.Tool/). If you are using a [Cake Frosting](https://cakebuild.net/docs/running-builds/runners/cake-frosting) project, the `csproj-path` parameter must be specified and the `script-path` is ignored.
The Cake action will look for a script named `build.cake` in your repository's root directory and run it for you using the [Cake Tool](https://www.nuget.org/packages/Cake.Tool/). If you are using a [Cake Frosting](https://cakebuild.net/docs/running-builds/runners/cake-frosting) project, the `project-path` parameter must be specified and the `script-path` is ignored.

All output from the Cake script or Cake Frosting project will be automatically redirected to the build log for inspection.

Expand All @@ -32,16 +32,16 @@ steps:
script-path: path/to/script.cake
```

### `csproj-path`
### `project-path`

If you are using [Cake Frosting](https://cakebuild.net/docs/running-builds/runners/cake-frosting), you can specify the path with the `csproj-path` [input parameter](https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswith):
If you are using [Cake Frosting](https://cakebuild.net/docs/running-builds/runners/cake-frosting), you can specify the path with the `project-path` [input parameter](https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswith):

```yml
steps:
- name: Run Cake Frosting
uses: cake-build/cake-action@v2
with:
csproj-path: path/to/build.csproj
project-path: path/to/build.csproj
```

### `target`
Expand Down
16 changes: 8 additions & 8 deletions __tests__/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('When getting the script-path input argument from the action', () => {

beforeAll(() => {
when(fakeGetInput).calledWith('script-path').mockReturnValue('path/to/script.cake');
when(fakeGetInput).calledWith('csproj-path').mockReturnValue('');
when(fakeGetInput).calledWith('project-path').mockReturnValue('');
when(fakeGetInput).calledWith('cake-version').mockReturnValue('');
when(fakeGetInput).calledWith('cake-bootstrap').mockReturnValue('');
when(fakeGetInput).calledWith('dry-run').mockReturnValue('');
Expand All @@ -26,12 +26,12 @@ describe('When getting the script-path input argument from the action', () => {
});
});

describe('When getting the csproj-path input argument from the action', () => {
describe('When getting the project-path input argument from the action', () => {
const fakeGetInput = core.getInput as jest.MockedFunction<typeof core.getInput>;

beforeAll(() => {
when(fakeGetInput).calledWith('script-path').mockReturnValue('');
when(fakeGetInput).calledWith('csproj-path').mockReturnValue('path/to/build.csproj');
when(fakeGetInput).calledWith('project-path').mockReturnValue('path/to/build.csproj');
when(fakeGetInput).calledWith('cake-version').mockReturnValue('');
when(fakeGetInput).calledWith('cake-bootstrap').mockReturnValue('');
when(fakeGetInput).calledWith('dry-run').mockReturnValue('');
Expand All @@ -42,17 +42,17 @@ describe('When getting the csproj-path input argument from the action', () => {
expect(action.getInputs().buildFile.type).toBe('project');
});

test('it should return the argument for the csproj-path parameter as the build file path parameter', () => {
test('it should return the argument for the project-path parameter as the build file path parameter', () => {
expect(action.getInputs().buildFile.path).toBe('path/to/build.csproj');
});
});

describe('When getting both the script-path and csproj-path input arguments from the action', () => {
describe('When getting both the script-path and project-path input arguments from the action', () => {
const fakeGetInput = core.getInput as jest.MockedFunction<typeof core.getInput>;

beforeAll(() => {
when(fakeGetInput).calledWith('script-path').mockReturnValue('path/to/build.cake');
when(fakeGetInput).calledWith('csproj-path').mockReturnValue('path/to/build.csproj');
when(fakeGetInput).calledWith('project-path').mockReturnValue('path/to/build.csproj');
when(fakeGetInput).calledWith('cake-version').mockReturnValue('');
when(fakeGetInput).calledWith('cake-bootstrap').mockReturnValue('');
when(fakeGetInput).calledWith('dry-run').mockReturnValue('');
Expand All @@ -63,7 +63,7 @@ describe('When getting both the script-path and csproj-path input arguments from
expect(action.getInputs().buildFile.type).toBe('project');
});

test('it should return the argument for the csproj-path parameter as the build file path parameter', () => {
test('it should return the argument for the project-path parameter as the build file path parameter', () => {
expect(action.getInputs().buildFile.path).toBe('path/to/build.csproj');
});
});
Expand Down Expand Up @@ -221,7 +221,7 @@ describe('When getting no input arguments from the action', () => {

beforeAll(() => {
when(fakeGetInput).calledWith('script-path').mockReturnValue('');
when(fakeGetInput).calledWith('csproj-path').mockReturnValue('');
when(fakeGetInput).calledWith('project-path').mockReturnValue('');
when(fakeGetInput).calledWith('cake-version').mockReturnValue('');
when(fakeGetInput).calledWith('cake-bootstrap').mockReturnValue('');
when(fakeGetInput).calledWith('target').mockReturnValue('');
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
description: 'The path of the Cake script to run.'
required: false
default: 'build.cake'
csproj-path:
project-path:
description: 'The path of the Cake Frosting Project to run. Takes precedence over script-path'
required: false
target:
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3999,7 +3999,7 @@ function getInputs() {
exports.getInputs = getInputs;
function getFileInput() {
const scriptPath = core.getInput('script-path');
const projectPath = core.getInput('csproj-path');
const projectPath = core.getInput('project-path');
// When both script and project paths are specified,
// the project path takes precedence.
// If neither is provided, the default 'build.cake' script
Expand Down
2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function getInputs(): CakeInputs & BuildInputs {

function getFileInput(): BuildFile {
const scriptPath = core.getInput('script-path');
const projectPath = core.getInput('csproj-path');
const projectPath = core.getInput('project-path');

// When both script and project paths are specified,
// the project path takes precedence.
Expand Down

0 comments on commit 86fd49e

Please sign in to comment.