├── README.md └── .github └── workflows └── autopr.yml /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # 🚀 AutoPR Template 🚀 4 | 5 | [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label&color=purple)](https://discord.gg/ykk7Znt3K6) 6 | 7 | [AutoPR](https://github.com/irgolic/AutoPR) automatically writes pull requests in response to issues with ChatGPT. 8 | 9 |
10 | 11 | # 🛠 Usage 12 | 13 | Please see [USAGE.md](https://github.com/irgolic/AutoPR/blob/main/USAGE.md) for more information. 14 | 15 | If you'd like to try out GPT-4 AutoPR, you can make an issue in this repository, and I'll run it manually. 16 | -------------------------------------------------------------------------------- /.github/workflows/autopr.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issues: 3 | types: [labeled] 4 | 5 | permissions: 6 | contents: write 7 | issues: write 8 | pull-requests: write 9 | 10 | jobs: 11 | autopr: 12 | if: ${{ contains( github.event.label.name, 'AutoPR') }} 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Install jq 16 | run: sudo apt-get install jq 17 | - name: Check if label was added by a collaborator 18 | env: 19 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 | run: | 21 | is_collaborator=$(curl -s -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" \ 22 | "https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}" | jq -r '.message') 23 | if [ "$is_collaborator" == "Not Found" ]; then 24 | echo "Label not added by a collaborator. Skipping action." 25 | exit 78 26 | fi 27 | - name: Checkout 28 | uses: actions/checkout@v2 29 | with: 30 | ref: main 31 | fetch-depth: 1 32 | - name: AutoPR 33 | uses: docker://ghcr.io/irgolic/autopr:latest 34 | env: 35 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} 36 | with: 37 | github_token: ${{ secrets.GITHUB_TOKEN }} 38 | --------------------------------------------------------------------------------