Skip to content

Commit

Permalink
enchance
Browse files Browse the repository at this point in the history
  • Loading branch information
lsielskiSii committed Aug 30, 2024
1 parent a8a454e commit 0b0685b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/actions/ado_tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,26 @@ runs:
env:
GH_TOKEN: ${{ inputs.gh-token }}
run: |
PRBODY=$(gh pr list --json body --repo ${{ inputs.repository }} --state all --search ${{ inputs.commit-sha }} --jq '.[].body')
PRBODY=$(gh pr list --json body --repo ${{ inputs.repository }} --state merged --search ${{ inputs.commit-sha }} --jq '.[].body')
echo "PRs body: $PRBODY"
echo "PRBODY=${PRBODY}" >> $GITHUB_ENV
shell: bash
- name: Extract work item reference number from PR's body
id: extract-reference-number
run: echo "$PRBODY" | sed -n "s/^.*AB#\([0-9]*\).*$/\1/p"
run: |
reference_num=$(echo $PRBODY | sed -n "s/^.*AB#\([0-9]*\).*$/\1/p")
echo $reference_num
if [ -z "$reference_num" ]
then
echo "Reference number not found!"
exit 1
else
echo "Reference number is $reference_num"
echo "REFERENCE=${reference_num}" >> $GITHUB_ENV
fi
shell: bash
- name: Add env tag for workitem
id: tag-workitem
run: |
echo "$REFERENCE"
shell: bash

0 comments on commit 0b0685b

Please sign in to comment.