Closed achakote closed 3 months ago
If you choose markdown output, you will have access to it in the next step. Then, you can do whatever you want with this string. This is an example of how it might be used in the next step.
- name: Post comment
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2
with:
issue-number: 123
body: |
# 1/01/2023-31/01/2023
${{ steps.analytics.outputs.MARKDOWN }}
Thanks. Can I also add it as Step Summary?
edit. - Got it
@AlexSim93 I tried to echo "${{ steps.analytics.outputs.markdown }}" > report.md
file but getting below errors. What would be correct way to handle this?
/home/runner/work/_temp/5e2f1b8d-cc58-4e37-9eea-b09d3bd1da6b.sh: line 124: GITHUB_OWNER_FOR_ISSUE:: command not found
/home/runner/work/_temp/5e2f1b8d-cc58-4e37-9eea-b09d3bd1da6b.sh: line 125: GITHUB_REPO_FOR_ISSUE:: command not found
/home/runner/work/_temp/5e2f1b8d-cc58-4e37-9eea-b09d3bd1da6b.sh: line 126: SHOW_STATS_TYPES:: command not found```
Could you share your yaml-file without sensitive information of course? I'll try to check the same config in my project and explain it.
on:
workflow_dispatch:
inputs:
report_date_start:
description: "Report date start(d/MM/yyyy)"
required: false
report_date_end:
description: "Report date end(d/MM/yyyy)"
required: false
jobs:
create-report:
name: "Create report"
runs-on: "ubuntu-latest"
steps:
- name: "Run script for analytics"
uses: AlexSim93/pull-request-analytics-action@v3
with:
EXECUTION_OUTCOME: markdown
GITHUB_OWNER_FOR_ISSUE: owner
GITHUB_REPO_FOR_ISSUE: repo
GITHUB_TOKEN: ${{ secrets.TOKEN }}
GITHUB_OWNERS_REPOS: "owner/repo"
TIMEZONE: "Australia/Melbourne"
REPORT_DATE_START: ${{ inputs.report_date_start }}
REPORT_DATE_END: ${{ inputs.report_date_end }}```
- name: "Publish"
run: |
mkdir -p report
echo "${{ steps.analytics.outputs.markdown }}" > report/report.md
cat report/report.md > $GITHUB_STEP_SUMMARY
This config creates summary without errors
name: "Test action run"
on:
workflow_dispatch:
inputs:
report_date_start:
description: "Report date start(d/MM/yyyy)"
required: false
report_date_end:
description: "Report date end(d/MM/yyyy)"
required: false
jobs:
create-report:
name: "Create report"
runs-on: "ubuntu-latest"
steps:
- name: "Run script for analytics"
id: analytics
uses: AlexSim93/pull-request-analytics-action@v3
with:
EXECUTION_OUTCOME: markdown
GITHUB_TOKEN: ${{ secrets.YOUR_TOKEN }}
GITHUB_OWNERS_REPOS: "OWNER/REPO"
TIMEZONE: "Australia/Melbourne"
REPORT_DATE_START: ${{ inputs.report_date_start }}
REPORT_DATE_END: ${{ inputs.report_date_end }}
- name: "Publish"
run: |
mkdir -p report
echo "${{ steps.analytics.outputs.markdown }}" > report/report.md
cat report/report.md >> $GITHUB_STEP_SUMMARY
It generates step summary for me, but if you see carefully, its missing few things.
Do you see any errors in the log?
The report is generated successfully, except for a few points: charts and code blocks. Errors occur at the publish stage because the markdown contains content (charts, code blocks) that is processed in issues and comments but not supported in the summary.
Got it. Thanks.
Looks like a dumb question or my brain is not working :( , but after the run I can't see markdown generated. Where should i see it.
Run output -
I don't see anything on the run page.
Yaml-