Deployment/zksync factory #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
issues: | |
types: [labeled] | |
issue_comment: | |
types: [created] | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
jobs: | |
autopr: | |
if: ${{ (github.event_name == 'issues' && | |
contains( github.event.label.name, 'AutoPR')) || | |
(github.event_name == 'issue_comment' && | |
github.event.issue.pull_request && | |
contains( github.event.comment.body, 'Hey 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 }} | |
model: gpt-4 | |