Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PSModule/GitHub-Script
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.4.4
Choose a base ref
...
head repository: PSModule/GitHub-Script
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 13 commits
  • 8 files changed
  • 3 contributors

Commits on Feb 22, 2025

  1. 🩹 [Patch]: Add try/finally blocks (#38)

    ## Description
    
    This pull request includes changes to the `action.yml` and the addition
    of a new script file to improve the robustness and cleanliness of the
    GitHub Action's execution.
    
    Improvements to GitHub Action execution:
    
    * `action.yml`: Modified the `run` block to include a `try` block for
    executing scripts and a `finally` block to ensure the cleanup script is
    always executed. This change enhances the robustness of the script
    execution.
    
    Addition of cleanup script:
    
    * `scripts/clean.ps1`: Added a new PowerShell script to handle cleanup
    tasks, including logging debug information and resetting environment
    variables. This ensures that the environment is properly cleaned up
    after the action runs.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Feb 22, 2025
    Configuration menu
    Copy the full SHA
    bbb4e4e View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2025

  1. 🩹 [Patch]: Fix gh auth status issue + add complex and actual use-ca…

    …se for `Set-GitHubOutput` (#41)
    
    ## Description
    
    This pull request includes significant updates to the
    `.github/workflows/TestWorkflow.yml` and `scripts/info.ps1` files to
    enhance the workflow and logging capabilities.
    
    Enhancements to `.github/workflows/TestWorkflow.yml`:
    
    * Added new outputs for `MatrixTest`, `ComplexArray`, and
    `ComplexArrayJson` to capture and utilize more detailed test results.
    * Introduced multiple `LogGroup` sections to improve the readability and
    organization of the workflow logs.
    * Added a new job `MatrixCreator` to dynamically create a matrix of test
    configurations and a dependent job `MatrixTest` to execute the tests
    based on the matrix.
    
    Enhancements to `scripts/info.ps1`:
    
    * Improved verbose logging to provide more detailed information about
    the authentication type and token status.
    * Added logic to preserve the original `$LASTEXITCODE` after checking
    the GitHub CLI authentication status.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Feb 25, 2025
    Configuration menu
    Copy the full SHA
    530913e View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2025

  1. 🩹 [Patch]: Update environment variable prefixes for GitHub script inp…

    …uts (#43)
    
    ## Description
    
    This pull request focuses on updating environment variable names across
    multiple scripts to ensure consistency and clarity. The changes involve
    renaming variables from `GITHUB_ACTION_INPUT_*` to
    `PSMODULE_GITHUB_SCRIPT_INPUT_*`. This is to reduce the change of
    clobbering the envvars for the GitHub-Script action. Aligns with a
    undocumented decision of having all inputs of actions and workflows as
    `<OWNER>_<REPO_NAME>_INPUT_*`.
    
    - Fixes #36 
    
    As this is internals of the action, this is deemed a patch update as
    nothing should rely on these variables apart from the scripts in the
    action.
    
    * Updated environment variable names in `action.yml` to use the
    `PSMODULE_GITHUB_SCRIPT_INPUT_*` prefix.
    * Modified `scripts/info.ps1` to reflect the new environment variable
    names for `ShowInfo`, `Token`, and `Debug` settings.
    [[1]](diffhunk://#diff-82c586f67d16e32953b47a962c269d0a484f8aa660d71ad354e91fd2d4334cd9L15-R16)
    [[2]](diffhunk://#diff-82c586f67d16e32953b47a962c269d0a484f8aa660d71ad354e91fd2d4334cd9L31-R35)
    [[3]](diffhunk://#diff-82c586f67d16e32953b47a962c269d0a484f8aa660d71ad354e91fd2d4334cd9L63-R64)
    * Adjusted `scripts/init.ps1` to use the updated environment variable
    names for `ShowInit`, `Version`, `Prerelease`, `Token`, `ClientID`, and
    `PrivateKey`.
    [[1]](diffhunk://#diff-f47ceebe9ade2bb55cede031de8267e9c87b09336a93fcd557c02c1f488554b6L13-R24)
    [[2]](diffhunk://#diff-f47ceebe9ade2bb55cede031de8267e9c87b09336a93fcd557c02c1f488554b6L76-R78)
    [[3]](diffhunk://#diff-f47ceebe9ade2bb55cede031de8267e9c87b09336a93fcd557c02c1f488554b6L96-R98)
    * Changed `scripts/outputs.ps1` to use the new environment variable name
    for `ShowOutput`.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Feb 27, 2025
    Configuration menu
    Copy the full SHA
    fe43ffe View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2025

  1. 🩹 [Patch]: Update scripts to output as strings (#44)

    ## Description
    
    This pull request includes changes to improve output formatting and
    enable ANSI output rendering, including adding `Out-String` to several
    `Format-*` cmdlets and setting `OutputRendering` to 'Ansi'. This is to
    avoid table and list output to wrap or cut of text.
    
    ### Improvements to output formatting:
    
    * `scripts/info.ps1`:
    * Added `Out-String` to the output of `Format-Table` and `Format-List`
    cmdlets.
    * `scripts/init.ps1`:
      * Added `Out-String` to the output of `Format-List` cmdlets.
    * Set `$PSStyle.OutputRendering` to 'Ansi' to enable ANSI output
    rendering.
    * `tests/info.ps1`:
      * Added `Out-String` to the output of `Format-List` cmdlets.
    
    ### Enabling ANSI output rendering:
    
    * `scripts/outputs.ps1`:
    * Modified the script to use `Out-String` for output formatting and
    added a loop to log each output property with ANSI color styling.
    
    ### Tests
    * `.github/workflows/TestWorkflow.yml`:
    * Enabled ANSI output rendering and used `Out-String` to format various
    outputs in multiple sections, including `Result - Json`, `Result -
    Object`, `Context`, `GitConfig`, `WISECAT`, and `Get-GitHubUser`.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Mar 1, 2025
    Configuration menu
    Copy the full SHA
    7f22b12 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2025

  1. 🩹 [Patch]: Update default values for WorkingDirectory to be '.' (#45)

    ## Description
    
    This pull request includes updates to the default values for the
    `WorkingDirectory` input in both the `README.md` and `action.yml` files.
    These changes ensure consistency in the default working directory for
    the script.
    
    Documentation updates:
    
    *
    [`README.md`](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L24-R24):
    Updated the default value for the `WorkingDirectory` input from `${{
    github.workspace }}` to `'.'`.
    
    Configuration updates:
    
    *
    [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L52-R52):
    Updated the default value for the `WorkingDirectory` input from `${{
    github.workspace }}` to `'.'`.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Mar 9, 2025
    Configuration menu
    Copy the full SHA
    3dd6874 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2025

  1. 🩹 [Patch]: Enable reinstall of modules to ensure the correct version …

    …of `GitHub` is installed (#46)
    
    ## Description
    
    This pull request includes a small change to the `scripts/init.ps1`
    file. The change adds two new parameters, `Reinstall` and
    `WarningAction`, to the process block to ensure that the module is
    reinstalled and warnings are suppressed.
    
    - Fixes #40 
    
    Changes in `process {` in file `scripts/init.ps1`:
    
    * Added `Reinstall` parameter set to `true`.
    * Added `WarningAction` parameter set to `'SilentlyContinue'`.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Mar 20, 2025
    Configuration menu
    Copy the full SHA
    ab5198a View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2025

  1. 🚀 [Feature]: Add 'Name' input (#47)

    ## Description
    
    This pull request introduces a new input parameter, `Name`, to the
    GitHub PowerShell-based action, allowing customization of the action's
    name.
    
    ### Integration of `Name` parameter:
    
    Workflow Configuration:
    *
    [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR144):
    Added `Name: Action-Test` to the action inputs.
    
    Documentation:
    *
    [`README.md`](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R13):
    Documented the new `Name` parameter in the table of action inputs.
    
    Action Definition:
    *
    [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R9-R12):
    Added the `Name` input parameter with a default value of
    `GitHub-Script`.
    *
    [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R71):
    Included `PSMODULE_GITHUB_SCRIPT_INPUT_Name` in the environment
    variables passed to the script.
    
    Script Updates:
    *
    [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L78-R83):
    Updated the script execution section to use the `Name` parameter.
    *
    [`scripts/info.ps1`](diffhunk://#diff-82c586f67d16e32953b47a962c269d0a484f8aa660d71ad354e91fd2d4334cd9L13-R13):
    Replaced the hardcoded `fenceTitle` with the `Name` parameter.
    *
    [`scripts/init.ps1`](diffhunk://#diff-f47ceebe9ade2bb55cede031de8267e9c87b09336a93fcd557c02c1f488554b6L13-R13):
    Replaced the hardcoded `fenceTitle` with the `Name` parameter.
    *
    [`scripts/outputs.ps1`](diffhunk://#diff-ee715ca93229232e95883bf00629fd14e3bf174cdc17b723c4cc5d70e6a60a58L12-R12):
    Replaced the hardcoded `fenceTitle` with the `Name` parameter.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [ ] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] I have performed a self-review of my own code
    - [ ] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Mar 23, 2025
    Configuration menu
    Copy the full SHA
    e099f88 View commit details
    Browse the repository at this point in the history
  2. 🩹 [Patch]: Update Action name to be that of the Name input (#48)

    ## Description
    
    This pull request includes updates to the `action.yml` file to improve
    the flexibility and customization of the GitHub Action. The most
    important changes are:
    
    Customization improvements:
    
    *
    [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L12-R12):
    Changed the default value of the `Name` input from a string with quotes
    to a plain string to ensure consistency.
    *
    [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L66-R66):
    Updated the step name to use the `Name` input dynamically, allowing for
    more customizable action names.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Mar 23, 2025
    Configuration menu
    Copy the full SHA
    23bc6b9 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2025

  1. 🚀 [Feature]: Configure PowerShell ErrorView settings (#49)

    ## 🚀 New Feature: `ErrorView` Configuration
    
    This release introduces a new feature to configure the PowerShell
    `$ErrorView` variable in the GitHub Action. This also sets the default
    to `NormalView` whereas the default in PowerShell is `ConciseView`.
    `NormalView` provides more information that would be great to get when
    troubleshooting errors in GitHub workflows. Users can still override
    this by adding their own settings in the provided script or using the
    input to set a different value when building actions or workflows.
    
    #### Details
    
    * Introduced the `ErrorView` input in `action.yml`, including its
    description, default value (`'NormalView'`), and marking it as optional.
    * The input is mapped to the new environment variable
    `PSMODULE_GITHUB_SCRIPT_INPUT_ErrorView` in the `action.yml` file.
    * The environment variable is validated using wildcard matching against
    a predefined list of valid views, applies the matched view setting.
    * Added a description for the new `ErrorView` option in the `README.md`
    file. This option allows users to configure the `$ErrorView` variable
    using full or partial names of valid views.
    MariusStorhaug authored Apr 26, 2025
    Configuration menu
    Copy the full SHA
    d5ee054 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2025

  1. 🩹 [Patch]: Add tests for logging commands for GitHub Actions workflow (

    …#51)
    
    ## Description
    
    This pull request adds tests various log functions that work in GitHub
    Actions.
    
    Logging enhancements:
    
    *
    [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR157-R166):
    Added some tests to show how log notices, warnings, errors, debug
    messages, and styled log messages with foreground and background colors
    work.
    MariusStorhaug authored May 31, 2025
    Configuration menu
    Copy the full SHA
    417cef9 View commit details
    Browse the repository at this point in the history
  2. 🚀[Feature]: Control if GitHub credentials are persisted (#50)

    You now have the option to decide if your GitHub credentials should be
    kept or automatically disconnected after the script finishes. This gives
    you more flexibility and helps improve security when needed.
    
    ### How It Works
    
    * **By default**, your GitHub credentials will be preserved, just like
    before—no changes needed on your part.
    * **If you want your credentials to be automatically disconnected after
    the script runs**, set the new `PreserveCredentials` option to `false`.
    
    ### Example
    
    Here’s how to disconnect your credentials after running a script:
    
    ```yaml
    - name: Run script with credential cleanup
      uses: PSModule/GitHub-Script@v1
      with:
        PreserveCredentials: false
        Script: |
          Get-GitHubUser
          # Your credentials will be disconnected after this step
    ```
    
    That’s it! Use this new option if you want to make sure your GitHub
    connection is cleaned up automatically after your workflow.
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
    Co-authored-by: Marius Storhaug <marstor@hotmail.com>
    3 people authored May 31, 2025
    Configuration menu
    Copy the full SHA
    b5ebe75 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2025

  1. 🩹 [Patch]: Updated the org level login test with quotes (#52)

    ## Description
    
    This pull request updates the `TestWorkflow.yml` file to test quoted
    inputs for GitHub App secrets and adjusts the job name to reflect this
    change.
    
    Workflow updates:
    
    *
    [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL472-R472):
    Updated the `name` field of the `ActionTestWithGitHubAppOrg` job to
    include "quoted inputs" for clarity.
    *
    [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL482-R483):
    Modified the `ClientID` and `PrivateKey` inputs in the `Action-Test`
    step to use quoted syntax for testing purposes.
    MariusStorhaug authored Jun 4, 2025
    Configuration menu
    Copy the full SHA
    1e8d9ba View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2025

  1. 🪲 [Fix]: Fix setting the $ErrorView setting via inputs (#53)

    This pull request introduces changes related to the handling of the
    `ErrorView` configuration in a GitHub Actions workflow. The changes
    streamline the `ErrorView` initialization logic by removing redundant
    code and adding validation to ensure `ErrorView` is set correctly during
    runtime.
    
    ### Changes to `ErrorView` handling:
    
    *
    [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR228-R233):
    Added a validation step to confirm that `ErrorView` is set to
    `'NormalView'` during the workflow execution. If not, an exception is
    thrown.
    *
    [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R94):
    Introduced the assignment of the `ErrorView` environment variable from
    the input parameter for use in subsequent scripts.
    *
    [`scripts/init.ps1`](diffhunk://#diff-f47ceebe9ade2bb55cede031de8267e9c87b09336a93fcd557c02c1f488554b6L7-L23):
    Removed the redundant initialization and validation logic for
    `ErrorView`, as this is now handled directly in the workflow and action
    configuration.
    MariusStorhaug authored Jun 16, 2025
    Configuration menu
    Copy the full SHA
    4463abf View commit details
    Browse the repository at this point in the history
Loading