{"id":16365862,"url":"https://github.com/harshcasper/validate-issues-over-pull-requests","last_synced_at":"2025-03-23T02:32:18.184Z","repository":{"id":106117372,"uuid":"491582738","full_name":"HarshCasper/validate-issues-over-pull-requests","owner":"HarshCasper","description":"GitHub Action to validate submitted Pull Requests to check if they contain a valid Issue 👀","archived":false,"fork":false,"pushed_at":"2023-01-12T06:29:05.000Z","size":11,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T16:52:22.123Z","etag":null,"topics":["community-management","github-actions","issue-management","open-source-management","pull-request-management"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/validate-issues-over-pull-requests","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HarshCasper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-12T16:06:52.000Z","updated_at":"2025-01-23T23:27:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc51a919-2b44-4a22-a677-28e0839943e2","html_url":"https://github.com/HarshCasper/validate-issues-over-pull-requests","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fvalidate-issues-over-pull-requests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fvalidate-issues-over-pull-requests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fvalidate-issues-over-pull-requests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshCasper%2Fvalidate-issues-over-pull-requests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarshCasper","download_url":"https://codeload.github.com/HarshCasper/validate-issues-over-pull-requests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245047979,"owners_count":20552430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["community-management","github-actions","issue-management","open-source-management","pull-request-management"],"created_at":"2024-10-11T02:44:42.960Z","updated_at":"2025-03-23T02:32:18.174Z","avatar_url":"https://github.com/HarshCasper.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Validate Issues over Pull Requests\n\n[![Action Template](https://img.shields.io/badge/Action%20Template-Python%20Container%20Action-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/HarshCasper/validate-issues-over-pull-requests)\n[![Lint](https://github.com/HarshCasper/validate-issues-over-pull-requests/actions/workflows/ci.yml/badge.svg)](https://github.com/HarshCasper/validate-issues-over-pull-requests/actions/workflows/ci.yml)\n\nA GitHub Action to validate submitted Pull Requests to check if they have a valid Issue present in the body. The contributors are usually expected to link Issues to Pull Requests using key phrases like `Fixes #XYZ` or `Resolves #XYZ`. This Action validates if an Issue is present over the Pull Request body and lets the maintainer take further prompt over specific Pull Requests!\n\n## Usage\n\nTo get started, you can use this minimal example:\n\n```yml\nname: Check if a PR has a valid Issue\n\non:\n  pull_request_target:\n    types: [ edited, synchronize, opened, reopened ]\n\njobs:\n  checker:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      \n      - name: Issue Validator\n        uses: HarshCasper/validate-issues-over-pull-requests@v0.1.1\n        id: validator\n        with:\n          prbody: ${{ github.event.pull_request.body }}\n          prurl: ${{ github.event.pull_request.url }}\n```\n\n### Inputs\n\n|Input|Description  |Example\n|--|--|--|\n|prbody  |The Pull Request body to be analyzed  | `${{ github.event.pull_request.body }}`\n|prurl  |The Pull Request URL to be analyzed  | `${{ github.event.pull_request.body }}`\n\n### Output\n\n|Output|Description  |\n|--|--|\n|valid  |Boolean that denotes if a Pull Request body has a valid Issue (`1` if its present and `0` if its not)  |\n\n### Example Workflow\n\nAs a maintainer, if you wish to take an opinionated way of tagging/labeling Pull Requests which contain (or may not contain) a valid Issue, here is an example:\n\n```yml\nname: PR has a valid Issue?\n\non:\n  pull_request_target:\n    types: [ edited, synchronize, opened, reopened ]\n\njobs:\n  checker:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      \n      - name: Issue Validator\n        uses: HarshCasper/validate-issues-over-pull-requests@v0.1.1\n        id: validator\n        with:\n          prbody: ${{ github.event.pull_request.body }}\n          prurl: ${{ github.event.pull_request.url }}\n          \n      - name: PR has a valid Issue\n        if: ${{ steps.validator.outputs.valid == 1 }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          PRNUM: ${{ github.event.pull_request.number }}\n        run: |\n          gh pr edit $PRNUM --add-label \"PR:Ready-to-Review\"\n          gh pr edit $PRNUM --remove-label \"PR:No-Issue\"\n          \n      - name: PR has no valid Issue\n        if: ${{ steps.validator.outputs.valid == 0 }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          PRNUM: ${{ github.event.pull_request.number }}\n        run: |\n          gh pr comment $PRNUM --body \"PR is not linked to any issue, please make the corresponding changes in the body.\"\n          gh pr edit $PRNUM --add-label \"PR:No-Issue\"\n ```\n \nHowever you can mould the above logic and use the [GitHub's CLI](https://cli.github.com/) `gh` to develop your own preferred workflow.\n\n## Acknowledgments\n\nThe Action is based on the awesome work done by  [XZANATOL](https://github.com/XZANATOL) for [Rotten Scripts](https://github.com/HarshCasper/Rotten-Scripts). We have been using this Action for some time now to mark Pull Requests that are not linked to any Issue. Based on a [Stack Overflow question](https://stackoverflow.com/questions/72009749/how-to-trigger-github-workflows-on-link-issue-to-pr), I decided to publish this Action for a more general use case and further maintain it.\n\n## License\n\n[MIT License](https://github.com/HarshCasper/validate-issues-over-pull-requests/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshcasper%2Fvalidate-issues-over-pull-requests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshcasper%2Fvalidate-issues-over-pull-requests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshcasper%2Fvalidate-issues-over-pull-requests/lists"}