runner
runner copied to clipboard
Annotations from composite actions are not correctly created
Describe the bug Only a single annotation gets created in composite actions. Every single annotation (error, warning, notice) with the exception of the last one gets ignored
To Reproduce
Steps to reproduce the behavior:
- Create a simple composite actions that generates annotations
name: 'Annotation example'
description: Test annotations
runs:
using: "composite"
steps:
- run: echo Hello there once!
shell: bash
- name: Testing the Error Workflow Command
run: echo "::error::Testing error"
shell: bash
- run: echo Hello there
shell: bash
- name: Testing the Error Workflow Command
run: echo "::error::Testing error"
shell: bash
- name: Testing the Error Workflow Command
run: echo "::warning::Testing warning"
shell: bash
- name: Testing the Error Workflow Command
run: echo "::notice::Testing notice"
shell: bash
- Run the workflow from another repository (or locally)
Expected behavior Every single annotation gets created.
Runner Version and Platform
Version of your runner? 2.288.1
Tested using Linux but probably busted for everything
What's not working?
Here is an example run: https://github.com/konradpabjan/Testing2/actions/runs/1958916121
Currently at most only one gets created and it's always the last one
Job Log Output
☝️ Only the notice annotations is created while the other annotations do not show up. In the logs though the behavior is expected
Runner and Worker's Diagnostic Logs
Not provided since I used hosted for testing, but it should be easy to get with the repro
HI @konradpabjan, Thanks for filing this issue! I am reproducing it now and I will get back to you as soon as possible!
Resolved by https://github.com/actions/runner/pull/2116
I know it might be strange to ask, but I have found the issue what I do not want to be fixed. This issue is the same but only for the same type of the print:
runs:
using: "composite"
steps:
- shell: bash
run: echo "::notice::111"
- shell: bash
run: echo "::notice::222"
- shell: bash
run: echo "::notice::333"
Only the last 333
does show as an annotation.
The reason is that, I have found the case where it can be used for prints patching at the last always executed step.
To do so I use buffering to reprint all annotations at the end of the composite action:
- name: flush print annotations
if: always()
shell: bash
run: |
.../flush-print-annotations.sh
If the only last step does the annotation print, then I can go and patch the buffer for links like:
github.com/OWNER/REPO/tree/master/...
by github.com/OWNER/REPO/tree/COMMIT_HASH/...
- name: flush print annotations
if: always()
shell: bash
run: |
.../patch-print-annotations.sh
.../flush-print-annotations.sh
Because COMMIT_HASH
becomes known not immediately and half of the links to a repo can be printed from a script when script does not know about COMMIT_HASH
yet. In other words such behaviour is good for annotations patching or detailing.
@konradpabjan @thboop Are you seeing this as resolved? I am still seeing the issue where only the last annotation gets printed. I am using a self-hosted runner in case that matters.
I can provide steps to reproduce if needed.
@andry81 fyi ... A fix is planned for the bug described here.
see https://github.com/actions/runner/pull/2311
@andry81 fyi ... A fix is planned for the bug described here.
see #2311
@jww3 Does that mean the fix will destroy the annotations patch feature?
@andry81 I believe the behavior you're describing was a side-effect of the bug and not an actual feature.
All PRs have been merged. I've verified the original bug as reported is now fixed.