thssoting #15
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-issue-branch | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
create_issue_branch_job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create Issue Branch | |
id: Create_Issue_Branch | |
uses: robvanderleek/create-issue-branch@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create new file | |
id: Create_new_file | |
run: | | |
echo ${{ steps.Create_Issue_Branch.outputs.branchName }} | |
git checkout -b ${{ steps.Create_Issue_Branch.outputs.branchName }} | |
echo "This is a new file" > new-file.txt | |
ls -la | |
- name: Commit new file | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add new-file.txt | |
git commit -m "Add new file to new branch" || echo "No changes to commit" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push new branch | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git commit -m "Add new file to new branch" | |
git push origin ${{ steps.Create_Issue_Branch.outputs.branchName }} | |