In the schedule builder, when searching for a proposal to add, show a warning on the result if the proposal has already been added to the schedule #4829
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: Slash Command Dispatch | |
| on: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| slash-command-dispatch: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/github-script@v3 | |
| id: get-pr | |
| with: | |
| script: | | |
| const request = { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| } | |
| core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`) | |
| try { | |
| const result = await github.pulls.get(request) | |
| return result.data | |
| } catch (err) { | |
| core.setFailed(`Request failed with error ${err}`) | |
| } | |
| - name: Slash Command Dispatch | |
| uses: peter-evans/slash-command-dispatch@v2 | |
| with: | |
| token: ${{ secrets.BOT_TOKEN }} | |
| reaction-token: ${{ secrets.BOT_TOKEN }} | |
| permission: write | |
| dispatch-type: workflow | |
| event-type-suffix: "" | |
| commands: | | |
| deploy | |
| static-args: | | |
| comment-id=${{ github.event.comment.id }} | |
| event-number=${{ github.event.issue.number }} | |
| ref=${{ fromJSON(steps.get-pr.outputs.result).head.ref }} | |
| - name: Edit comment with error message | |
| if: steps.scd.outputs.error-message | |
| uses: peter-evans/create-or-update-comment@v1 | |
| with: | |
| comment-id: ${{ github.event.comment.id }} | |
| body: | | |
| > ${{ steps.scd.outputs.error-message }} |