Skip to content

Commit

Permalink
Merge pull request #27 from IABTechLab/llp-uid2-2236-auto-pr-action
Browse files Browse the repository at this point in the history
Create an action we can use to automate creating and merging a PR.
  • Loading branch information
lionell-pack-ttd authored Dec 5, 2023
2 parents 00d53ec + 6343c6f commit 75df4a1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions actions/commit-pr-and-merge/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Commit, create PR, and merge it
inputs:
message:
description: 'Message for commit and PR title'
required: false
default: 'Automated update'
runs:
using: "composite"
steps:
- name: Commit and PR
uses: peter-evans/create-pull-request@v5
id: create-pr
with:
commit-message: '[CI Pipeline] ${{ inputs.message }}'
title: '[CI Pipeline] ${{ inputs.message }}'
body: '[CI Pipeline] Automated update'
branch-suffix: short-commit-hash

- name: Merge PR
run: gh pr merge $PR_URL $MERGE_PR_STRATEGY
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' }}

0 comments on commit 75df4a1

Please sign in to comment.