Skip to content
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

Start of workflow to automatically release when ServiceControl or ServicePulse updates #476

Merged
merged 1 commit into from
Jan 24, 2025
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Automatic Release
on:
pull_request:
types: closed
defaults:
run:
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
jobs:
auto-release:
name: Automatic Release
runs-on: ubuntu-latest
steps:
# Checkout required for GitHub CLI to work
- name: Checkout
uses: actions/[email protected]
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Get Dependabot metadata
id: dependabot
uses: dependabot/[email protected]
- name: Evaluate metadata
if: ${{ steps.dependabot.outputs.target-branch == github.event.repository.default_branch && contains(steps.dependabot.outputs.dependency-names, 'Particular.PlatformSample.') }}
run: |
echo "Need to release, in theory"
$tags = gh api /repos/${{ github.repository }}/tags | ConvertFrom-Json
$latest = [Version]($tags | Where-Object name -match '^\d+\.\d+\.\d+$' | Sort-Object -Descending {[Version]$_.name} | Select-Object name)[0].name
$nextMinor = "$($latest.Major).$($latest.Minor + 1).0"
echo "Next release should be $nextMinor"
# gh release create $nextMinor --latest --notes "Automatically generated due to updates in ${{ steps.dependabot.outputs.dependency-names }}"
Loading