GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-docs-pt-br/scripts/prepmsg.sh at main · python/python-docs-pt-br

Expand file tree

/

prepmsg.sh

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
40 lines (33 loc) · 1.2 KB
/

prepmsg.sh

Copy path

File metadata and controls

executable file
·
40 lines (33 loc) · 1.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Prepare message for Telegram notification
set -ex
die() { echo "$0: error: $*" >&2; exit 1; }
[ $# -ne 2 ] && die "Expected 1 input and 1 output files, got $#"
[ ! -f "$1" ] && die "Input file $1 not found, skipping."
[ -z "${PYDOC_REPO}" ] && die "PYDOC_REPO is empty."
[ -z "${PYDOC_VERSION}" ] && die "PYDOC_VERSION is empty."
[ -z "${GITHUB_RUN_ID}" ] && die "GITHUB_RUN_ID is empty."
[ -z "${GITHUB_JOB}" ] && die "GITHUB_JOB is empty."
URL="${PYDOC_REPO}/actions/runs/${GITHUB_RUN_ID}"
input="$1"
output="$2"
touch aux
if [[ "${GITHUB_JOB}" == "build" ]]; then
grep 'cpython/Doc/.*WARNING:' "$input" | \
sed 's|.*/cpython/Doc/||' | \
uniq | \
sed 's|^|```\n|;s|$|\n```\n|' \
> aux
elif [[ "${GITHUB_JOB}" == "lint" ]]; then
grep -P '^.*\.po:\d+:\s+.*\(.*\)$' "$input" | \
sed 's|.*/cpython/Doc/||' | \
sort -u | \
sed 's|^|```\n|;s|$|\n```\n|' \
> aux
else
die "Unexpected job name ${GITHUB_JOB}"
fi
[[ $(cat aux) == "" ]] && die "Unexpected empty output message."
echo "❌ *${PYDOC_VERSION} ${GITHUB_JOB}* (ID [${GITHUB_RUN_ID}]($URL)):" > "$output";
{ echo ""; cat aux; echo ""; } >> "$output"
rm aux
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.