Skip to content

Commit

Permalink
Pass number of commits through file
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 committed Oct 28, 2024
1 parent a4be693 commit 14d8722
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-upstream.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ workflow(
command = """
git clone --branch master --single-branch https://bitbucket.org/snakeyaml/snakeyaml-engine.git
cd snakeyaml-engine
NUMBER_OF_COMMITS=$(git log --oneline $(cat ../upstream-commit.txt)..master | wc -l)
git log --oneline $(cat ../upstream-commit.txt)..master | wc -l > number-of-commits.txt
""".trimIndent()
)
run(
name = "Create an SVG with the number of commits",
command = """
echo "<svg viewBox=\"0 0 240 80\" xmlns=\"http://www.w3.org/2000/svg\"><text x=\"20\" y=\"35\">${'$'}NUMBER_OF_COMMITS</text></svg>" > badge.svg
echo "<svg viewBox=\"0 0 240 80\" xmlns=\"http://www.w3.org/2000/svg\"><text x=\"20\" y=\"35\">${'$'}(cat number-of-commits.txt)</text></svg>" > badge.svg
""".trimIndent()
)
run(command = "cat badge.svg")
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
run: |-
git clone --branch master --single-branch https://bitbucket.org/snakeyaml/snakeyaml-engine.git
cd snakeyaml-engine
NUMBER_OF_COMMITS=$(git log --oneline $(cat ../upstream-commit.txt)..master | wc -l)
git log --oneline $(cat ../upstream-commit.txt)..master | wc -l > number-of-commits.txt
- id: 'step-2'
name: 'Create an SVG with the number of commits'
run: 'echo "<svg viewBox=\"0 0 240 80\" xmlns=\"http://www.w3.org/2000/svg\"><text x=\"20\" y=\"35\">$NUMBER_OF_COMMITS</text></svg>" > badge.svg'
run: 'echo "<svg viewBox=\"0 0 240 80\" xmlns=\"http://www.w3.org/2000/svg\"><text x=\"20\" y=\"35\">$(cat number-of-commits.txt)</text></svg>" > badge.svg'
- id: 'step-3'
run: 'cat badge.svg'

0 comments on commit 14d8722

Please sign in to comment.