Skip to content

Commit 7991c63

Browse files
stasimussshevchenko
andauthored
Stop hardcoding a sha in the README (#7)
Co-authored-by: sshevchenko <sshevchenko@evolution.com>
1 parent e9f3a8d commit 7991c63

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,23 @@ on:
1919

2020
jobs:
2121
test:
22-
uses: evolution-gaming/scala-github-actions/.github/workflows/ci.yml@2a389d2a5f4b093e72f738464bd7472bd0c3b4b8 # v6
22+
uses: evolution-gaming/scala-github-actions/.github/workflows/ci.yml@<sha> # v6.2.0
2323
```
2424
2525
Nothing else is required if the project uses the defaults below.
2626
2727
Two things about that snippet are deliberate, both because SonarQube Cloud's quality gate rejects the
2828
alternatives and drops the security rating to C:
2929
30-
* the workflow is pinned to a **full commit SHA**, with the tag in a trailing comment. Resolve the
31-
current one with
32-
`gh api repos/evolution-gaming/scala-github-actions/git/ref/tags/v6 --jq .object.sha`.
30+
* the workflow is pinned to a **full commit SHA**, with the tag in a trailing comment. The snippet
31+
writes it as `<sha>` on purpose, so this README cannot go stale every time `v6` moves. Resolve the
32+
current value with:
33+
34+
```sh
35+
gh api repos/evolution-gaming/scala-github-actions/git/tags/$(
36+
gh api repos/evolution-gaming/scala-github-actions/git/ref/tags/v6 --jq .object.sha
37+
) --jq .object.sha
38+
```
3339
* there is **no `secrets: inherit`**. It is not needed — `GITHUB_TOKEN` is available to a called
3440
workflow automatically, and that is what the Coveralls upload uses. Only the optional Sonar scan
3541
needs a secret.
@@ -55,7 +61,7 @@ Example for a project without `sbt-version-policy` and on a different Scala set:
5561
```yaml
5662
jobs:
5763
test:
58-
uses: evolution-gaming/scala-github-actions/.github/workflows/ci.yml@2a389d2a5f4b093e72f738464bd7472bd0c3b4b8 # v6
64+
uses: evolution-gaming/scala-github-actions/.github/workflows/ci.yml@<sha> # v6.2.0
5965
with:
6066
scala_versions: '["2.13.18", "3.3.7"]'
6167
version_policy_check: false

0 commit comments

Comments
 (0)