1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-10 00:29:12 +02:00
opentelemetry-go/.github/workflows
Sam Xie 30ca54a7dc
Protect released changelog in CI (#5560)
resolve #1682

This PR adds a new action in CI to protect released sections in the
changelog from being changed. It compares the released sections in the
changelog from the base branch to the current PR. It fails if a change
happens.

Apply "Unlock Released Changelog" to bypass this check when doing a new
release.

Action result if we changed the unreleased section:
d640deb435
Action result if we changed the released section:
d672de7a54

---

Meaning of `awk '/^\<!-- Released section --\>/ {flag=1} /^\<!--
Released section ended --\>/ {flag=0} flag'`
- `/^\<!-- Released section --\>/ {flag=1}`
  - Matches lines starting with `<!-- Released section -->`.
  - Sets the flag variable to 1 (starting the printing of lines).
- `/^\<!-- Released section ended --\>/ {flag=0}`
  - Matches lines starting with `<!-- Released section ended -->`.
  - Sets the flag variable to 0.
  - So it is ok to change external reference links, like
    ```md 
    [Go 1.22]: https://go.dev/doc/go1.22
    [Go 1.21]: https://go.dev/doc/go1.21
    ```
- `flag` lines are printed only when the flag is 1.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-07-08 11:31:31 -07:00
..
benchmark.yml Enable benchmark summary for release (#5527) 2024-07-05 09:31:04 -07:00
changelog.yml Bump actions/checkout from 3 to 4 (#4490) 2023-09-10 07:55:55 -07:00
ci.yml [chore] Update macOS runners (#5577) 2024-07-06 14:21:11 +02:00
codeql-analysis.yml Bump github/codeql-action from 2 to 3 (#4762) 2023-12-17 08:20:44 -08:00
codespell.yaml Bump actions/checkout from 3 to 4 (#4490) 2023-09-10 07:55:55 -07:00
links-fail-fast.yml build(deps): bump lycheeverse/lychee-action from 1.9.3 to 1.10.0 (#5266) 2024-04-25 21:01:41 +02:00
links.yml build(deps): bump lycheeverse/lychee-action from 1.9.3 to 1.10.0 (#5266) 2024-04-25 21:01:41 +02:00
markdown-fail-fast.yml Bump actions/checkout from 3 to 4 (#4490) 2023-09-10 07:55:55 -07:00
markdown.yml Bump peter-evans/create-issue-from-file from 4 to 5 (#4867) 2024-01-29 00:33:24 +01:00
protect-released-changelog.yml Protect released changelog in CI (#5560) 2024-07-08 11:31:31 -07:00