Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Referencing PSRule main branch #212

Closed
Gordonby opened this issue Jan 31, 2023 · 3 comments
Closed

Referencing PSRule main branch #212

Gordonby opened this issue Jan 31, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@Gordonby
Copy link

Is your feature request related to a problem? Please describe.

The current PSRule release is 3 weeks old.
I wish to test a recent change in the main branch.

I tried using both of these syntaxes, however the first continued to reference 2.7.0 and the second failed. Apologies if this is documented somewhere that i didn't spot.

      - name: PSRule for Azure - Well Architected
        #uses: microsoft/ps-rule@v2.7.0
        uses: microsoft/ps-rule@main
        continue-on-error: true #Setting this whilst PSRule gets bedded in, in this project
        with:
          modules: 'PSRule.Rules.Azure'
          inputPath: "${{ env.ParamFilePath }}"
      - name: PSRule for Azure - Well Architected
        #uses: microsoft/ps-rule@v2.7.0
        uses: microsoft/ps-rule@main
        continue-on-error: true #Setting this whilst PSRule gets bedded in, in this project
        with:
          modules: 'PSRule.Rules.Azure'
          inputPath: "${{ env.ParamFilePath }}"
          version: 'main' #Assume this relates to the repo tag

Describe the solution you'd like

An easy way to use the version in main

Describe alternatives you've considered

None

Additional context

https://github.com/Azure/AKS-Construction/blob/gb-wellarchfixup/.github/workflows/ByoVnetCI.yml

@Gordonby Gordonby added the enhancement New feature or request label Jan 31, 2023
@BernieWhite
Copy link
Member

@Gordonby I might not be understanding the issue correctly so please correct me.


PSRule v2.7.0 is the latest version, and the GitHub Action microsoft/ps-rule@v2.7.0 should be installing PSRule v2.7.0 by default.

Using microsoft/ps-rule@main will also install PSRule v2.7.0 by default because no newer version is available.

The microsoft/ps-rule@main is the correct syntax to use the latest version of the GitHub Action. However, currently there is no difference between @main and v2.7.0 because they point to the same commit 1570d77.

If you would like to install a different PSRule version with the microsoft/ps-rule action you can specify the version: input parameter as you have done. The value of the version: parameter is the version of the PowerShell module you would like to install not the branch/ tag name, we can improve the documentation here.

For example, the following would use the latest action but install PSRule v1.11.1.

- name: Run PSRule analysis
  uses: microsoft/ps-rule@main
  with:
    version: '1.11.1'

See usage


So if you want to install latest stable version of everything just use:

      - name: PSRule for Azure - Well Architected
        uses: microsoft/ps-rule@main
        continue-on-error: true #Setting this whilst PSRule gets bedded in, in this project
        with:
          modules: 'PSRule.Rules.Azure'
          inputPath: "${{ env.ParamFilePath }}"

I hope that helps.

@BernieWhite BernieWhite added documentation Improvements or additions to documentation question Further information is requested and removed enhancement New feature or request labels Jan 31, 2023
@Gordonby
Copy link
Author

Gordonby commented Jan 31, 2023

Perhaps I'm conflating the 2 repos. #whoops

My aim is to test what was committed in this PR.
Azure/PSRule.Rules.Azure#2004

@BernieWhite
Copy link
Member

BernieWhite commented Jan 31, 2023

@Gordonby Sure no problem. You should get the latest version with the prerelease: true input parameter.

So try:

      - name: PSRule for Azure - Well Architected
        #uses: microsoft/ps-rule@v2.7.0
        uses: microsoft/ps-rule@main
        continue-on-error: true #Setting this whilst PSRule gets bedded in, in this project
        with:
          modules: 'PSRule.Rules.Azure'
          inputPath: "${{ env.ParamFilePath }}"
          prerelease: true

This should install the latest prerelease version PSRule for Azure which would be v1.24.0-B0035. Currently there isn't a way to target a specific prerelease for PSRule for Azure, but it shouldn't matter in the case :)

https://github.com/microsoft/ps-rule#prerelease

@microsoft microsoft locked and limited conversation to collaborators Jan 31, 2023
@BernieWhite BernieWhite converted this issue into discussion #213 Jan 31, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants