kubestellar / kubestellar

KubeStellar - a flexible solution for challenges associated with multi-cluster configuration management for edge, multi-cloud, and hybrid cloud
https://kubestellar.io
Apache License 2.0
231 stars 56 forks source link

Broken links crawler workflow complaining about main #2203

Open MikeSpreitzer opened 1 week ago

MikeSpreitzer commented 1 week ago

The GitHub Actions Workflow named "Broken Links Crawler" is sometimes running with "main" as the git reference and producing complaints about references to https://docs.kubestellar.io/main (but does not mention where the references are from).

See https://github.com/kubestellar/kubestellar/actions/workflows/broken-links-crawler.yml

MikeSpreitzer commented 1 week ago

Here is one example: https://github.com/kubestellar/kubestellar/actions/runs/9503653654

It appears to have been triggered by https://github.com/kubestellar/kubestellar/actions/runs/9503641392 (an instance of https://github.com/kubestellar/kubestellar/actions/runs/9503641392/workflow) --- which I invoked on release-0.23.0-rc2.

One mystery is: why did the ${{ github.ref_name }} at https://github.com/kubestellar/kubestellar/actions/runs/9503653654/workflow#L2 evaluate to "main"? Note that there are actually multiple branches and tag that point to the same commit:

mspreitz@mjs13 kubestellar % git log
commit 14831f4ae27807c7cf1c115b2d5f2076738e63d6 (HEAD -> release-0.23.0-rc2, tag: v0.23.0-rc2, upstream/release-0.23.0-rc2, upstream/main, origin/main, origin/HEAD, main)
...

https://docs.github.com/en/actions/learn-github-actions/contexts#github-context says about github.ref_name:

The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1.

The choice of "main" ran through https://github.com/kubestellar/kubestellar/actions/runs/9503653654/workflow#L31 . https://docs.github.com/en/actions/learn-github-actions/variables describes GITHUB_REF, and in a way that does not clearly prescribe what should happen in this case.

https://github.com/kubestellar/kubestellar/actions/runs/9503653654/workflow#L42-L43 completes the construction, apparently directing the checker to the branch determined above ("main").


In contrast, https://github.com/kubestellar/kubestellar/actions/runs/9504348671 (which was manually invoked citing branch release-0.23.0-rc2) examined the right version (and found no problem).

MikeSpreitzer commented 1 week ago

So I think that the way to get the Broken Links Crawler workflow to work on the right version is to have the Generate and push docs workflow somehow output the github ref that it is working on and make the Broken Links Crawler workflow read that to find out which version to work on.