53 Commits

Author SHA1 Message Date
dagecko
910b91e74e fix: pin 5 unpinned action(s) (#6157) 2026-03-26 14:27:11 +05:30
Avelino
24273bf86b Fix pwn request vulnerability in PR quality checks workflow
The pull_request_target workflow checked out and executed Go scripts from
the PR head, allowing attackers to inject arbitrary code via init()
functions with access to a write-scoped GITHUB_TOKEN. This was confirmed
exploited in the wild (ref: StepSecurity blog).

Checkout now targets the base branch so only trusted scripts execute.
PR head SHA is fetched as data-only for diffing via a new PR_HEAD_SHA
env var. Write operations (comments, labels) are isolated in a separate
report job that never checks out code. All job permissions follow least
privilege — quality runs read-only, report holds the write token.

fixed: #6083

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
Co-Authored-By: Thierry Abalea <thierry.abalea@shipfox.io>
2026-03-02 11:51:11 -03:00
Avelino
64b3ad32b7 fixed netlify timeout
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
2026-02-28 11:55:43 -03:00
Avelino
a532200f99 new layout (#6065)
* new layout

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>

* project page in site

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>

---------

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
2026-02-28 11:27:46 -03:00
Avelino
45f2b49ef4 fix(ci): add safe.directory config to fix git fetch in container (#6064)
The "Fetch base branch" step fails with exit code 128 when running
inside the golang:latest container because Git does not recognize the
workspace as a safe directory. This is a Git security feature (CVE-2022-24765)
that blocks operations in directories owned by a different user, which
happens when actions/checkout runs inside a container.

https://claude.ai/code/session_01NBtQtSPnsSvAwqUMBMLGFh

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-28 09:52:42 -03:00
Avelino
00b59434f5 Add environment specification to recheck workflow 2026-02-28 05:37:52 -03:00
Avelino
18e5e3b34c fix(ci): use PAT (GH_TOKEN) instead of GITHUB_TOKEN for recheck workflow (#6057)
Events created by GITHUB_TOKEN do not trigger other workflows (GitHub
design to prevent infinite loops). Switch to the repo's GH_TOKEN PAT
so close/reopen events properly trigger pr-quality-check.

https://claude.ai/code/session_01JcdbDdtERhAXFFZmu3pCVY

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-28 05:35:18 -03:00
Avelino
f74f180683 Migrate PR quality checks from Node.js to Go (#6055)
* automate PR review: rewrite quality checks in Go and add diff validation

- Replace check-quality.js with Go implementation that adds:
  open source license detection, repo maturity (5+ months),
  CI/CD presence check, and README existence verification
- Add new check-pr-diff tool that validates README changes:
  single item per PR, link consistency with PR body,
  description format, non-promotional language, and
  category minimum size (3 items)
- Update pr-quality-check workflow to run both Go tools
  with separate quality and diff reporting sections
- Improve CONTRIBUTING.md with new "What is checked automatically"
  section documenting all blocking and non-blocking CI checks,
  plus what still requires manual maintainer review
- Improve PR template with clearer structure separating
  CI-validated requirements from manual review items

https://claude.ai/code/session_01JcdbDdtERhAXFFZmu3pCVY

* add actionable fix instructions to automated PR review comments

Each failed check now includes a "How to fix" section with specific
commands and steps the contributor needs to take, e.g.:
- missing go.mod → shows exact `go mod init` + `go mod tidy` commands
- missing semver release → shows `git tag v1.0.0` command and GitHub UI link
- low Go Report Card grade → shows `gofmt`, `go vet` commands
- missing PR body links → shows the exact text to paste
- description without period → shows the corrected entry line
- link mismatch → shows both URLs and which to update

https://claude.ai/code/session_01JcdbDdtERhAXFFZmu3pCVY

* add auto-merge when all PR quality checks pass

Adds an auto-merge job that enables GitHub's native auto-merge (squash)
after the quality and diff checks succeed. GitHub will only execute the
merge once ALL required branch protection status checks are green
(including the tests workflow).

Requires "Allow auto-merge" to be enabled in repo settings.

https://claude.ai/code/session_01JcdbDdtERhAXFFZmu3pCVY

* add workflow to re-run quality checks on all open PRs

Creates a manual workflow_dispatch workflow that iterates through all
open PRs and closes/reopens each one to re-trigger the quality check
pipeline. Includes a 2s delay between PRs to respect API rate limits.

Usage: Actions tab → "Re-check all open PRs" → Run workflow

https://claude.ai/code/session_01JcdbDdtERhAXFFZmu3pCVY

* skip quality checks for PRs that don't modify README.md

The quality checks (forge link, pkg.go.dev, Go Report Card, etc.) only
apply to package addition/removal PRs. Internal PRs (workflow changes,
docs, scripts) were failing because they naturally don't have those
fields in the PR body.

Now the workflow first detects if README.md is in the changed files:
- If yes: runs full quality + diff checks as before
- If no: posts a "Skipped" notice and passes cleanly

Fixes false failures like PR #6055.

https://claude.ai/code/session_01JcdbDdtERhAXFFZmu3pCVY

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-27 07:05:00 -03:00
Pádraic Slattery
2e31843b91 docs: Update outdated GitHub Actions versions (#5991) 2026-01-16 22:45:02 +05:30
Avelino
8cb5e86f56 remove duplicate PR quality check workflow and script
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
2025-10-06 06:49:23 -03:00
Avelino
728d16b6d2 fix: use sticky-pull-request-comment for quality check report
Replaces the previous comment action with marocchino/sticky-pull-request-comment@v2 to avoid duplicate comments on PRs. This ensures the quality check report is always updated in place, improving PR clarity and reducing notification noise.

Ref: https://github.com/avelino/awesome-go/pull/5820#issuecomment-3346082315

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
2025-10-06 06:49:23 -03:00
Avelino
12dc8e9fde feat: add automated PR quality checks for CONTRIBUTING.md standards
- Add `.github/scripts/check-quality.js` to extract PR links and validate minimum standards:
  - Checks repo accessibility, go.mod, SemVer release, Go Report Card (A- or better), coverage, and pkg.go.dev.
  - Outputs markdown report and sets fail status for critical issues.
- Add `.github/scripts/extract-pr-links.js` to extract and format PR body links for review.
- Add `.github/workflows/pr-quality-check.yaml` to run quality checks on PRs, post results as comments, sync labels, and fail PR if critical checks fail.
- Update `CONTRIBUTING.md` to clarify required PR body links and quality standards.
- Update `.github/workflows/pull-request-first-comment.yaml` to support new automation.

This improves PR review automation and enforces minimum quality standards for new submissions.

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
2025-09-14 15:00:16 -03:00
Phani Rithvij
8d972e873e netlify-deploy change dependency to nwtgck/actions-netlify@v3.0
setup node ourselves
2025-02-27 18:40:06 +05:30
yassinebenaid
b971941897 bump actions/checkout to v4 (#5366) 2024-08-04 21:19:12 +05:30
Bob Glickstein
4d656474cb Wording tweaks to the PR comment added by the first-comment GH Action. (#5177) 2024-01-19 21:12:22 +05:30
Alex Bozhenko
e05ea4cec3 correct test run usage 2023-12-21 08:55:56 -03:00
Avelino
8495071046 fixed run-check job 2023-10-28 22:04:12 -03:00
Tomasz Piowczyk
395e8489ab Fix event trigger type 2023-10-04 12:39:09 -03:00
Avelino
e4d782899c pull-request-first-comment: permission issue write 2023-08-04 17:05:02 -03:00
Paul Burlumi
db09a6a398 build(ci): fix first comment github action
This fixes the error seen creating a new pull request.
2023-05-22 17:22:17 -03:00
Paul Burlumi
33967055c8 Fix typo in github action workflow (#4878) 2023-05-08 07:39:52 +03:00
Avelino
013e1dda90 Update pull-request-first-comment.yaml 2023-04-07 14:10:48 -03:00
Avelino
23308179f3 Update pull-request-first-comment.yaml 2023-04-05 07:40:30 -03:00
Avelino
1519857fea first comment: set dynamic pull request number 2023-04-03 08:38:48 -03:00
Kirill Zhuravlev
b6ee793145 change resulting build dir for netlify 2023-04-03 08:16:26 -03:00
Kirill Zhuravlev
7aa3985741 change workflow site-deploy.yaml 2023-04-03 08:16:26 -03:00
Kirill Zhuravlev
7713914b96 fix gh wf 2023-04-03 08:16:26 -03:00
Avelino
58f71c3bbc Update check-for-spammy-issues.yml 2023-03-18 11:03:46 -03:00
Avelino
f6bc652061 Update check-for-spammy-issues.yml 2023-03-18 09:53:03 -03:00
Avelino
eb06322d4d auto msg first comment in PR 2023-03-18 08:37:22 -03:00
Avelino
3ee45b6c29 workflow: check issue spammy
fixed: #4772
2023-03-18 07:48:46 -03:00
Alex
6c1da6d88e GitHub Workflows security hardening (#4586) 2022-10-31 06:47:17 +05:30
Avelino
2697da01c5 Remove stale action
fixed: #4479
2022-10-18 11:17:02 -03:00
harishmatheshwaran
7053eec62f Update run-check.yaml 2022-10-17 16:58:43 -03:00
harishmatheshwaran
efe54277c5 Update tests.yaml 2022-10-17 16:58:43 -03:00
harishmatheshwaran
4737de3dc2 Update site-deploy.yaml 2022-10-17 16:58:43 -03:00
Ceriath
561a423eca Fix stale action wording 2022-07-10 23:11:13 +02:00
Amir Ariffin
1fd356d91f run stale repo check as test instead (#4265) 2022-06-10 17:58:34 +05:30
Avelino
8c13f0112d fixed typo action needs attr
Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-22 10:54:51 -03:00
Avelino
b20ca0f632 run specific test
Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-22 10:51:24 -03:00
Avelino
811dd9076e site deploy action
run only main branch

Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-22 10:51:24 -03:00
Avelino
340743b823 remove site deploy of tests running
Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-22 10:51:24 -03:00
Avelino
1869d62208 fixed typo netlify deploy, main branch
Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-16 08:36:24 -03:00
Avelino
31e63566db rename all hard ref branch master to main
Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-16 08:30:25 -03:00
Avelino
09ae7bf7aa remove matrix support, use container: golang:latest
Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-16 06:26:09 -03:00
Avelino
fcd6057e88 migrate travis to github actions
ref: #3943

Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-16 06:26:09 -03:00
Avelino
f503430fe9 remove netlify on run-check action
Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-16 06:26:09 -03:00
Avelino
375446fb74 netlify deploy
fixed: #3815

Signed-off-by: Avelino <avelinorun@gmail.com>
2021-12-16 06:26:09 -03:00
Tony Kappen
ca3d6d7366 Fix workflow (#3293)
* fix typo in README.md

fixes #3204

* test

* Delete main.yml

* fix workflow

* set to run on original repository
2020-10-11 16:03:33 -03:00
Tony Kappen
f77a13db41 Fix test stale repositories workflow (#3270)
* fix typo in README.md

fixes #3204

* test

* Delete main.yml

* modify workflow
2020-10-05 05:59:38 -03:00