canonical / solutions-engineering-automation

Repo for automating tasks for Solutions Engineering Team.
0 stars 4 forks source link

Update multi-line usage for results #13

Closed dashmage closed 4 months ago

dashmage commented 4 months ago

With the recent change to update the MM action usage, the results variable is not populated correctly as seen in this failed action run.

This is because writing an env var to GITHUB_ENV requires a different syntax if setting multiple lines as mentioned in the docs. This PR makes that change for the results env var.

dashmage commented 4 months ago

Note: I haven't tested this change out thoroughly since it's a lot of effort to fully replicate this setup on a test repo. So if you notice that something might be wrong, please let me know. Otherwise, we can check after it's merged and then make changes if necessary.

chanchiwai-ray commented 4 months ago

For reference, using the artifact from https://github.com/canonical/solutions-engineering-automation/actions/runs/8893565754:

I got this from the current implementation for GITHUB_ENV:

results=- [charm-advanced-routing (master, check.yaml)](https://test.org) :gh-success-octicon-checkcirclefillicon:
- [charm-apt-mirror (main, check.yaml)]() :gh-failure-octicon-xcirclefillicon:
- [charm-cloudsupport (main, check.yaml)]() :gh-failure-octicon-xcirclefillicon:

And I got this from the new implmementation for GITHUB_ENV:

results<<EOF
- [charm-advanced-routing (master, check.yaml)](https://test.org) :gh-success-octicon-checkcirclefillicon:
- [charm-apt-mirror (main, check.yaml)]() :gh-failure-octicon-xcirclefillicon:
- [charm-cloudsupport (main, check.yaml)]() :gh-failure-octicon-xcirclefillicon:
EOF
dashmage commented 4 months ago

I didn't realize we could trigger the workflow from the other branch also. Thanks for validating that the changes work!