Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to link startrek ticket #24

Merged
merged 2 commits into from
Jul 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/link_startrek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: startrek link

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_TOKEN }}"
}
ignoreStatusCodes: '409'