thehanimo / pr-title-checker

An action to automatically check if pull request titles conform to Contribution Guidelines
MIT License
106 stars 36 forks source link

Couldn't retrieve the config file specified - HttpError: Not Found #26

Closed EliasSalom closed 2 years ago

EliasSalom commented 2 years ago

i have been trying to use this tool but I receive this issue all the time this is my JSON file

{
    "LABEL": {
      "name": "title needs formatting",
      "color": "EEEEEE"
    },
    "CHECKS": {
      "prefixes": ["fix: ", "feat: ", "docs: ", "chore: ", "style: ", "refactor: ", "perf: ", "test: ", "revert: "],
      "regexp": "docs\\(v[0-9]\\): ",
      "regexpFlags": "i",
      "ignoreLabels" : ["dont-check-PRs-with-this-label", "meta"]
    },
    "MESSAGES": {
      "success": "All OK",
      "failure": "Please fix the following issues:",
      "notice": ""
    }
  }

and this is my yml file

name: "PR Title Checker"
on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize
      - labeled
      - unlabeled

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: thehanimo/pr-title-checker@v1.3.4
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          pass_on_octokit_error: false
          configuration_path: "./pr-title-checker-config.json"
thehanimo commented 2 years ago

Can you try using the absolute path? Something like .github/pr-title-checker-config.json assuming the json file is stored in the .github folder of your repo.

EliasSalom commented 2 years ago

my root is like that's, .github/workflows/pr-title-checker-config.json

and I have tried like your example and I get the same result

EliasSalom commented 2 years ago

Screen Shot 2022-07-13 at 6 23 13 PM

thehanimo commented 2 years ago

Are you sure you're using configuration_path: ".github/workflows/pr-title-checker-config.json"? Is this a public repository you're working on?

EliasSalom commented 2 years ago

https://github.com/Fullstack-Alfanar/github-action-test/pull/3

please check

thehanimo commented 2 years ago

Thanks, please check your pr-title-checker.yml file. Update it to contain configuration_path: ".github/workflows/pr-title-checker-config.json"

thehanimo commented 2 years ago

Although you have updated it in your non-default branches, the yml file for the workflow is taken from your default branch, which still contains the old configuration path. You'll have to update this field in your default branch.

EliasSalom commented 2 years ago

you check the develop, please check the PR https://github.com/Fullstack-Alfanar/github-action-test/blob/feat/new-feat/.github/workflows/pr-title-checker.yml this one

thehanimo commented 2 years ago

Although you have updated it in your non-default branches, the yml file for the workflow is taken from your default branch, which still contains the old configuration path. You'll have to update this field in your default branch.

Hope this helps :)

EliasSalom commented 2 years ago

yes sir it's work now, please mention this on the README I think there are a lot of developers who will fall in this! and also put they need to put all the following root-like configuration_path: ".github/workflows/pr-title-checker-config.json"

Canato commented 2 years ago

So we need to merge the json file before we can run the CI? So we cannot test before merge the json, correct?

Thanks!

thehanimo commented 2 years ago

That is correct yes.

Also, you might wanna look at #28. Once we get url support, you could always update the file at the given url and not worry about merging branches and stuff.