diff --git a/.github/workflows/discord_pr_announce.yml b/.github/workflows/discord_pr_announce.yml index edd87b23cdd..246b5520b0f 100644 --- a/.github/workflows/discord_pr_announce.yml +++ b/.github/workflows/discord_pr_announce.yml @@ -1,11 +1,12 @@ -name: "New PR Notification" +name: "Discord PR Notification" on: pull_request_target: - types: [opened, closed] + types: [opened, closed, labeled] jobs: notify: runs-on: ubuntu-latest + if: ${{ github.event.action != "labeled" || github.event.label.name == "Stale" }} steps: - name: "Check for DISCORD_WEBHOOK" id: secrets_set @@ -19,13 +20,13 @@ jobs: uses: tgstation/discord-notify@v3 if: > steps.secrets_set.outputs.SECRETS_ENABLED && - (github.event.pull_request.merged == true || github.event.action == 'opened') && + (github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'labeled') && github.event.pull_request.author_association != 'FIRST_TIMER' && github.event.pull_request.author_association != 'FIRST_TIME_CONTRIBUTOR' with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} title: ${{ github.event.pull_request.user.login }} - ${{ github.event.pull_request.title }} - message: "GET_ACTION" + message: ${{ github.event.action != "labeled" && "GET_ACTION" || "**Pull Request ${{ github.event.pull_request.number }} automatically marked as stale.**" }} include_image: false show_author: false avatar_url: https://avatars.githubusercontent.com/u/1363778?s=200&v=4