Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Introduce link checker job #2844

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/linkcheck.yml
@@ -0,0 +1,23 @@
name: Link checker

on:
pull_request:
# On every pull request
schedule:
- cron: '00 0 * * 1' # Every monday

jobs:
link-check:
runs-on: ubuntu-latest
name: Link checker
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: gaurav-nelson/github-action-markdown-link-check@v1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note) I am waiting gaurav-nelson/github-action-markdown-link-check#168 to be released
Otherwise, the GH action checks not only files in docs but also in module/docs/mdoc/~ which contains vairables in links.

with:
folder-path: 'docs' # comma separated
file-path: 'README.md,CODE_OF_CONDUCT.md' # comma separated
max-depth: 2
check-modified-files-only: ${{ github.ref_name == 'main' && 'no' || 'yes' }}
base-branch: main
5 changes: 2 additions & 3 deletions docs/running.md
Expand Up @@ -39,7 +39,7 @@ docker run -v $STEWARD_DIR:/opt/scala-steward -it fthomas/scala-steward:latest \
The [`git-ask-pass` option](https://git-scm.com/docs/gitcredentials) must specify an executable file (script) that returns (on the stdout),

- either the plain text password corresponding to the configured `${LOGIN}`,
- or (recommended) an authentication token corresponding to `${LOGIN}` (with appropriate permissions to watch the repositories; e.g. [Create a personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) for GitHub).
- or (recommended) an authentication token corresponding to `${LOGIN}` (with appropriate permissions to watch the repositories; e.g. [Create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for GitHub).

**Note about git-ask-pass option**: The provided script must start with a valid shebang like `#!/bin/sh`, see issue [#1374](https://github.com/scala-steward-org/scala-steward/issues/1374)

Expand Down Expand Up @@ -75,7 +75,7 @@ If your projects require credentials, you can also provide global credentials in
The file should contain a single line: `credentials += Credentials("Some Nexus Repository Manager", "my.artifact.repo.net", "admin", "admin123")`.

#### sbt 0.13 workaround
For sbt 0.13 builds, scala-steward [may be unable](https://gitter.im/fthomas/scala-steward?at=5f0573dac7d15f7d0f7b15ac) to extract credentials for private resolvers. Instead, you can [configure coursier directly](https://get-coursier.io/docs/other-credentials) by adding `~/.config/coursier/credentials.properties`:
For sbt 0.13 builds, scala-steward [may be unable](https://gitter.im/scala-steward-org/scala-steward?at=5f0573dac7d15f7d0f7b15ac) to extract credentials for private resolvers. Instead, you can [configure coursier directly](https://get-coursier.io/docs/other-credentials) by adding `~/.config/coursier/credentials.properties`:
```scala
example1.username=username
example1.password=password
Expand Down Expand Up @@ -191,7 +191,6 @@ pipelines:
There is multiple articles on how to run Scala Steward on-premise:

* [Running Scala Steward On-premise](https://engineering.avast.io/running-scala-steward-on-premise)
* [Running scala-steward periodically on AWS Fargate](https://medium.com/@tanishiking/running-scala-steward-periodically-on-aws-fargate-3d3d202f0f7)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blog appears to be gone.

* [Scala StewardとGitHub Actionsで依存ライブラリの更新を自動化する](https://scalapedia.com/articles/145/Scala+Steward%E3%81%A8GitHub+Actions%E3%81%A7%E4%BE%9D%E5%AD%98%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E3%81%AE%E6%9B%B4%E6%96%B0%E3%82%92%E8%87%AA%E5%8B%95%E5%8C%96%E3%81%99%E3%82%8B)
* [Centralized Scala Steward with GitHub Actions](https://hector.dev/2020/11/18/centralized-scala-steward-with-github-actions)
* [Big Timesavers for Busy Scala Developers](https://speakerdeck.com/exoego/big-timesavers-for-busy-scala-developers)
Expand Down
3 changes: 3 additions & 0 deletions docs/scalafix-migrations.md
Expand Up @@ -13,10 +13,13 @@ Here are two pull requests that demonstrate this feature:
And here are all pull requests where Scala Steward applied Scalafix
migrations:

<!-- These links exists but returns 404 often so skip check -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pulls URLs require that the user is logged into GitHub. I guess this is why they are reported as dead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, I see

<!-- markdown-link-check-disable -->
* [Created pull requests](https://github.com/search?q=author%3Ascala-steward+is%3Apr+scalafix-migrations)
([compact]( https://github.com/pulls?q=author%3Ascala-steward+is%3Apr+scalafix-migrations))
* [Merged pull requests]( https://github.com/search?q=author%3Ascala-steward+is%3Amerged+sort%3Aupdated-desc+scalafix-migrations)
([compact]( https://github.com/pulls?q=author%3Ascala-steward+is%3Amerged+sort%3Aupdated-desc+scalafix-migrations))
<!-- markdown-link-check-enable -->

## How does this work?

Expand Down
5 changes: 2 additions & 3 deletions modules/docs/mdoc/running.md
Expand Up @@ -39,7 +39,7 @@ docker run -v $STEWARD_DIR:/opt/scala-steward -it fthomas/scala-steward:latest \
The [`git-ask-pass` option](https://git-scm.com/docs/gitcredentials) must specify an executable file (script) that returns (on the stdout),

- either the plain text password corresponding to the configured `${LOGIN}`,
- or (recommended) an authentication token corresponding to `${LOGIN}` (with appropriate permissions to watch the repositories; e.g. [Create a personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) for GitHub).
- or (recommended) an authentication token corresponding to `${LOGIN}` (with appropriate permissions to watch the repositories; e.g. [Create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for GitHub).

**Note about git-ask-pass option**: The provided script must start with a valid shebang like `#!/bin/sh`, see issue [#1374](@GITHUB_URL@/issues/1374)

Expand Down Expand Up @@ -75,7 +75,7 @@ If your projects require credentials, you can also provide global credentials in
The file should contain a single line: `credentials += Credentials("Some Nexus Repository Manager", "my.artifact.repo.net", "admin", "admin123")`.

#### sbt 0.13 workaround
For sbt 0.13 builds, scala-steward [may be unable](https://gitter.im/fthomas/scala-steward?at=5f0573dac7d15f7d0f7b15ac) to extract credentials for private resolvers. Instead, you can [configure coursier directly](https://get-coursier.io/docs/other-credentials) by adding `~/.config/coursier/credentials.properties`:
For sbt 0.13 builds, scala-steward [may be unable](https://gitter.im/scala-steward-org/scala-steward?at=5f0573dac7d15f7d0f7b15ac) to extract credentials for private resolvers. Instead, you can [configure coursier directly](https://get-coursier.io/docs/other-credentials) by adding `~/.config/coursier/credentials.properties`:
```scala
example1.username=username
example1.password=password
Expand Down Expand Up @@ -191,7 +191,6 @@ pipelines:
There is multiple articles on how to run Scala Steward on-premise:

* [Running Scala Steward On-premise](https://engineering.avast.io/running-scala-steward-on-premise)
* [Running scala-steward periodically on AWS Fargate](https://medium.com/@tanishiking/running-scala-steward-periodically-on-aws-fargate-3d3d202f0f7)
* [Scala StewardとGitHub Actionsで依存ライブラリの更新を自動化する](https://scalapedia.com/articles/145/Scala+Steward%E3%81%A8GitHub+Actions%E3%81%A7%E4%BE%9D%E5%AD%98%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E3%81%AE%E6%9B%B4%E6%96%B0%E3%82%92%E8%87%AA%E5%8B%95%E5%8C%96%E3%81%99%E3%82%8B)
* [Centralized Scala Steward with GitHub Actions](https://hector.dev/2020/11/18/centralized-scala-steward-with-github-actions)
* [Big Timesavers for Busy Scala Developers](https://speakerdeck.com/exoego/big-timesavers-for-busy-scala-developers)
Expand Down
3 changes: 3 additions & 0 deletions modules/docs/mdoc/scalafix-migrations.md
Expand Up @@ -13,10 +13,13 @@ Here are two pull requests that demonstrate this feature:
And here are all pull requests where Scala Steward applied Scalafix
migrations:

<!-- These links exists but returns 404 often so skip check -->
<!-- markdown-link-check-disable -->
* [Created pull requests](https://github.com/search?q=author%3Ascala-steward+is%3Apr+scalafix-migrations)
([compact]( https://github.com/pulls?q=author%3Ascala-steward+is%3Apr+scalafix-migrations))
* [Merged pull requests]( https://github.com/search?q=author%3Ascala-steward+is%3Amerged+sort%3Aupdated-desc+scalafix-migrations)
([compact]( https://github.com/pulls?q=author%3Ascala-steward+is%3Amerged+sort%3Aupdated-desc+scalafix-migrations))
<!-- markdown-link-check-enable -->

## How does this work?

Expand Down