feat: organize menu in navbar #89
Workflow file for this run
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: Pull request automation | |
| on: | |
| pull_request_target: | |
| types: opened | |
| permissions: | |
| pull-requests: write | |
| issues: read | |
| jobs: | |
| assign_to_author: | |
| name: Assign author if no assignee set | |
| if: github.event.pull_request.assignee == null && github.event.pull_request.user.login != 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| env: | |
| PR_NUM: ${{ github.event.pull_request.number }} | |
| PR_AUTHOR: ${{ github.event.pull_request.user.login }} | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - name: Assign the author to the pull request | |
| run: | | |
| curl -LvX POST --fail-with-body \ | |
| -H "Authorization: Bearer $GH_TOKEN" \ | |
| --json '{"assignees": ["'"$PR_AUTHOR"'"]}' \ | |
| "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_NUM/assignees" | |
| link-reminder: | |
| name: Remind to link issues | |
| if: github.event.pull_request.user.login != 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check linking | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const prNumber = context.payload.pull_request.number; | |
| const prBody = context.payload.pull_request.body || ""; | |
| const issueLinkRegex = /(?:fix(?:e[sd])?|close(?:[sd])?|resolve(?:[sd])?):?\s+#\d+/i; | |
| if(!issueLinkRegex.test(prBody)){ | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: prNumber, | |
| body: "Looks like you did not link an issue to this PR. If this PR completes a task, consider linking it." | |
| }); | |
| } |