Skip to content

Generate files for project setup #26

Generate files for project setup

Generate files for project setup #26

Workflow file for this run

name: Autocoder Workflow
on:
issues:
types: [opened, reopened, labeled]
permissions:
contents: write
pull-requests: write
jobs:
process_issue:
if: contains(github.event.issue.labels.*.name, 'autocoder-bot')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure git settings
run: |
git config user.name "autocoder-bot"
git config user.email "[email protected]"
- name: Debug File Location
run: ls -l ./scripts
- name: Make script executable
run: chmod +x ./scripts/script.sh
- name: Run the autocoder script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
./scripts/script.sh $GITHUB_TOKEN $REPOSITORY $ISSUE_NUMBER $OPENAI_API_KEY
- name: Debug Generated Files
run: ls -R autocoder-bot/
- name: Add generated files to commit
run: |
BRANCH_NAME="autocoder-branch-${{ github.event.issue.number }}"
git checkout -b "$BRANCH_NAME"
git add -A
git commit -m "Generated code for issue #${{ github.event.issue.number }}"
git push origin "$BRANCH_NAME"
- name: Debug Git Status
run: git status
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: autocoder-branch-${{ github.event.issue.number }}
base: main
title: "Generated code for issue #${{ github.event.issue.number }}"
body: "This pull request contains the generated code."
labels: "autocoder-bot"