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

1.1.0 #18

Merged
merged 6 commits into from
Sep 24, 2024
Merged

1.1.0 #18

merged 6 commits into from
Sep 24, 2024

Conversation

manquer
Copy link
Contributor

@manquer manquer commented Sep 24, 2024

PR Type

enhancement, dependencies


Description

  • Updated the logic for exporting environment variables in src/env.ts and dist/index.js to use the correct variable.
  • Bumped several npm development dependencies to their latest versions:
    • @types/jest to 29.5.13
    • @types/lodash to 4.17.9
    • auto-changelog to 2.5.0
    • typescript to 5.6.2

Changes walkthrough 📝

Relevant files
Enhancement
env.ts
Update environment variable export logic                                 

src/env.ts

  • Updated the way environment variables are exported.
  • Changed the variable used in core.exportVariable.
  • +2/-1     
    index.js
    Update environment variable export logic                                 

    dist/index.js

  • Updated the way environment variables are exported.
  • Changed the variable used in core.exportVariable.
  • +2/-1     
    Dependencies
    package-lock.json
    Update npm development dependencies                                           

    package-lock.json

  • Updated @types/jest to version 29.5.13.
  • Updated @types/lodash to version 4.17.9.
  • Updated auto-changelog to version 2.5.0.
  • Updated typescript to version 5.6.2.
  • +422/-176
    package.json
    Update npm development dependencies                                           

    package.json

  • Updated @types/jest to version 29.5.13.
  • Updated @types/lodash to version 4.17.9.
  • Updated auto-changelog to version 2.5.0.
  • Updated typescript to version 5.5.4.
  • +4/-4     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    dependabot bot and others added 5 commits September 23, 2024 19:23
    Bumps the npm-development group with 4 updates: [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest), [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash), [auto-changelog](https://github.com/CookPete/auto-changelog) and [typescript](https://github.com/microsoft/TypeScript).
    
    
    Updates `@types/jest` from 29.5.12 to 29.5.13
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)
    
    Updates `@types/lodash` from 4.17.1 to 4.17.7
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)
    
    Updates `auto-changelog` from 2.4.0 to 2.5.0
    - [Changelog](https://github.com/cookpete/auto-changelog/blob/master/CHANGELOG.md)
    - [Commits](cookpete/auto-changelog@v2.4.0...v2.5.0)
    
    Updates `typescript` from 5.4.5 to 5.6.2
    - [Release notes](https://github.com/microsoft/TypeScript/releases)
    - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
    - [Commits](microsoft/TypeScript@v5.4.5...v5.6.2)
    
    ---
    updated-dependencies:
    - dependency-name: "@types/jest"
      dependency-type: direct:development
      update-type: version-update:semver-patch
      dependency-group: npm-development
    - dependency-name: "@types/lodash"
      dependency-type: direct:development
      update-type: version-update:semver-patch
      dependency-group: npm-development
    - dependency-name: auto-changelog
      dependency-type: direct:development
      update-type: version-update:semver-minor
      dependency-group: npm-development
    - dependency-name: typescript
      dependency-type: direct:development
      update-type: version-update:semver-minor
      dependency-group: npm-development
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.18.0 to 8.5.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.5.0/packages/eslint-plugin)
    
    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/eslint-plugin"
      dependency-type: direct:development
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.5.0 to 8.7.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.7.0/packages/eslint-plugin)
    
    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/eslint-plugin"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    @qodo-merge-pro qodo-merge-pro bot added Dependencies Project dependency updates, used by dependabot Enhancement Indicates enhancements to current features labels Sep 24, 2024
    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Possible Bug
    The change in how environment variables are exported might lead to unexpected behavior. The new code uses process.env[k] as the target, which could be undefined.

    Consistency Issue
    The changes in dist/index.js should be consistent with the changes in src/env.ts. Ensure that the compiled JavaScript correctly reflects the TypeScript changes.

    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Add a check for the existence of the target environment variable before exporting

    Consider checking if target is defined before using it in core.exportVariable. If
    process.env[k] is undefined, this could lead to unexpected behavior.

    src/env.ts [12-13]

    -const target = process.env[k]!
    -core.exportVariable(target, value)
    +const target = process.env[k]
    +if (target) {
    +  core.exportVariable(target, value)
    +} else {
    +  core.warning(`Environment variable ${k} not found`)
    +}
     
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: The suggestion addresses a potential issue where process.env[k] might be undefined, leading to unexpected behavior. Adding a check and warning improves the robustness of the code.

    9
    Best practice
    Remove the non-null assertion operator for safer type checking

    The use of the non-null assertion operator (!) on process.env[k] might be unsafe.
    Consider using a type guard or optional chaining instead.

    src/env.ts [12]

    -const target = process.env[k]!
    +const target = process.env[k]
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion improves code safety by removing the non-null assertion operator, which can lead to runtime errors if process.env[k] is undefined. Using safer type checking practices is recommended.

    8

    💡 Need additional feedback ? start a PR chat

    @manquer manquer merged commit dee8c77 into master Sep 24, 2024
    1 check passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Dependencies Project dependency updates, used by dependabot Enhancement Indicates enhancements to current features Review effort [1-5]: 2
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant