Skip to content

Commit 3c7877f

Browse files
niwoernerChrsMark
authored andcommitted
[chore] run markdown-link-check on version change (open-telemetry#36645)
#### Description This PR will run the "markdown-link-check" tool if the version of the tool changes even if no markdown files were updated. This will help to confirm that "markdown-link-check" is still working as expected after a version update/pin. ~~If 1+ *.md files gets changed AND the version gets updated, it will only check the updated files to keep the same behaviour as before.~~ ~~If only the version gets updated it will test all existing *.md files.~~ **EDIT:** After feedback and suggestion from @mowies (thank you again! :) ), I switched to use a [predefined](https://github.com/tj-actions/changed-files) github action which checks markdown files changes AND if the `.github/workflows/check-links.yaml` changed. If the '.github/workflows/check-links.yaml' file, the markdown-link-check tool will test against all markdown files existing in the repo. This would catch a version change of the "markdown-link-check" tool and test it accordingly. If 1+ *.md file gets changed while the `.github/workflows/check-links.yaml` file does **not** change, it will only test the changed files to keep the same behaviour like before. /cc @mx-psi @mowies @ChrsMark #### Link to tracking issue Fixes open-telemetry#36588 --------- Co-authored-by: Christos Markou <[email protected]>
1 parent 49745d1 commit 3c7877f

File tree

9 files changed

+29
-17
lines changed

9 files changed

+29
-17
lines changed

.github/workflows/check-links.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,44 @@ jobs:
1717
changedfiles:
1818
name: changed files
1919
runs-on: ubuntu-24.04
20-
env:
21-
PR_HEAD: ${{ github.event.pull_request.head.sha }}
2220
if: ${{ github.actor != 'dependabot[bot]' }}
2321
outputs:
24-
md: ${{ steps.changes.outputs.md }}
22+
md_files: ${{ steps.changed-files.outputs.md_all_changed_files }}
23+
yaml_files: ${{ steps.changed-files.outputs.yaml_all_changed_files }} # used to catch MD_LINK_CHECK_VERSION updates and runs check-links to confirm functionality
2524
steps:
2625
- uses: actions/checkout@v4
2726
with:
2827
fetch-depth: 0
2928
- name: Get changed files
30-
id: changes
31-
run: |
32-
echo "md=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs)" >> $GITHUB_OUTPUT
29+
id: changed-files
30+
uses: tj-actions/changed-files@v45
31+
with:
32+
files_yaml: |
33+
md:
34+
- '**.md'
35+
yaml:
36+
- .github/workflows/check-links.yaml
37+
3338
check-links:
3439
runs-on: ubuntu-24.04
3540
needs: changedfiles
36-
if: ${{needs.changedfiles.outputs.md}}
41+
if: needs.changedfiles.outputs.md_files || needs.changedfiles.outputs.yaml_files
3742
steps:
3843
- uses: actions/checkout@v4
3944
with:
4045
fetch-depth: 0
41-
4246
- name: Install markdown-link-check
4347
run: npm install -g markdown-link-check@${{ env.MD_LINK_CHECK_VERSION }}
44-
4548
- name: Run markdown-link-check
4649
run: |
50+
if [ -n "${{ needs.changedfiles.outputs.yaml_files }}" ]; then
51+
md=$(find . -type f -name "*.md")
52+
else
53+
md="${{ needs.changedfiles.outputs.md_files }}"
54+
fi
55+
4756
markdown-link-check \
4857
--verbose \
4958
--config .github/workflows/check_links_config.json \
50-
${{needs.changedfiles.outputs.md}} \
59+
$md \
5160
|| { echo "Check that anchor links are lowercase"; exit 1; }

.github/workflows/check_links_config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
},
1212
{
1313
"pattern": "^#"
14+
},
15+
{
16+
"pattern": "https://blogs\\.oracle\\.com/developers/post/connecting-a-go-application-to-oracle-database"
1417
}
1518
],
1619
"aliveStatusCodes": [429, 200]

cmd/telemetrygen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can build locally the Docker image with:
3232
make docker-telemetrygen
3333
```
3434

35-
Using github actions, we also push a docker image on commit to main or on release to this [Github docker registry](https://github.com/open-telemetry/opentelemetry-collector-contrib/pkgs/container/opentelemetry-collector-contrib%2Ftelemetrygen).
35+
Using github actions, we also push a docker image on commit to main or on release to this [Github docker registry](https://github.com/orgs/open-telemetry/packages/container/package/opentelemetry-collector-contrib%2Ftelemetrygen).
3636

3737
## Running
3838

exporter/azuremonitorexporter/conventions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222

2323
// NetworkAttributes is the set of known network attributes
2424
type NetworkAttributes struct {
25-
// see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/span-general.md#general-network-connection-attributes
25+
// see https://github.com/open-telemetry/semantic-conventions/blob/main/docs/attributes-registry/network.md#network-attributes
2626
NetTransport string
2727
NetPeerIP string
2828
NetPeerPort int64

pkg/stanza/docs/operators/tcp_input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The `tcp_input` operator listens for logs on one or more TCP connections. The op
1414
| `attributes` | {} | A map of `key: value` pairs to add to the entry's attributes. |
1515
| `one_log_per_packet` | false | Skip log tokenization, set to true if logs contains one log per record and multiline is not used. This will improve performance. |
1616
| `resource` | {} | A map of `key: value` pairs to add to the entry's resource. |
17-
| `add_attributes` | false | Adds `net.*` attributes according to [semantic convention][https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/span-general.md#general-network-connection-attributes]. |
17+
| `add_attributes` | false | Adds `net.*` attributes according to [semantic convention][https://github.com/open-telemetry/semantic-conventions/blob/main/docs/attributes-registry/network.md#network-attributes]. |
1818
| `multiline` | | A `multiline` configuration block. See below for details. |
1919
| `preserve_leading_whitespaces` | false | Whether to preserve leading whitespaces. |
2020
| `preserve_trailing_whitespaces` | false | Whether to preserve trailing whitespaces. |

pkg/translator/prometheus/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prometheus Normalization
22

3-
[OpenTelemetry's metric semantic convention](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/README.md) is not compatible with [Prometheus' own metrics naming convention](https://prometheus.io/docs/practices/naming/). This module provides centralized functions to convert OpenTelemetry metrics to Prometheus-compliant metrics. These functions are used by the following components for Prometheus:
3+
[OpenTelemetry's metric semantic convention](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/metrics.md) is not compatible with [Prometheus' own metrics naming convention](https://prometheus.io/docs/practices/naming/). This module provides centralized functions to convert OpenTelemetry metrics to Prometheus-compliant metrics. These functions are used by the following components for Prometheus:
44

55
* [prometheusreceiver](../../../receiver/prometheusreceiver/)
66
* [prometheusexporter](../../../exporter/prometheusexporter/)

pkg/translator/prometheus/normalize_name.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
// The map to translate OTLP units to Prometheus units
1515
// OTLP metrics use the c/s notation as specified at https://ucum.org/ucum.html
16-
// (See also https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/README.md#instrument-units)
16+
// (See also https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/metrics.md#instrument-units)
1717
// Prometheus best practices for units: https://prometheus.io/docs/practices/naming/#base-units
1818
// OpenMetrics specification for units: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#units-and-base-units
1919
var unitMap = map[string]string{

receiver/azureblobreceiver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<!-- end autogenerated section -->
1414

1515

16-
This receiver reads logs and trace data from [Azure Blob Storage](https://azure.microsoft.com/services/storage/blobs/).
16+
This receiver reads logs and trace data from [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs/).
1717

1818
## Configuration
1919

receiver/tcplogreceiver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Receives logs over TCP.
2424
| `attributes` | {} | A map of `key: value` pairs to add to the entry's attributes |
2525
| `one_log_per_packet` | false | Skip log tokenization, set to true if logs contains one log per record and multiline is not used. This will improve performance. |
2626
| `resource` | {} | A map of `key: value` pairs to add to the entry's resource |
27-
| `add_attributes` | false | Adds `net.*` attributes according to [semantic convention][https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/span-general.md#general-network-connection-attributes] |
27+
| `add_attributes` | false | Adds `net.*` attributes according to [semantic convention][https://github.com/open-telemetry/semantic-conventions/blob/main/docs/attributes-registry/network.md#network-attributes] |
2828
| `multiline` | | A `multiline` configuration block. See below for details |
2929
| `encoding` | `utf-8` | The encoding of the file being read. See the list of supported encodings below for available options |
3030
| `operators` | [] | An array of [operators](../../pkg/stanza/docs/operators/README.md#what-operators-are-available). See below for more details |

0 commit comments

Comments
 (0)