Feature/b2 cfront 5732 #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update-link | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
jobs: | |
replace-link: | |
if: endsWith(github.base_ref, 'stand/release') == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Add build link to body | |
id: body_with_build_link | |
uses: frabert/[email protected] | |
with: | |
pattern: '%BRANCH_BUILD%' | |
string: ${{ github.event.pull_request.body }} | |
replace-with: ${{ github.head_ref }} | |
- name: Prepare stand branch name | |
id: prepared_stand_branch_name | |
uses: frabert/[email protected] | |
with: | |
pattern: '\/' | |
string: ${{ github.head_ref }} | |
replace-with: '-' | |
- name: Add stand link to body | |
id: body_with_stand_link | |
uses: frabert/[email protected] | |
with: | |
pattern: '%BRANCH_STAND%' | |
string: ${{ steps.body_with_build_link.outputs.replaced }} | |
replace-with: ${{ steps.prepared_stand_branch_name.outputs.replaced }} | |
- name: Prepare jira branch name | |
id: prepared_jira_branch_name | |
uses: frabert/[email protected] | |
with: | |
pattern: '(feature|fix|hotfix)\/' | |
string: ${{ github.head_ref }} | |
replace-with: '' | |
- name: Add jira link to body | |
id: body_with_jira_link | |
uses: frabert/[email protected] | |
with: | |
pattern: '%JIRA%' | |
string: ${{ steps.body_with_stand_link.outputs.replaced }} | |
replace-with: ${{ steps.prepared_jira_branch_name.outputs.replaced }} | |
- name: PR body replace | |
uses: AsasInnab/pr-body-action@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
body: ${{ steps.body_with_jira_link.outputs.replaced }} |