mirror of
https://github.com/outbackdingo/Biohazard.git
synced 2026-01-27 10:18:27 +00:00
feat(renovate): use proper gh command in rebase workflow
This commit is contained in:
14
.github/workflows/renovate-rebase.yaml
vendored
14
.github/workflows/renovate-rebase.yaml
vendored
@@ -7,6 +7,10 @@ on:
|
||||
types: ["auto_merge_enabled", "closed"]
|
||||
branches: ["main"]
|
||||
|
||||
concurrency:
|
||||
cancel-in-progress: true
|
||||
group: "${{ github.ref }}"
|
||||
|
||||
jobs:
|
||||
rebase-after:
|
||||
name: Rebase
|
||||
@@ -28,9 +32,12 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
for i in $(gh pr list --repo ${{ github.event.pull_request.base.repo.full_name }} --author "tinfoild[bot]" --json title,number,autoMergeRequest,headRefName | jq '.[] | select((.autoMergeRequest != null) and (.headRefName | startswith("renovate/"))) | .number'); do
|
||||
sha=$(gh pr view ${i} --json headRefOid --jq '.headRefOid' --repo ${{ github.event.pull_request.base.repo.full_name }})
|
||||
gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${i}/update-branch --field expected_head_sha=${sha}
|
||||
echo "i = ${i}"
|
||||
# sha=$(gh pr view ${i} --json headRefOid --jq '.headRefOid' --repo ${{ github.event.pull_request.base.repo.full_name }})
|
||||
# echo "sha = ${sha}"
|
||||
gh pr update-branch ${i} --repo ${{ github.event.pull_request.base.repo.full_name }}
|
||||
done
|
||||
# gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${i}/update-branch --field expected_head_sha=${sha}
|
||||
|
||||
- name: Update branch if automerge enabled
|
||||
if: github.event.action == 'auto_merge_enabled'
|
||||
@@ -38,4 +45,5 @@ jobs:
|
||||
GITHUB_TOKEN: "${{ steps.oauth-token.outputs.token }}"
|
||||
shell: bash
|
||||
run: |
|
||||
gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${{ github.event.pull_request.number }}/update-branch --field expected_head_sha=${{ github.event.pull_request.head.sha }}
|
||||
gh pr update-branch ${{ github.event.pull_request.number }} --repo ${{ github.event.pull_request.base.repo.full_name }}
|
||||
# gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${{ github.event.pull_request.number }}/update-branch --field expected_head_sha=${{ github.event.pull_request.head.sha }}
|
||||
|
||||
Reference in New Issue
Block a user