Files
pipdock/.github/workflows/notify.yml
T
poli0981andClaude Opus 5.5 2539950cd5 fix: what an independent review of 1.6.0 found
A venv made with --symlinks is run and stored as itself, not as the base
Python its python.exe links to: validate_interpreter returned the
canonical path, so `--env .venv update --all --yes` would have changed
the system Python. Canonicalizing now only decides where a link leads
and whether it is PipDock's own; a link to another program is refused,
and a Microsoft Store alias (os error 1920) is judged by its own path.

The GUI merges and removes an added row by its path rather than by
envHash, which follows links: a re-add replaces a broken row, removal
sticks for an entry whose file is gone (a share), and neither runs
during a scan. Added entries are validated again on every listing in
both heads (envs::probe_listed), and the CLI checks its stored default
when it uses it. `env remove` makes a typed path absolute first.

SECURITY section 2 and env_probe's doc claimed an enforcement point over
IPC; they now say what is checked, and backlog X36-b records the rest.
notify.yml reports a Triage failure on a pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:22:12 +07:00

99 lines
4.2 KiB
YAML

# Discord notifications, self-contained in this repository since the move to poli0981org
# (2026-11-21). They were two callers into the owner's personal ops repo, whose notifier checked
# out *that* repo's `main` and ran its script with PipDock's webhooks in the environment; the
# script is vendored now (.github/scripts/discord_notify.py, standard library only).
#
# - ci-failure: a run of a listed workflow failed outside a pull request — a push to `main`, the
# daily or weekly schedule, a dispatch, a release tag -> DISCORD_CI_WEBHOOK. Pull-request runs
# report on the pull request, and a fork's or Dependabot's get no secrets anyway. The filter is
# on the event alone, never on a branch name or a login, which a fork controls. **Triage is the
# one exception**: it runs on `pull_request_target`, against a stranger's pull request, where
# nobody watching can fix it — and a broken triage leaves feature PRs open with nobody told. Its
# name is safe to filter on because a `pull_request_target` run's workflow file comes from the
# base branch, never from the fork; the failure is posted as an embed, which pings nobody.
# - announce: a release was published, or re-announced with a dispatch -> DISCORD_RELEASES_WEBHOOK
# and DISCORD_REPO_WEBHOOK. Publishing the draft (RELEASE-CI.md §3) is done with a person's token,
# which does fire `release: published`; a release published with GITHUB_TOKEN would not.
#
# **The list is by exact `name:`.** `workflows: ['*']`, which the ops repo's own example
# suggested, is not a wildcard to `workflow_run`: it matched nothing, and `main` was red for three
# weeks in September with nobody told. A new workflow is added here by name. Unlike the ops-repo
# reusable, which skipped anything named like CodeQL or Release because they had "dedicated
# notifiers" PipDock never had, CodeQL, Qodana and Release are listed: a failed Release run used
# to reach no channel at all.
name: Notify
on:
workflow_run:
workflows:
- CI / Rust
- CI / Node
- CI / Integration
- CodeQL
- Qodana
- Release
- Security scan
- SonarCloud
- Triage
types: [completed]
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Release tag to announce again (e.g. v1.6.0)
required: true
type: string
permissions:
contents: read
jobs:
ci-failure:
if: >-
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.event != 'pull_request' &&
(github.event.workflow_run.event != 'pull_request_target' ||
github.event.workflow_run.name == 'Triage')
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Post the failure to Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
RUN_URL: ${{ github.event.workflow_run.html_url }}
BRANCH: ${{ github.event.workflow_run.head_branch }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
ACTOR: ${{ github.event.workflow_run.actor.login }}
EVENT: ${{ github.event.workflow_run.event }}
run: python3 .github/scripts/discord_notify.py failure
announce:
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Announce on Discord
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.release.tag_name || inputs.tag }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASES_WEBHOOK }}
DISCORD_WEBHOOK_EXTRA: ${{ secrets.DISCORD_REPO_WEBHOOK }}
run: python3 .github/scripts/discord_notify.py release