Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ jobs:

## Inputs

| Name | Description | Required | default |
| -------------- | ----------------------------------------------------------------- | -------- | ------- |
| token | Token used for pushing fixes and commenting on PRs. | true | |
| run-tests | Whether tests should be run. | false | true |
| run-analysis | Whether static analysis should be run. | false | true |
| run-coverage | Whether code coverage should be run. | false | true |
| run-behind-by | Whether action should check if HEAD branch is behind base branch. | false | true |
| create-comment | Whether the action should comment the output status. | false | true |
| Name | Description | Required | Default |
| ----------------- | ----------------------------------------------------------------- | -------- | ------- |
| token | Token used for pushing fixes and commenting on PRs. | true | |
| run-tests | Whether tests should be run. | false | true |
| run-analysis | Whether static analysis should be run. | false | true |
| run-coverage | Whether code coverage should be run. | false | true |
| run-behind-by | Whether action should check if HEAD branch is behind base branch. | false | true |
| create-comment | Whether the action should comment the output status. | false | true |
| working-directory | Working directory to run the action in | false | "." |

## Contributing

Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ inputs:
description: "Token used for pushing fixes and commenting on PRs"
required: true

working-directory:
description: "The working directory"
required: false
default: "."

run-tests:
description: "Run tests"
required: false
Expand Down
5 changes: 5 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33152,6 +33152,11 @@ const behind_1 = __nccwpck_require__(8890);
const push_1 = __nccwpck_require__(3662);
const run = async () => {
try {
const workingDirectory = (0, core_1.getInput)('working-directory');
// Check if the working directory is different from the current directory
if (workingDirectory && workingDirectory !== process.cwd()) {
process.chdir(workingDirectory);
}
const token = process.env.GITHUB_TOKEN || (0, core_1.getInput)("token");
const runTests = (0, core_1.getBooleanInput)("run-tests");
const runAnalyze = (0, core_1.getBooleanInput)("run-analyze");
Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export type stepResponse = { output: string; error: boolean };

const run = async () => {
try {
const workingDirectory = getInput('working-directory');
// Check if the working directory is different from the current directory
if (workingDirectory && workingDirectory !== process.cwd()) {
process.chdir(workingDirectory);
}

const token = process.env.GITHUB_TOKEN || getInput("token");
const runTests = getBooleanInput("run-tests");
const runAnalyze = getBooleanInput("run-analyze");
Expand Down
16 changes: 16 additions & 0 deletions tests/pass_repo/coverage/lcov.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SF:lib/main.dart
DA:3,0
DA:8,2
DA:10,1
DA:17,1
DA:21,1
DA:22,1
DA:28,0
DA:30,1
DA:32,1
DA:33,4
DA:34,1
DA:35,1
LF:12
LH:10
end_of_record