Skip to content

Commit

Permalink
Merge pull request #102 from artgenexyz/caffeinum-patch-1
Browse files Browse the repository at this point in the history
Create autopr.yml
  • Loading branch information
caffeinum authored Apr 30, 2023
2 parents 42124a0 + e8d01f0 commit 6aa9a3e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/autopr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
issues:
types: [labeled]

permissions:
contents: write
issues: write
pull-requests: write

jobs:
autopr:
if: ${{ contains( github.event.label.name, 'AutoPR') }}
runs-on: ubuntu-latest
steps:
- name: Install jq
run: sudo apt-get install jq
- name: Check if label was added by a collaborator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
is_collaborator=$(curl -s -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}" | jq -r '.message')
if [ "$is_collaborator" == "Not Found" ]; then
echo "Label not added by a collaborator. Skipping action."
exit 78
fi
- name: Checkout
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 1
- name: AutoPR
uses: docker://ghcr.io/irgolic/autopr:latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6aa9a3e

Please sign in to comment.