diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f88352..36cbb92 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: Test the Action on: push: branches: ["main"] + pull_request: + branches: ["main"] jobs: test-rsmetacheck: @@ -16,7 +18,7 @@ jobs: # defined in the root of the CURRENT repository. uses: ./ with: - input: "https://github.com/${{ github.repository }}" + # test with default input (current repository) verbose: "true" - name: Verify outputs generated diff --git a/README.md b/README.md index 6c02498..7d9f9b3 100644 --- a/README.md +++ b/README.md @@ -21,14 +21,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Run RsMetaCheck - uses: your-github-username/rsmetacheck-action@v1 + uses: SoftwareUnderstanding/rs-metacheck-action@0.3.1 + # optional arguments with: - # You can pass the repository URL automatically - input: "https://github.com/${{ github.repository }}" - pitfalls_output: "./pitfalls_outputs" + input: https://github.com/$GITHUB_REPOSITORY # if input is omited it will use GITHUB_REPOSITORY url + pitfalls_output: "./pitfalls_outputs" verbose: "false" ``` @@ -45,6 +45,7 @@ jobs: | `branch` | Branch of the repository to analyze. | No | | | `generate_codemeta` | Generate codemeta files for each repository. | No | `false` | | `verbose` | Include both detected AND undetected pitfalls in the output JSON-LD. | No | `false` | +| `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` | ### Outputs diff --git a/action.yml b/action.yml index 8368e23..a7aa167 100644 --- a/action.yml +++ b/action.yml @@ -8,7 +8,8 @@ branding: inputs: input: description: 'One or more: GitHub/GitLab URLs, JSON files containing repositories. (e.g. "https://github.com/owner/repo")' - required: true + required: false + default: "https://github.com/${GITHUB_REPOSITORY}" skip_somef: description: "Skip SoMEF execution and analyze existing SoMEF output files directly." required: false diff --git a/entrypoint.sh b/entrypoint.sh index 7ba7f32..fdcf3b6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,8 +9,13 @@ if [ -n "$INPUT_INPUT" ]; then # Note: Do not quote $INPUT_INPUT here in case multiple URLs are passed as spaces CMD="$CMD --input $INPUT_INPUT" else - echo "Error: The 'input' argument is required." - exit 1 + # use the repository URL as the default input if not provided + if [ -n "$GITHUB_REPOSITORY" ]; then + CMD="$CMD --input https://github.com/$GITHUB_REPOSITORY" + else # if github repository url is not existing then return error + echo "Error: The 'input' argument is required." + exit 1 + fi fi # Handle boolean flags