Skip to content

Commit

Permalink
Updated pipeline files to support renaming default branch to main (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored Oct 6, 2024
1 parent 7b635dd commit 61e94a1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 29 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ and [#9](https://github.com/dsccommunity/DscResource.AnalyzerRules/issues/9).
- `Get-TokensFromDefinition.ps1`
- Remove unused variable.

### Changed

- Renamed default branch to `main`. Fixes [#12](https://github.com/dsccommunity/DscResource.AnalyzerRules/issues/22).

## [0.2.0] - 2019-11-21

- Fix issue with DSC composite resources.
Expand Down
23 changes: 6 additions & 17 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,22 @@ patch-version-bump-message: '\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'
assembly-informational-format: '{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}'
branches:
master:
main:
tag: preview
regex: ^main$
pull-request:
tag: PR
feature:
tag: useBranchName
increment: Minor
regex: f(eature(s)?)?[/-]
source-branches: ['master']
regex: f(eature(s)?)?[\/-]
source-branches: ['main']
hotfix:
tag: fix
increment: Patch
regex: (hot)?fix(es)?[/-]
source-branches: ['master']
regex: (hot)?fix(es)?[\/-]
source-branches: ['main']

ignore:
sha: []
merge-message-formats: {}


# feature:
# tag: useBranchName
# increment: Minor
# regex: f(eature(s)?)?[/-]
# source-branches: ['master']
# hotfix:
# tag: fix
# increment: Patch
# regex: (hot)?fix(es)?[/-]
# source-branches: ['master']
6 changes: 3 additions & 3 deletions Source/DscResource.AnalyzerRules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ PrivateData = @{
Tags = @('PSScriptAnalyzer','PSSA','Analyzer','AnalyzerRules','DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource','Windows','MacOS','Linux')

# A URL to the license for this module.
# LicenseUri = ''
LicenseUri = 'https://github.com/dsccommunity/DscResource.AnalyzerRules/blob/main/LICENSE'

# A URL to the main website for this project.
# ProjectUri = ''
ProjectUri = 'https://github.com/dsccommunity/DscResource.AnalyzerRules'

# A URL to an icon representing this module.
# IconUri = ''
IconUri = 'https://dsccommunity.org/images/DSC_Logo_300p.png'

Prerelease = ''

Expand Down
5 changes: 0 additions & 5 deletions Source/build.psd1

This file was deleted.

6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
trigger:
branches:
include:
- master
- main
paths:
include:
- source/*
Expand All @@ -15,7 +15,7 @@ variables:
buildArtifactName: output
testResultFolderName: testResults
testArtifactName: testResults
defaultBranch: master
defaultBranch: main

stages:
- stage: Build
Expand Down Expand Up @@ -257,7 +257,7 @@ stages:
and(
succeeded(),
or(
eq(variables['Build.SourceBranch'], 'refs/heads/master'),
eq(variables['Build.SourceBranch'], 'refs/heads/main'),
startsWith(variables['Build.SourceBranch'], 'refs/tags/')
)
)
Expand Down
2 changes: 1 addition & 1 deletion tests/QA/module.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Describe 'Changelog Management' -Tag 'Changelog' {
) {
# Get the list of changed files compared with branch main
$HeadCommit = &git rev-parse HEAD
$defaultBranchCommit = &git rev-parse origin/master
$defaultBranchCommit = &git rev-parse origin/main
$filesChanged = &git @('diff', "$defaultBranchCommit...$HeadCommit", '--name-only')

if($HeadCommit -ne $defaultBranchCommit) { # if we're not testing same commit (i.e. main..main)
Expand Down

0 comments on commit 61e94a1

Please sign in to comment.