Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 67 additions & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ on:

permissions:
checks: write
contents: read
contents: write
issues: read
pull-requests: read

jobs:
test:
Expand All @@ -20,6 +22,70 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update changelog from branch issue
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.fork == false
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$branchName = $env:GITHUB_HEAD_REF
if ([string]::IsNullOrWhiteSpace($branchName)) {
Write-Host 'No branch name available. Skipping.'
exit 0
}

$match = [regex]::Match($branchName, '(\d{1,6})')
if (-not $match.Success) {
Write-Host "No issue number found in branch name '$branchName'. Skipping."
exit 0
}

$issueNumber = $match.Groups[1].Value
$repo = $env:GITHUB_REPOSITORY
$headers = @{
Authorization = "Bearer $env:GITHUB_TOKEN"
Accept = 'application/vnd.github+json'
}

try {
$issue = Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/issues/$issueNumber" -Headers $headers -Method Get
} catch {
Write-Host "Issue #$issueNumber not found. Skipping."
exit 0
}

$changelogPath = 'CHANGELOG.md'
if (-not (Test-Path $changelogPath)) {
Write-Host 'CHANGELOG.md not found. Skipping.'
exit 0
}

$content = Get-Content $changelogPath -Raw
if ($content -notmatch '## \[Unreleased\]') {
$content = $content -replace '(# Changelog\s*)', "`$1`n## [Unreleased]`n`n### Added`n"
}

$entry = "- #$issueNumber $($issue.title)"
if ($content -notmatch [regex]::Escape($entry)) {
$content = $content -replace '(## \[Unreleased\][\s\S]*?### Added\s*)', "`$1`n$entry"
Set-Content -Path $changelogPath -Value $content -NoNewline
} else {
Write-Host 'Changelog already contains entry. Skipping.'
exit 0
}

git status --porcelain
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add $changelogPath
git commit -m "Update changelog for #$issueNumber"
git push

- name: Install PowerShell modules
shell: pwsh
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<!-- markdownlint-disable MD024 -->
# Changelog

## [1.0.0] - 2026-02-01

## [Unreleased]

### Added

- #2 Add DSC resource for project permissions## [1.0.0] - 2026-02-01

### Added

- Initial release. Add DSC class for: Users, Projects, Groups

## [1.0.1] - 2026-03-13

### Added

- Add class: ProjectUserPermissionResource
- Add class: ProjectGroupPermissionResource


19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,25 @@ resources:
AccessLevel: Basic
Ensure: Present
pat: "[parameters('Token')]"
- name: AddPermissionProject
type: AzureDevOpsDscv3/ProjectUserPermissionResource
properties:
ProjectName: TestDSCv11
PermissionLevel: ProjectAdministrators # ProjectAdministrators, ProjectValidUsers, Readers, or ReleaseAdministrators.
UserPrincipalName: UserPrincipalName
Organization: ExampleOrganization
Ensure: Absent
pat: "[parameters('Token')]"
- name: AddPermissionProject
type: AzureDevOpsDscv3/ProjectGroupPermissionResource
properties:
ProjectName: TestDSCv11
PermissionLevel: ProjectAdministrators # ProjectAdministrators, ProjectValidUsers, Readers, or ReleaseAdministrators.
GroupDisplayName: EntraID-GroupDisplayName
GroupOriginId: EntraID-GroupObjectID # group descriptor
Organization: ExampleOrganization
Ensure: Absent
pat: "[parameters('Token')]"


```
Expand Down
8 changes: 6 additions & 2 deletions module/AzureDevOpsDscv3/AzureDevOpsDscv3.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
RootModule = 'AzureDevOpsDscv3.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'

# Supported PSEditions
CompatiblePSEditions = @('Desktop', 'Core')
Expand Down Expand Up @@ -74,7 +74,7 @@ VariablesToExport = '*'
AliasesToExport = '*'

# DSC resources to export from this module
DscResourcesToExport = @('ProjectResource', 'OrganizationUserResource', 'OrganizationGroupResource')
DscResourcesToExport = @('ProjectResource', 'OrganizationUserResource', 'OrganizationGroupResource', 'ProjectUserPermissionResource', 'ProjectGroupPermissionResource')

# List of all modules packaged with this module
# ModuleList = @()
Expand All @@ -97,6 +97,10 @@ DscResourcesToExport = @('ProjectResource', 'OrganizationUserResource', 'Organiz
- Add UserResource DSC Resource.
- Add ProjectResource DSC Resource.
- Add OrganizationGroupResource DSC Resource.

v. 1.0.1 - 2026-03-13
- Add class: ProjectUserPermissionResource
- Add class: ProjectGroupPermissionResource
'

# Prerelease string of this module
Expand Down
Loading