Workflow file for this run
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 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 GitHub Actions / Update PR DescriptionInvalid workflow file
|
||
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 }} |