The autobump engine opens pull requests with gh and git push, so its
environment must keep GH_TOKEN. Portage passes that environment into
every ebuild phase, which builds unreviewed upstream releases, so both
autobump workflows add the token variables to ENV_UNSET in make.conf.
ENV_UNSET is incremental and needs EAPI 7, which every overlay ebuild
already uses.
The nvchecker job exports a personal access token right after its pip
install, so an unpinned release of any dependency could read it. The
job now installs exact versions with hashes for the runner's Python
3.12. Regenerate .github/nvchecker-requirements.txt with:
printf '%s\n' nvchecker==2.22 jq==1.13.0 portage==3.0.83 |
uv pip compile - --generate-hashes --python-version 3.12 \
--no-header --no-annotate
A pull request's own run writes findings.json and the elog artifacts,
so a line starting with a backtick run could close the code fence and
post markdown under github-actions[bot]. Backticks in that text now
become quotes. The commit subject in the pull request rules comment is
not fenced at all, so it now goes into a code span with its backticks
and control characters replaced.
emerge-targets.sh turned a new top-level file such as SECURITY.md into
the atom SECURITY.md/, which failed emerge-on-pr, so paths without
category/package/file are skipped.
Signed-off-by: Zakk <zakk@gentoozh.org>
14 lines
873 B
Bash
Executable File
14 lines
873 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# usage: commit-rules.sh <pull request number>
|
|
# prints the commits of the pull request that break the commit rules in CONTRIBUTING.en.md
|
|
set -euo pipefail
|
|
# shellcheck disable=SC2016 # jq, not shell, expands these
|
|
gh api "repos/$GITHUB_REPOSITORY/pulls/${1:?pull request number}/commits?per_page=100" --paginate --jq '
|
|
.[] | (.commit.message | split("\n")[0] | gsub("[[:cntrl:]]"; " ") | gsub("`"; "\u0027")) as $s
|
|
| if (.parents | length) > 1 then ["It is a merge commit"]
|
|
else [ if ($s | test("^(Revert \"|[^\\s:][^:]*: \\S)")) then empty else "The subject does not start with what it changes" end,
|
|
if (.commit.message | test("(?m)^Signed-off-by: \\S")) then empty else "It has no `Signed-off-by:` line" end ]
|
|
end as $why
|
|
| select($why | length > 0)
|
|
| "- `\(.sha[0:12])` `\($s)`\n" + ($why | map(" - " + .) | join("\n"))'
|