Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jun 2, 2025

Description

This pull request includes updates to the workflow files to improve clarity and functionality. The changes primarily focus on refining conditional logic in PowerShell scripts and enhancing environment variable handling in GitHub Actions.

Workflow improvements:

  • .github/workflows/Get-Settings.yml: Updated the conditional logic for determining the $name variable to use explicit if-elseif-else statements, improving readability and maintainability.

Environment variable and input adjustments:

  • .github/workflows/workflow.yml: Added the GH_TOKEN environment variable to the Publish module step to ensure authentication is handled securely.
  • .github/workflows/workflow.yml: Reintroduced the WorkingDirectory input to the Publish module step for better modularity and flexibility in specifying paths.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Copilot AI review requested due to automatic review settings June 2, 2025 01:10
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner June 2, 2025 01:10
@MariusStorhaug MariusStorhaug self-assigned this Jun 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the GitHub Actions workflow for publishing the PowerShell module by adding proper authentication and simplifying inputs.

  • Adds a GitHub token environment variable (GH_TOKEN) for authentication
  • Removes unused inputs (Debug, Prerelease, Verbose, Version)
  • Introduces a WorkingDirectory input to explicitly set the module path
Comments suppressed due to low confidence (2)

.github/workflows/workflow.yml:290

  • The github.token context isn't available in workflows. Use secrets.GITHUB_TOKEN instead (e.g., GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}) to ensure the token is loaded correctly.
GH_TOKEN: ${{ github.token }}

.github/workflows/workflow.yml:305

  • Verify that WorkingDirectory is defined under on.workflow_dispatch.inputs or given a default value, so the workflow won't fail if this input is omitted.
WorkingDirectory: ${{ inputs.WorkingDirectory }}

@MariusStorhaug MariusStorhaug changed the title 🪲 [Fix]: Access to GH_TOKEN 🪲 [Fix]: Access to GH_TOKEN and Get-Settings for Name Jun 2, 2025
@MariusStorhaug MariusStorhaug merged commit f1008b1 into main Jun 2, 2025
100 checks passed
@MariusStorhaug MariusStorhaug deleted the fixtoken branch June 2, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants