Skip to content

Commit 98695e8

Browse files
authored
OPS 52 fix reporting (#146)
* Fixed monthly reporting * Fixed wrong secret * Handle missing approver
1 parent e4a12ba commit 98695e8

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

.github/actions/generate-jira-pr-report/scripts/generate-jira-pr-report.bash

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,10 @@ main()
7979
echo ${sha} | tr '\n' ',' >> ${SOURCE_REPORT_FILE}
8080
echo ${date} | tr '\n' ',' >> ${SOURCE_REPORT_FILE}
8181

82-
jq -r '.[].git_commit_info.author' ${SOURCE_REPORT_DIR}/${sha}/pull-request.json | tr '\n' ',' >> ${SOURCE_REPORT_FILE}
83-
jq -r '.[].pull_requests[].approvers[]' ${SOURCE_REPORT_DIR}/${sha}/pull-request.json | uniq | tr '\n' ',' >> ${SOURCE_REPORT_FILE}
84-
85-
jq -r '.[] | .jira_results[] | select(.issue_exists == true) | .issue_id' ${SOURCE_REPORT_DIR}/${sha}/work-reference.json | tr '\n' ',' >> ${SOURCE_REPORT_FILE}
86-
82+
jq -r '[.[].git_commit_info.author] | join(",") + ","' ${SOURCE_REPORT_DIR}/${sha}/pull-request.json | tr -d '\n' >> ${SOURCE_REPORT_FILE}
83+
jq -r '[.[].pull_requests[].approvers[]] | unique | join(",") + ","' ${SOURCE_REPORT_DIR}/${sha}/pull-request.json | tr -d '\n' >> ${SOURCE_REPORT_FILE}
84+
jq -r '[.[] | .jira_results[] | select(.issue_exists == true) | .issue_id] | join(",") + ","' ${SOURCE_REPORT_DIR}/${sha}/work-reference.json | tr -d '\n' >> ${SOURCE_REPORT_FILE}
85+
8786
echo >> ${SOURCE_REPORT_FILE}
8887
done <<< "$commits"
8988
}

.github/actions/generate-periodic-reports/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ runs:
4848
4949
- name: Generate Jira PR report
5050
id: jira-pr-report
51-
uses: ./.github/actions/generate-jira-pr-report@main
51+
uses: ./.github/actions/generate-jira-pr-report
5252
with:
5353
result-dir: /tmp/audit-reports
5454
kosli-source-flow: ${{ inputs.kosli-source-flow }}

.github/workflows/generate-monthly-reports.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
env:
1616
KOSLI_ORG: "${{ vars.KOSLI_ORG }}"
17-
KOSLI_API_TOKEN: "${{ secrets.KOSLI_API_TOKEN }}"
17+
KOSLI_API_TOKEN: "${{ secrets.KOSLI_PUBLIC_API_TOKEN }}"
1818
KOSLI_CLI_VERSION: "${{ vars.KOSLI_CLI_VERSION }}"
1919

2020

@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Generate reports
3434
id: generate-periodic-reports
35-
uses: ./.github/actions/generate-periodic-reports@main
35+
uses: ./.github/actions/generate-periodic-reports
3636
with:
3737
start-date: ${{ github.event.inputs.start-date }}
3838
end-date: ${{ github.event.inputs.end-date }}

0 commit comments

Comments
 (0)