Skip to content

Conversation

@skirkpatrickMSFT
Copy link
Collaborator

@skirkpatrickMSFT skirkpatrickMSFT commented Apr 29, 2025

🗣 Description

Currently we are having to manually check for version updates for our PowerShell dependencies.
This issue is to create a GitHub action to automatically bump our PowerShell dependency versions.
Since there is no dependabot for PowerShell this workflow has to be custom made.

This change implements a workflow for updating the MaximumVersion of all the modules in the PowerShell/ScubaGear/RequiredVersions.ps1 file. A new branch is created if an update is made to the ps1 file. Smoke Test passed, except for pnp module due to it not loading properly.

💭 Motivation and context

Closes 1096 https://github.com//issues/1096

🧪 Testing

My tests were successfull, yes anyone can test it. Forked main from CISA and updated files in the fork. Also created a branch and tested it there. Tested the workflows manually and then had them run automatically at midnight. Updates to the dependency files were made successfully in both cases. Ran ScubaGear after the changes were made, no issues seen. N/A

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • PR targets the correct parent branch (e.g., main or release-name) for merge.
  • Changes are limited to a single goal - eschew scope creep!
  • Changes are sized such that they do not touch excessive number of files.
  • All future TODOs are captured in issues, which are referenced in code comments.
  • These code changes follow the ScubaGear content style guide.
  • Related issues these changes resolve are linked preferably via closing keywords.
  • All relevant type-of-change labels added.
  • All relevant project fields are set.
  • All relevant repo and/or project documentation updated to reflect these changes.
  • Unit tests added/updated to cover PowerShell and Rego changes.
  • Functional tests added/updated to cover PowerShell and Rego changes.
  • All relevant functional tests passed.
  • All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.

✅ Pre-merge checklist

  • PR passed smoke test check.

  • Feature branch has been rebased against changes from parent branch, as needed

    Use Rebase branch button below or use this reference to rebase from the command line.

  • Resolved all merge conflicts on branch

  • Notified merge coordinator that PR is ready for merge via comment mention

  • Demonstrate changes to the team for questions and comments.
    (Note: Only required for issues of size Medium or larger)

✅ Post-merge checklist

  • Feature branch deleted after merge to clean up repository.
  • Verified that all checks pass on parent branch (e.g., main or release-name) after merge.

@skirkpatrickMSFT skirkpatrickMSFT self-assigned this Apr 29, 2025
@mitchelbaker-cisa mitchelbaker-cisa added this to the Nemo milestone May 1, 2025
Copy link
Collaborator

@buidav buidav left a comment

Choose a reason for hiding this comment

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

Looks good.
A couple of PS Linter errors to address.

Will approve after the liner errors are addressed. As a follow up to this PR:

  • Bump the PowerShell versions that need bumping. This workflow should take care of that just attach it to a PR.
  • Add in the code to create a Pull Request automatically https://github.com/cisagov/ScubaGear/blob/62202709b63d425fcb8ac7c79dcd5ff0f0e5d8a7/utils/workflow/Set-ScubaGearModuleVersion.psm1#L62

@skirkpatrickMSFT
Copy link
Collaborator Author

@buidav and @mitchelbaker-cisa This PR should be good to go now. I resolved the PS issues and updated the workflow to create a PR when it is successfully run.

@buidav buidav self-requested a review May 16, 2025 00:00
Copy link
Collaborator

@mitchelbaker-cisa mitchelbaker-cisa left a comment

Choose a reason for hiding this comment

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

Looks good!

@mitchelbaker-cisa mitchelbaker-cisa added the enhancement This issue or pull request will add new or improve existing functionality label Jun 10, 2025
@mitchelbaker-cisa mitchelbaker-cisa merged commit 1be731d into main Jun 10, 2025
22 checks passed
@mitchelbaker-cisa mitchelbaker-cisa deleted the 1096-bump-module-dependencies branch June 10, 2025 23:57
mitchelbaker-cisa pushed a commit that referenced this pull request Jun 16, 2025
* Create BumpPsDependencies.ps1

* Create ps_dependencies_requiredversionsfile.yaml

* Update RequiredVersions.ps1

* Update RequiredVersions.ps1

* Update RequiredVersions.ps1

* Update RequiredVersions.ps1

* Update ps_dependencies_requiredversionsfile.yaml

Add smoke test

* Update ps_dependencies_requiredversionsfile.yaml

* Update ps_dependencies_requiredversionsfile.yaml to add smoke test

* Update RequiredVersions.ps1 due to missing module info

* Update RequiredVersions.ps1

* Update BumpPsDependencies.ps1

* Update BumpPsDependencies.ps1 Updated Null

* Update BumpPsDependencies.ps1

* Update ps_dependencies_requiredversionsfile.yaml to add PR

* Update RequiredVersions.ps1

* Update ps_dependencies_requiredversionsfile.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This issue or pull request will add new or improve existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants