-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41b85a9
commit ce630bc
Showing
9 changed files
with
1,230 additions
and
1,060 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Regular badging sequence | ||
description: Publishes a badge based on the job status | ||
inputs: | ||
category: | ||
description: The subfolder where to group the badges | ||
required: true | ||
badges: | ||
description: A json object of label => status for all badges | ||
required: true | ||
github_token: | ||
description: The token to use to publish the changes | ||
required: false | ||
default: ${{ github.token }} | ||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
node ./.github/actions/badge/write-json-object.js ${{ inputs.category }} '${{ inputs.badges }}' | ||
shell: bash | ||
- uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ inputs.github_token }} | ||
publish_branch: badges | ||
publish_dir: ./badges | ||
keep_files: true | ||
user_name: "github-actions[bot]" | ||
user_email: "github-actions[bot]@users.noreply.github.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const fs = require('fs'); | ||
const category = process.argv[2]; | ||
const status = JSON.parse(process.argv[3]); | ||
|
||
if (!fs.existsSync("./badges")) fs.mkdirSync("./badges"); | ||
if (!fs.existsSync("./badges/" + category)) fs.mkdirSync("./badges/" + category); | ||
for (let e in status) { | ||
const path = "./badges/" + category + "/" + e; | ||
if (!fs.existsSync(path)) fs.mkdirSync(path); | ||
const ok = status[e] == "success"; | ||
fs.writeFileSync(path + "/shields.json", JSON.stringify({ | ||
"schemaVersion": 1, | ||
"label": e, | ||
"message": ok ? "Passing" : "Failing", | ||
"color": ok ? "brightgreen" : "red" | ||
})); | ||
} | ||
|
Oops, something went wrong.