Skip to content

Commit 74df956

Browse files
committed
change input not required to use the actual repository as input. input can still be overriden.
1 parent ec9e4ba commit 74df956

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# defined in the root of the CURRENT repository.
1717
uses: ./
1818
with:
19-
input: "https://github.com/${{ github.repository }}"
19+
# test with default input (current repository)
2020
verbose: "true"
2121

2222
- name: Verify outputs generated

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525

2626
- name: Run RsMetaCheck
2727
uses: SoftwareUnderstanding/rs-metacheck-action@0.3.1
28+
# optional arguments
2829
with:
29-
# You can pass the repository URL automatically
30-
input: "https://github.com/${{ github.repository }}"
31-
pitfalls_output: "./pitfalls_outputs"
30+
input: https://github.com/$GITHUB_REPOSITORY # if input is omited it will use GITHUB_REPOSITORY url
31+
pitfalls_output: "./pitfalls_outputs"
3232
verbose: "false"
3333
```
3434
@@ -45,6 +45,7 @@ jobs:
4545
| `branch` | Branch of the repository to analyze. | No | |
4646
| `generate_codemeta` | Generate codemeta files for each repository. | No | `false` |
4747
| `verbose` | Include both detected AND undetected pitfalls in the output JSON-LD. | No | `false` |
48+
| `config` | Specify the location of the `rsmetacheck.toml` to define the configuration. RSMetaCheck automatically detects a .rsmetacheck.toml (or rsmetacheck.toml) file at the working directory. | No | `rsmetacheck.toml` |
4849

4950
### Outputs
5051

action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ branding:
88
inputs:
99
input:
1010
description: 'One or more: GitHub/GitLab URLs, JSON files containing repositories. (e.g. "https://github.com/owner/repo")'
11-
required: true
11+
required: false
12+
default: "https://github.com/${GITHUB_REPOSITORY}"
1213
skip_somef:
1314
description: "Skip SoMEF execution and analyze existing SoMEF output files directly."
1415
required: false

entrypoint.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ if [ -n "$INPUT_INPUT" ]; then
99
# Note: Do not quote $INPUT_INPUT here in case multiple URLs are passed as spaces
1010
CMD="$CMD --input $INPUT_INPUT"
1111
else
12-
echo "Error: The 'input' argument is required."
13-
exit 1
12+
# use the repository URL as the default input if not provided
13+
if [ -n "$GITHUB_REPOSITORY" ]; then
14+
CMD="$CMD --input https://github.com/$GITHUB_REPOSITORY"
15+
else # if github repository url is not existing then return error
16+
echo "Error: The 'input' argument is required."
17+
exit 1
18+
fi
1419
fi
1520

1621
# Handle boolean flags

0 commit comments

Comments
 (0)