thehanimo / pr-title-checker

An action to automatically check if pull request titles conform to Contribution Guidelines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HttpError: Resource not accessible by integration

FogDong opened this issue · comments

If the pull request is coming from a fork, it may trigger the error HttpError: Resource not accessible by integration when attempting to add a label.

May same to the error: actions/labeler#12

commented

Hi @FogDong! That's very interesting. I think the solution involves using pull_request_target instead of pull_request. Might need changes to be made in the action as well. I will take a look at this and post an update here. Thanks!

commented

Found the fix @FogDong! Replacing pull_request with pull_request_target as the event trigger does it. Had to make a minor fix to read issue_number properly. Updated README and released v1.3.2!

Make sure your yaml file looks something like this now:

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.2
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          pass_on_octokit_error: false
          configuration_path: ".github/pr-title-checker-config.json"

pull_request is now pull_request_target and version should be v1.3.2. Hope this helps!

how to check title like :-- i had made changes with JIRA ticket
now i want to match string if JIRA exist in PR Title.
please suggest me regex for that

commented

Assuming you just want to check if JIRA exists anywhere in the PR title, use: "JIRA"