Repository navigation
Add Slack PR notification workflows #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||||||||||||||
| name: PR Closed — Notify Slack | ||||||||||||||||||
|
|
||||||||||||||||||
| on: | ||||||||||||||||||
| pull_request: | ||||||||||||||||||
| types: [closed] | ||||||||||||||||||
|
|
||||||||||||||||||
| permissions: | ||||||||||||||||||
| pull-requests: read | ||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
| notify: | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | 💤 Low value Add an explicit name to the job. The job lacks a descriptive ✨ Proposed addition jobs:
notify:
+ name: Notify Slack on PR Closed/Merged
runs-on: ubuntu-latest📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[info] 11-11: workflow or action definition without a name (anonymous-definition): this job (anonymous-definition) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
| if: | | ||||||||||||||||||
| !contains(github.event.pull_request.labels.*.name, 'dependencies') && | ||||||||||||||||||
| !contains(github.event.pull_request.labels.*.name, 'ignore-for-release') && | ||||||||||||||||||
| github.event.pull_request.user.type != 'Bot' | ||||||||||||||||||
|
Comment on lines
+13
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add 'ignore-for-release' filter for consistency and draft PR filtering. This workflow lacks two filters present in
✅ Proposed addition if: |
+ !github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'dependencies') &&
+ !contains(github.event.pull_request.labels.*.name, 'ignore-for-release') &&
github.event.pull_request.user.type != 'Bot'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Post to Slack | ||||||||||||||||||
| env: | ||||||||||||||||||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_CLOSED_WEBHOOK_URL }} | ||||||||||||||||||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||||||||||||||||||
| PR_STATUS: ${{ github.event.pull_request.merged == true && 'merged' || 'closed' }} | ||||||||||||||||||
| run: | | ||||||||||||||||||
| PAYLOAD=$(jq -n \ | ||||||||||||||||||
| --arg pr_url "$PR_URL" \ | ||||||||||||||||||
| --arg pr_status "$PR_STATUS" \ | ||||||||||||||||||
| '{ | ||||||||||||||||||
| pr_url: $pr_url, | ||||||||||||||||||
| pr_status: $pr_status, | ||||||||||||||||||
| }') | ||||||||||||||||||
|
|
||||||||||||||||||
| HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ | ||||||||||||||||||
| --connect-timeout 10 \ | ||||||||||||||||||
| --max-time 30 \ | ||||||||||||||||||
| -X POST "$SLACK_WEBHOOK_URL" \ | ||||||||||||||||||
| -H 'Content-Type: application/json' \ | ||||||||||||||||||
| -d "$PAYLOAD") | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ "$HTTP_STATUS" != "200" ]; then | ||||||||||||||||||
| echo "::error::Slack webhook failed (HTTP $HTTP_STATUS)" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | ||||||||||||||||||||
| name: PR In Review — Notify Slack | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| pull_request: | ||||||||||||||||||||
| types: [review_requested] | ||||||||||||||||||||
| pull_request_review: | ||||||||||||||||||||
| types: [submitted] | ||||||||||||||||||||
|
|
||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| pull-requests: read | ||||||||||||||||||||
|
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | 💤 Low value Add explanatory comment to permissions block. The 📝 Proposed comment addition permissions:
+ # Used to read PR details for filtering and reviewer information
pull-requests: read📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 10-10: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment (undocumented-permissions) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| notify: | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | 💤 Low value Add an explicit name to the job. The job lacks a descriptive ✨ Proposed addition jobs:
notify:
+ name: Notify Slack on PR Review
runs-on: ubuntu-latest📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[info] 13-13: workflow or action definition without a name (anonymous-definition): this job (anonymous-definition) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| if: | | ||||||||||||||||||||
| !github.event.pull_request.draft && | ||||||||||||||||||||
| !contains(github.event.pull_request.labels.*.name, 'dependencies') && | ||||||||||||||||||||
| !contains(github.event.pull_request.labels.*.name, 'ignore-for-release') && | ||||||||||||||||||||
| github.event.requested_reviewer.type != 'Bot' && | ||||||||||||||||||||
| github.event.review.user.type != 'Bot' | ||||||||||||||||||||
|
Comment on lines
+15
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Job guard conditions reference event fields that may not exist. The
In GitHub Actions, evaluating 🔧 Proposed fix if: |
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'dependencies') &&
- github.event.requested_reviewer.type != 'Bot' &&
- github.event.review.user.type != 'Bot'
+ (github.event.requested_reviewer.type != 'Bot' || github.event.review.user.type != 'Bot')This uses OR logic: at least one bot check must pass (since one field will be null in any given event). Alternatively, guard by event type first: if: |
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'dependencies') &&
!contains(github.event.pull_request.labels.*.name, 'ignore-for-release') &&
+ (github.event_name == 'pull_request' && github.event.requested_reviewer.type != 'Bot' ||
+ github.event_name == 'pull_request_review' && github.event.review.user.type != 'Bot')📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsAdd 'ignore-for-release' filter for consistency. Unlike ✅ Proposed addition if: |
!github.event.pull_request.draft &&
!contains(github.event.pull_request.labels.*.name, 'dependencies') &&
+ !contains(github.event.pull_request.labels.*.name, 'ignore-for-release') &&
(github.event.requested_reviewer.type != 'Bot' || github.event.review.user.type != 'Bot')🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Resolve PR reviewer → Slack user ID | ||||||||||||||||||||
| id: slack | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| EVENT_NAME: ${{ github.event_name }} | ||||||||||||||||||||
| GITHUB_USER_REQUESTED: ${{ github.event.requested_reviewer.login }} | ||||||||||||||||||||
| GITHUB_USER_REVIEWED: ${{ github.event.review.user.login }} | ||||||||||||||||||||
| GITHUB_TO_SLACK: ${{ vars.SLACK_TO_GITHUB }} | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| if [ "$EVENT_NAME" = "pull_request" ]; then | ||||||||||||||||||||
| GITHUB_USER="$GITHUB_USER_REQUESTED" | ||||||||||||||||||||
| else | ||||||||||||||||||||
| GITHUB_USER="$GITHUB_USER_REVIEWED" | ||||||||||||||||||||
| fi | ||||||||||||||||||||
|
|
||||||||||||||||||||
| SLACK_ID=$(echo "$GITHUB_TO_SLACK" | jq -r --arg user "$GITHUB_USER" \ | ||||||||||||||||||||
| '.[] | select(.github == $user) | .slack') | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if [ -z "$SLACK_ID" ]; then | ||||||||||||||||||||
| echo "::warning::GitHub user '$GITHUB_USER' not found in SLACK_TO_GITHUB variable. Posting without Slack mention." | ||||||||||||||||||||
| fi | ||||||||||||||||||||
|
|
||||||||||||||||||||
| echo "user_id=$SLACK_ID" >> $GITHUB_OUTPUT | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Post to Slack | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_REVIEW_WEBHOOK_URL }} | ||||||||||||||||||||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||||||||||||||||||||
| PR_STATUS: ${{ github.event_name == 'pull_request' && 'review_requested' || github.event.review.state }} | ||||||||||||||||||||
| SLACK_USER_ID: ${{ steps.slack.outputs.user_id }} | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| PAYLOAD=$(jq -n \ | ||||||||||||||||||||
| --arg pr_url "$PR_URL" \ | ||||||||||||||||||||
| --arg pr_status "$PR_STATUS" \ | ||||||||||||||||||||
| --arg pr_reviewer "$SLACK_USER_ID" \ | ||||||||||||||||||||
| '{ | ||||||||||||||||||||
| pr_url: $pr_url, | ||||||||||||||||||||
| pr_status: $pr_status, | ||||||||||||||||||||
| pr_reviewer: $pr_reviewer, | ||||||||||||||||||||
| }') | ||||||||||||||||||||
|
|
||||||||||||||||||||
| HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ | ||||||||||||||||||||
| --connect-timeout 10 \ | ||||||||||||||||||||
| --max-time 30 \ | ||||||||||||||||||||
| -X POST "$SLACK_WEBHOOK_URL" \ | ||||||||||||||||||||
| -H 'Content-Type: application/json' \ | ||||||||||||||||||||
| -d "$PAYLOAD") | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if [ "$HTTP_STATUS" != "200" ]; then | ||||||||||||||||||||
| echo "::error::Slack webhook failed (HTTP $HTTP_STATUS)" | ||||||||||||||||||||
| exit 1 | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,96 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: PR Opened — Notify Slack | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [ready_for_review, opened] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Minimum permissions needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | 💤 Low value Add explanatory comment to permissions block. The 📝 Proposed comment addition # Minimum permissions needed
permissions:
+ # Used to read PR details (title, body, labels) for filtering and notifications
pull-requests: read🧰 Tools🪛 zizmor (1.25.2)[warning] 9-9: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment (undocumented-permissions) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | 💤 Low value Add an explicit name to the job for better workflow visibility. The job lacks a descriptive ✨ Proposed addition jobs:
notify:
+ name: Notify Slack on PR Open/Review
runs-on: ubuntu-latest🧰 Tools🪛 zizmor (1.25.2)[info] 12-12: workflow or action definition without a name (anonymous-definition): this job (anonymous-definition) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Skip draft PRs and dependency bumps | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !github.event.pull_request.draft && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !contains(github.event.pull_request.labels.*.name, 'dependencies') && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !contains(github.event.pull_request.labels.*.name, 'ignore-for-release') && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github.event.pull_request.user.type != 'Bot' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Extract Jira key | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: jira | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BRANCH: ${{ github.event.pull_request.head.ref }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_BODY: ${{ github.event.pull_request.body }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Try branch name first (RACK-XXXX-feature-description) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JIRA_KEY=$(echo "$BRANCH" | grep -oP 'RACK-\d+' | head -1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fallback: scan PR body (template reminder at the bottom) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -z "$JIRA_KEY" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JIRA_KEY=$(echo "$PR_BODY" | grep -oP 'RACK-\d+' | head -1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "key=$JIRA_KEY" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Resolve PR creator → Slack user ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: slack | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GITHUB_USER: ${{ github.event.pull_request.user.login }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GITHUB_TO_SLACK: ${{ vars.SLACK_TO_GITHUB }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SLACK_ID=$(echo "$GITHUB_TO_SLACK" | jq -r --arg user "$GITHUB_USER" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.[] | select(.github == $user) | .slack') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -z "$SLACK_ID" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::warning::GitHub user '$GITHUB_USER' not found in SLACK_TO_GITHUB variable. Posting without Slack mention." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "user_id=$SLACK_ID" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+38
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win Clarify variable naming: org variable Line 42 maps organization variable Consider renaming the environment variable to match the org variable name for clarity: 🔄 Proposed clarification - name: Resolve PR creator → Slack user ID
id: slack
env:
GITHUB_USER: ${{ github.event.pull_request.user.login }}
- GITHUB_TO_SLACK: ${{ vars.SLACK_TO_GITHUB }}
+ SLACK_TO_GITHUB: ${{ vars.SLACK_TO_GITHUB }}
run: |
- SLACK_ID=$(echo "$GITHUB_TO_SLACK" | jq -r --arg user "$GITHUB_USER" \
+ SLACK_ID=$(echo "$SLACK_TO_GITHUB" | jq -r --arg user "$GITHUB_USER" \
'.[] | select(.github == $user) | .slack')Alternatively, if your org's variable name is misleading, rename it in organization settings to 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Post to Slack | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_OPENED_WEBHOOK_URL }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| REPO_NAME: ${{ github.event.repository.name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_BODY: ${{ github.event.pull_request.body }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SLACK_USER_ID: ${{ steps.slack.outputs.user_id }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JIRA_KEY: ${{ steps.jira.outputs.key }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JIRA_ISSUE_URL="${JIRA_KEY:+https://vismarackbeat.atlassian.net/browse/$JIRA_KEY}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PAYLOAD=$(jq -n \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg repo_name "$REPO_NAME" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg pr_title "$PR_TITLE" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg pr_body "$PR_BODY" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg pr_number "$PR_NUMBER" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg pr_url "$PR_URL" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg pr_creator "$SLACK_USER_ID" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg jira_key "$JIRA_KEY" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg jira_issue_url "$JIRA_ISSUE_URL" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo_name: $repo_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pr_title: $pr_title, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pr_body: $pr_body, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pr_number: $pr_number, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pr_url: $pr_url, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pr_creator: $pr_creator, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jira_key: $jira_key, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jira_issue_url: $jira_issue_url, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --connect-timeout 10 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --max-time 30 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -X POST "$SLACK_WEBHOOK_URL" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H 'Content-Type: application/json' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -d "$PAYLOAD") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$HTTP_STATUS" != "200" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::error::Slack webhook failed (HTTP $HTTP_STATUS)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
Add explanatory comment to permissions block.
The
pull-requests: readpermission lacks documentation on its necessity.📝 Proposed comment addition
permissions: + # Used to read PR details (merged status, labels, author type) for filtering and notifications pull-requests: read📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 8-8: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment
(undocumented-permissions)
🤖 Prompt for AI Agents
Source: Linters/SAST tools