8주차 - 쏘/김소정 워크북 과제 제출 #52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate PR target branch | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, reopened] | |
| jobs: | |
| validate-branch: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| contents: read | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: | | |
| if [ -f package-lock.json ]; then npm ci; elif [ -f package.json ]; then npm install; fi | |
| - name: Validate PR target branch | |
| env: | |
| GITHUB_EVENT_PATH: ${{ github.event_path }} | |
| run: node .github/scripts/validate-pr-branch.js |