Skip to content

Feature/b2 cfront 5765 #27

Feature/b2 cfront 5765

Feature/b2 cfront 5765 #27

Workflow file for this run

name: Update PR Description
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: Define and set string replacements
run: |

Check failure on line 20 in .github/workflows/pr-link.yml

View workflow run for this annotation

GitHub Actions / Update PR Description

Invalid workflow file

The workflow is not valid. .github/workflows/pr-link.yml (Line: 20, Col: 14): Unexpected symbol: 'head_ref//\//-'. Located at position 8 within expression: github.head_ref//\//-
echo "BRANCH_BUILD=${{ github.head_ref }}" >> $GITHUB_ENV
STAND_BRANCH=${{ github.head_ref//\//- }}
echo "STAND_BRANCH=$STAND_BRANCH" >> $GITHUB_ENV
JIRA_TASK=${{ github.head_ref#*/ }}
echo "JIRA_TASK=$JIRA_TASK" >> $GITHUB_ENV
JIRA_TASK_NUMBER=${{ JIRA_TASK#B2CFRONT- }}
echo "JIRA_TASK_NUMBER=$JIRA_TASK_NUMBER" >> $GITHUB_ENV
- name: Add build, stand, and Jira links to PR body
id: update_body
uses: frabert/[email protected]
with:
pattern: '%BRANCH_BUILD%'
string: ${{ github.event.pull_request.body }}
replace-with: ${{ env.BRANCH_BUILD }}
- name: Add stand link to body
uses: frabert/[email protected]
with:
pattern: '%BRANCH_STAND%'
string: ${{ steps.update_body.outputs.replaced }}
replace-with: ${{ env.JIRA_TASK }}
- name: Add Jira link to body
uses: frabert/[email protected]
with:
pattern: '%JIRA%'
string: ${{ steps.update_body.outputs.replaced }}
replace-with: ${{ env.JIRA_TASK_NUMBER }}
- name: Update PR body
uses: AsasInnab/pr-body-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.update_body.outputs.replaced }}