๐ก ๋ฆฌํธ์ฝ๋ 3 - Longest Substring Without Repeating Characters #5
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: Create PR from upload to main | |
| on: | |
| push: | |
| branches: [upload] # upload โ main PR ์์ฑ/๊ฐฑ์ | |
| paths: | |
| - "Baekjoon/**" | |
| - "Leetcode/**" | |
| - "Programmers/**" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: pr-from-upload | |
| cancel-in-progress: false | |
| env: | |
| BASE_BRANCH: main | |
| HEAD_BRANCH: upload | |
| ASSISTANT_GITHUB_TOKEN: ${{ secrets.ASSISTANT_GITHUB_TOKEN }} | |
| jobs: | |
| create-pr: | |
| runs-on: ubuntu-latest | |
| env: | |
| TZ: Asia/Seoul | |
| steps: | |
| - name: Checkout (shallow) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Get today's date | |
| run: echo "TODAY=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" | |
| - name: Check for existing PR | |
| id: find-pr | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const headRef = `${owner}:${process.env.HEAD_BRANCH}`; | |
| const baseRef = process.env.BASE_BRANCH; | |
| const prs = await github.rest.pulls.list({ | |
| owner, | |
| repo, | |
| state: 'open', | |
| head: headRef, | |
| base: baseRef, | |
| per_page: 1, | |
| }); | |
| core.setOutput('exists', (prs.data.length > 0).toString()); | |
| - name: Create PR | |
| if: steps.find-pr.outputs.exists != 'true' | |
| env: | |
| GH_TOKEN: ${{ env.ASSISTANT_GITHUB_TOKEN }} | |
| run: | | |
| gh pr create \ | |
| --head ${{ env.HEAD_BRANCH }} \ | |
| --base ${{ env.BASE_BRANCH }} \ | |
| --title "${TODAY} ๋ฌธ์ ํ์์ด์" \ | |
| --body "์ค๋๋ ๋ฉ์ ธ์ ๐โจ" |