Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(logger): add GHA-aware notices/warnings #557

Merged
merged 6 commits into from
Aug 1, 2022

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Aug 1, 2022

🚥 Fix RM-4986

🧰 Changes

Added some context-aware logging for notices and warnings (we were previously only doing this for if rdme would error out). This will surface certain logs for the user more nicely when it's being run in a GitHub Actions environment. We'll need this for the work in RM-4984.

I also added ci-detect into the mix since we will also need that for RM-4984 and it feels a little less hairy to do our CI detection checks this way.

🧬 QA & Testing

I tested out the annotations and confirmed that they show up! You can check it out here: https://github.com/readmeio/rdme/actions/runs/2778155329

@kanadgupta kanadgupta added enhancement New feature or request command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands labels Aug 1, 2022
@@ -9,6 +9,7 @@ describe('#fetch()', () => {
// List of all GitHub Actions env variables:
// https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
beforeEach(() => {
process.env.GITHUB_ACTION = '__repo-owner_name-of-action-repo';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to further simulate a GHA environment in our tests since this is the variable that ci-detect uses.

@kanadgupta kanadgupta requested a review from erunion August 1, 2022 22:12
@kanadgupta kanadgupta marked this pull request as ready for review August 1, 2022 22:12
@kanadgupta kanadgupta merged commit 3fc41e6 into main Aug 1, 2022
@kanadgupta kanadgupta deleted the kanad/rm-4986-surface-warnings-in-github-actions branch August 1, 2022 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants