Skip to content

Commit

Permalink
merge by api requests
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-sidelnikov committed Jun 7, 2024
1 parent a2602db commit 25595be
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ jobs:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_KEY }}
installation_id: ${{ secrets.INSTALLATION_ID }}
- uses: guardian/actions-merge-release-changes-to-protected-branch@v1.3.1
with:
github-token: ${{ steps.gen_token.outputs.token }}

- name: Merge PR
run: |
# Extract the branch name from GITHUB_REF
BRANCH_NAME=$(curl -s -H "Authorization: token ${{ steps.gen_token.outputs.token }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
| jq -r '.head_branch')
echo "branch_name=$BRANCH_NAME"
# Perform the merge
curl -X POST \
-H "Authorization: ${{ steps.gen_token.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/owner/repo/merges \
-d "{\"base\":\"devel\",\"head\":\"${{ BRANCH_NAME }}\"}"

0 comments on commit 25595be

Please sign in to comment.