-
Notifications
You must be signed in to change notification settings - Fork 74
42 lines (41 loc) · 1.5 KB
/
fast-forward-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Fast-forward between branches
on:
workflow_call:
inputs:
ref:
description: 'The branch name or commit to fast-forward from'
type: string
to_branch:
description: 'The branch name to fast-forward to'
type: string
jobs:
fast-forward:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
token: ${{ secrets.FF_CANDIDATE_BRANCH_PAT_TOKEN }}
- id: git_log
name: Generate diff log
run: |
issues=$(git log origin/${{ inputs.to_branch }}..${{ inputs.ref }} | grep -ioh "THREESCALE-[0-9]\+" | sort -u | sed -e 's/^/https:\/\/issues.redhat.com\/browse\//')
echo "issues<<EOF" >> $GITHUB_OUTPUT
echo "$issues" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
log=$(git log origin/${{ inputs.to_branch }}..${{ inputs.ref }} --pretty=format:'%h - %s (%an)')
echo "log<<EOF" >> $GITHUB_OUTPUT
echo "$log" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Fast-forward
run: |
git fetch origin ${{ inputs.ref }}:${{ inputs.to_branch }}
git push origin ${{ inputs.to_branch }}
- name: Print diff log
run: |
echo -e "\nISSUES MENTIONED IN THE CHANGELOG:"
echo "${{ steps.git_log.outputs.issues }}"
echo -e "\nCHANGELOG SUMMARY:"
echo "${{ steps.git_log.outputs.log }}"