티스토리 뷰

공부

[github] create pull request

승가비 2024. 4. 4. 18:33
728x90
name: Manual Pull Request

on:
  push:
    branches:
      - feature-branch

jobs:
  create_pull_request:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      
      - name: Create Pull Request via GitHub API
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
        run: |
          PR_DATA='{
            "title": "Automated Pull Request",
            "body": "This is an automated pull request.",
            "head": "feature-branch",
            "base": "main"
          }'
          
          RESPONSE=$(curl \
            -X POST \
            -H "Authorization: token $GH_TOKEN" \
            -H "Accept: application/vnd.github.v3+json" \
            https://api.github.com/repos/${{ github.repository }}/pulls \
            -d "$PR_DATA")
          
          echo "Pull Request Response: $RESPONSE"
728x90

'공부' 카테고리의 다른 글

[Bcrypt]  (0) 2024.04.11
[sh] command || true  (0) 2024.04.10
[kotlin] return; return@foreach; run breaker@ { return@breaker; }  (0) 2024.04.04
[sql] GROUP_CONCAT(column1 SEPARATOR '; ')  (0) 2024.04.04
[JUnit] Parameterized  (0) 2024.04.04
댓글