Skip to content

Commit

Permalink
Add ADMIN_ACCESS (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine authored Nov 7, 2024
1 parent fa19ffb commit 9365582
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion actions/commit_pr_and_merge/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ inputs:
description: The base branch we want to merge into
type: string
default: ''
admin_access:
description: Allow merging PR with `--admin` flag
type: boolean
required: false
default: false
outputs:
git_tag_or_hash:
description: The git tag (or hash if no tag provided) of the merge commit
Expand Down Expand Up @@ -66,13 +71,14 @@ runs:
core.setOutput('pull-request-number', newPr.number);
- name: Merge PR
run: gh pr merge $PR_URL --delete-branch $MERGE_PR_STRATEGY
run: gh pr merge $PR_URL --delete-branch $MERGE_PR_STRATEGY $ADMIN_ACCESS
if: steps.changes.outputs.changes_exist == 'true'
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
MERGE_PR_STRATEGY: ${{github.ref_protected == true && '--merge' || '--rebase' }}
ADMIN_ACCESS: ${{ inputs.admin_access == true && '--admin' || '' }}

- name: Tag commit
uses: actions/github-script@v7
Expand Down

0 comments on commit 9365582

Please sign in to comment.