Wizard vision — rollup tracker #2
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: Notify Slack for wizard issues | |
| on: | |
| issues: | |
| types: [opened] | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: read | |
| repository-projects: read | |
| steps: | |
| - name: Check issue and build payload | |
| id: check | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 | |
| with: | |
| script: | | |
| const issue = context.payload.issue; | |
| // Check if the issue belongs to integration autonomy | |
| const EXCLUDED_PROJECTS = ['Integration autonomy']; | |
| const { node } = await github.graphql(` | |
| query($issueId: ID!) { | |
| node(id: $issueId) { | |
| ... on Issue { | |
| projectItems(first: 10) { | |
| nodes { | |
| project { title } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| `, { issueId: issue.node_id }); | |
| const projects = (node?.projectItems?.nodes || []).map(n => n.project.title); | |
| const isExcluded = projects.some(p => EXCLUDED_PROJECTS.includes(p)); | |
| if (isExcluded) { | |
| core.info(`Skipping: issue belongs to excluded project (${projects.join(', ')})`); | |
| core.setOutput('notify', 'false'); | |
| return; | |
| } | |
| const labels = (issue.labels || []).map(l => l.name).join(', '); | |
| const payload = { | |
| text: `New wizard issue: <${issue.html_url}|${issue.title}>\nBy: ${issue.user.login}\nLabels: ${labels || 'none'}` | |
| }; | |
| core.setOutput('notify', 'true'); | |
| core.setOutput('payload', JSON.stringify(payload)); | |
| - name: Notify Slack | |
| if: steps.check.outputs.notify == 'true' | |
| uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_WIZARD_CHANNEL }} | |
| webhook-type: incoming-webhook | |
| payload: ${{ steps.check.outputs.payload }} |