Skip to content

Commit

Permalink
Add workflow file to link with startrek
Browse files Browse the repository at this point in the history
Change-Id: If6d51bf7caf33c6cba18b6e13b2ef5a03c988627
  • Loading branch information
aalexfvk committed Jul 20, 2023
1 parent f7d6f6d commit 71e0114
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/link_startrek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Link with Startrek

on:
pull_request: { branches: [main] }

jobs:
link_with_startrek:
runs-on: ubuntu-latest
steps:
- name: parse_branch_name
id: parse_branch_name
run: |
if [[ ${{ github.head_ref }} =~ ^([A-Za-z]+\-[0-9]+).*$ ]]; then
echo issue_number="${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
fi
- name: link_issue
if: steps.parse_branch_name.outputs.issue_number
uses: fjogeleit/http-request-action@v1
with:
url: 'https://st-api.yandex-team.ru/v2/issues/${{ steps.parse_branch_name.outputs.issue_number }}'
method: 'LINK'
customHeaders: >
{
"Link": "<${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }}>; rel=\"relates\"",
"Authorization": "OAuth ${{ secrets.OAUTH_STARTREK }}"
}

0 comments on commit 71e0114

Please sign in to comment.