Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

feat: добавление правила для защищенной ветки #62

feat: добавление правила для защищенной ветки

feat: добавление правила для защищенной ветки #62

Workflow file for this run

name: Test on Pull Request
on:
pull_request:
types:
- opened
- synchronize
jobs:
checkout:
runs-on: front
steps:
- name: Set up unique workspace and checkout
id: setup_workspace
run: |
workspace_path="${{ github.workspace }}/${{ github.event.pull_request.number }}"
echo "Using workspace path: $workspace_path"
echo "workspace_path=$workspace_path" >> "$GITHUB_OUTPUT"
if [ -e "$workspace_path/.git" ]; then
echo "Fetching repository changes"
cd $workspace_path
git fetch origin ${{ github.event.pull_request.head.ref }} --depth 1
git reset --hard FETCH_HEAD
else
echo "Cloning repository"
git clone --branch ${{ github.event.pull_request.head.ref }} --depth 1 [email protected]:${{ github.repository }} $workspace_path
fi
setup:
runs-on: front
needs: checkout
steps:
- name: Install dependencies
env:
workspace_path: ${{ steps.setup_workspace.outputs.workspace_path}}
run: |

Check failure on line 37 in .github/workflows/pull-request.yml

View workflow run for this annotation

GitHub Actions / Test on Pull Request

Invalid workflow file

The workflow is not valid. .github/workflows/pull-request.yml (Line: 37, Col: 14): Unrecognized named-value: 'workspace_path'. Located at position 1 within expression: workspace_path
echo ${{ workspace_path }}
cd ${{ workspace_path }}
yarn
tests:
runs-on: front
needs: setup
steps:
- name: Run tests
env:
workspace_path: ${{ steps.setup_workspace.outputs.workspace_path}}
run: cd $workspace_path && yarn test
eslint:
runs-on: front
needs: setup
steps:
- name: Run eslint
env:
workspace_path: ${{ steps.setup_workspace.outputs.workspace_path}}
run: cd $workspace_path && yarn eslint
tslint:
runs-on: front
needs: setup
steps:
- name: Run tslint
env:
workspace_path: ${{ steps.setup_workspace.outputs.workspace_path}}
run: cd $workspace_path && yarn tslint
prettier:
runs-on: front
needs: setup
steps:
- name: Run prettier
env:
workspace_path: ${{ steps.setup_workspace.outputs.workspace_path}}
run: cd $workspace_path && yarn prettier
protect:
runs-on: front
needs: [tests, eslint, tslint, prettier]
steps:
- name: Protect branch
run: echo "Branch is protected"
cleanup:
runs-on: front
needs: protect
if: github.event_name == 'pull_request' && github.event.action == 'closed'
steps:
- name: Clean up workspace
env:
workspace_path: ${{ steps.setup_workspace.outputs.workspace_path}}
run: rm -rf $workspace_path