Skip to content

Parallel FREEZE TABLE #436

Parallel FREEZE TABLE

Parallel FREEZE TABLE #436

Workflow file for this run

name: Link with Startrek
on:
pull_request: { branches: [main] }
env:
ISSUE_PATTERN: '[A-Z]+-[0-9]+'
jobs:
link:
runs-on: ubuntu-latest
steps:
- name: Parse issue ID
run: |
LAST_COMMIT_MESSAGE="$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "${{ github.event.pull_request.commits_url }}" | jq -r .[-1].commit.message)"
if [[ "$LAST_COMMIT_MESSAGE" =~ \[($ISSUE_PATTERN)\] || "${{ github.head_ref }}" =~ ^($ISSUE_PATTERN) ]]; then
echo ISSUE_NUMBER="${BASH_REMATCH[1]}" >> "${GITHUB_ENV}"
fi
- name: Link issue
if: env.ISSUE_NUMBER
uses: fjogeleit/http-request-action@v1
with:
url: 'https://st-api.yandex-team.ru/v2/issues/${{ env.ISSUE_NUMBER }}'
method: 'LINK'
customHeaders: >
{
"Link": "<${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }}>; rel=\"relates\"",
"Authorization": "OAuth ${{ secrets.OAUTH_STARTREK }}"
}
ignoreStatusCodes: 409