Skip to content

Commit

Permalink
Update issue-to-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
albertinisg authored Dec 20, 2024
1 parent a304e22 commit 415135d
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/issue-to-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
uses: actions/github-script@v6
with:
script: |
// 'core' is already provided by actions/github-script
const issueBody = context.payload.issue.body;
const issueTitle = context.payload.issue.title;
const lines = issueBody.split('\n');
Expand Down Expand Up @@ -62,12 +61,7 @@ jobs:
echo "Prompt Content:"
echo "${{ steps.extract_data.outputs.PROMPT_CONTENT_B64 }}" | base64 --decode
- name: Create Branch
id: branch_name
run: |
BRANCH_NAME="issue-${{ github.event.issue.number }}"
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
git checkout -b "$BRANCH_NAME"
# Remove 'Create Branch' and 'Push Branch' steps

- name: Create File from Issue
run: |
Expand All @@ -94,25 +88,21 @@ jobs:
echo
echo "$PROMPT_CONTENT"
} > "$FILE_PATH"
git add "$FILE_PATH"
git commit -m "Add prompt '$PROMPT_NAME' from Issue #${{ github.event.issue.number }}"
- name: Push Branch
run: |
BRANCH_NAME="${{ steps.branch_name.outputs.branch }}"
git push origin "$BRANCH_NAME"
# Do not commit changes here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.branch_name.outputs.branch }}
base: main
commit-message: "Add prompt '${{ steps.extract_data.outputs.PROMPT_NAME }}' from Issue #${{ github.event.issue.number }}"
committer: 'GitHub <[email protected]>'
author: 'Your Name <[email protected]>' # Replace with your details or use a generic name
title: "Add Prompt: ${{ steps.extract_data.outputs.PROMPT_NAME }}"
body: |
Adds a new prompt from Issue #${{ github.event.issue.number }}.
Automatically generated by GitHub Actions.
committer: 'GitHub <[email protected]>'
author: 'Your Name <[email protected]>'
skip-commits: true
branch: "issue-${{ github.event.issue.number }}"
branch-suffix: "none"
base: main
delete-branch: false
overwrite-existing: true

0 comments on commit 415135d

Please sign in to comment.