From 7a11f78dcb8a43f1377cc71b41d9c1c230ce9135 Mon Sep 17 00:00:00 2001 From: Dan Masquelier Date: Fri, 30 Jan 2026 12:52:37 -0800 Subject: [PATCH] Revert "Merge pull request #3 from closure-intel/daniel_pr_slack_update" This reverts commit ae16c0e13586adfea2630978ed18a8da7c1e7418, reversing changes made to 65783a6ab4229913269081c1eefc578fb43d5b51. --- .github/workflows/pr_slack_notify.yml | 51 +++++++++++++++++++++++++++ .github/workflows/pr_validation.yml | 30 ---------------- 2 files changed, 51 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/pr_slack_notify.yml delete mode 100644 .github/workflows/pr_validation.yml diff --git a/.github/workflows/pr_slack_notify.yml b/.github/workflows/pr_slack_notify.yml new file mode 100644 index 0000000..f080da9 --- /dev/null +++ b/.github/workflows/pr_slack_notify.yml @@ -0,0 +1,51 @@ +name: Slack Pull Request Notification +on: + pull_request: + types: [opened] + +jobs: + pr-title: + name: Validate PR Title + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + permissions: + pull-requests: read + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + style + refactor + perf + test + build + ci + chore + revert + requireScope: true + notify: + name: PR Slack Notification + runs-on: ubuntu-latest + steps: + - name: Escape PR title + id: pr_data + run: | + # Get the PR title and escape special characters for JSON (needed for Reverts Commits) + PR_TITLE='${{ github.event.pull_request.title }}' + # Properly escape JSON special characters and quotes + ESCAPED_TITLE=$(echo "$PR_TITLE" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed 's/\t/\\t/g' | sed 's/\n/\\n/g' | sed 's/\r/\\r/g') + echo "escaped_title=$ESCAPED_TITLE" >> $GITHUB_OUTPUT + + - name: Notify Slack + uses: slackapi/slack-github-action@v2.1.0 + with: + webhook-type: incoming-webhook + webhook: ${{ secrets.SLACK_PULL_REQUEST_WEBHOOK_URL }} + payload: | + text: "New PR: ${{ steps.pr_data.outputs.escaped_title }}\nBy: ${{ github.event.pull_request.user.login }}\nLink: ${{ github.event.pull_request.html_url }}" + diff --git a/.github/workflows/pr_validation.yml b/.github/workflows/pr_validation.yml deleted file mode 100644 index dbed929..0000000 --- a/.github/workflows/pr_validation.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Pull Request Title Validation -on: - pull_request: - types: [opened] - -jobs: - pr-title: - name: Validate PR Title - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - permissions: - pull-requests: read - steps: - - uses: amannn/action-semantic-pull-request@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - types: | - feat - fix - docs - style - refactor - perf - test - build - ci - chore - revert - requireScope: true