nativenudå #18
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
name: Create PR on Issue Creation | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
create-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure git | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
- name: Create a new branch | |
run: git checkout -b add-helloworld-file | |
- name: Create helloworld.txt | |
run: echo 'Hello, World!' > helloworld.txt | |
- name: Commit changes | |
run: | | |
git add helloworld.txt | |
git commit -m 'Add helloworld.txt' | |
- name: Push changes | |
run: git push origin add-helloworld-file | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: create pull request | |
run: gh pr create -B main -H add-helloworld-file --title 'Merge branch_to_merge into base_branch' --body 'Created by Github action' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |