Skip to content

Commit

Permalink
Update development_workflow.yml changes the method for pr
Browse files Browse the repository at this point in the history
  • Loading branch information
amirbabaei97 authored Dec 28, 2023
1 parent bfb7bf9 commit 6a87aba
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/development_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- development

permissions:
pull-requests: write # Grants permission to create pull requests

jobs:
build-test-and-merge:
runs-on: ubuntu-latest
Expand All @@ -27,20 +30,17 @@ jobs:
# Replace with your actual test command, e.g., pytest
echo "Running tests!"
- name: Checkout development branch
uses: actions/checkout@v2
with:
ref: 'development'

- name: Auto-merge to main if tests pass
if: ${{ success() }}
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.MY_PERSONAL_TOKEN }}
branch: update-from-development-${{ github.run_id }} # Unique branch for the PR
commit-message: Merge development into main
title: '[AUTO-MERGE] Merge from Development to Main'
body: |
This is an automated pull request to update from branch development to main.
base: main # The target branch for the PR
labels: automerge
- name: Setup GitHub CLI
run: |
sudo apt update && sudo apt install -y gh # Installs the GitHub CLI
- name: Authenticate GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Uses the built-in GITHUB_TOKEN for authentication
run: |
gh auth setup-git # Configures git to use 'gh' as a credential helper
- name: Create or Update Pull Request
run: |
gh_pr_up() { gh pr create $* || gh pr edit $* } # Defines a function to create or update a PR
gh_pr_up --title "My pull request" --body "Description" # Uses the function to create/update a PR

0 comments on commit 6a87aba

Please sign in to comment.