Skip to content

Commit

Permalink
decorate
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 22, 2024
1 parent 6a5cc61 commit 18595b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
8 changes: 0 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ runs:

### Start ###
### PREPARE ENVIRONMENT and VARIABLES ###

- uses: credfeto/[email protected]
id: visibility

Expand Down Expand Up @@ -63,17 +62,13 @@ runs:
run: |
git config remote.origin.prune true && git fetch
echo CIU_ACTIVE_BRANCHES=`git branch -r | grep -v HEAD | sed 's/origin\///' | tr '\n' ' '` >> "$GITHUB_ENV"
### End ###
### PREPARE ENVIRONMENT and VARIABLES ###



### Start ###
### PUBLISHING ###


# Publish the score
# Will create a new type if not exists for metric.
# If type exists, then it will use the existing metric and ignore the metric passed
- name: Publish this output and update branches
Expand Down Expand Up @@ -118,14 +113,12 @@ runs:
with:
issue-number: ${{ steps.find-pull-request.outputs.number }}
body-path: comment_body.txt

### END ###
### PUBLISHING ###


### Start ###
### Compliance ###

# Destroy everything or just by the type
# if type is empty then it will destroy everything
- name: Destroy everything that was ever published
Expand All @@ -143,6 +136,5 @@ runs:
"commit": "${{ github.sha }}"
}' \
"${{inputs.host}}/destroy"
### End ###
### Compliance ###
5 changes: 3 additions & 2 deletions app/pkg/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (p *PR) Get(req *PRRequest, types []models.Type) (string, error) {
for _, t := range types {
y := make([]float64, 2)
row := make([]string, 3)
row[0] = t.Name
row[0] = "*" + t.Name + "*"

sb, err := p.coverageModel.GetLatestBranchScore(req.Org, req.Repo, req.BaseBranch, t.Name)
if err != nil {
Expand All @@ -55,6 +55,7 @@ func (p *PR) Get(req *PRRequest, types []models.Type) (string, error) {
} else {
y[1] = s.Score
row[2] = F64NumberToK(&s.Score) + " " + t.Metric + p.UpOrDown(&sb.Score, &s.Score)
row[2] = "**" + row[2] + "**"
}
mdTable.Rows = append(mdTable.Rows, row)

Expand Down Expand Up @@ -90,7 +91,7 @@ func (p *PR) Get(req *PRRequest, types []models.Type) (string, error) {
mdText.PlainText("")
readmeLink := fmt.Sprintf("%s://%s/readme?org=%s&repo=%s&branch=%s",
req.scheme, req.host, req.Org, req.Repo, req.Branch)
mdText.PlainTextf(md.Link("Add to Readme", readmeLink))
mdText.PlainTextf(md.Link("Add Badges and Charts to Readme", readmeLink))

return mdText.String(), nil
}
Expand Down

0 comments on commit 18595b8

Please sign in to comment.