-
Notifications
You must be signed in to change notification settings - Fork 13
42 lines (34 loc) · 1.58 KB
/
check-tag-bump.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Check Tag Bump
on:
pull_request_target:
types: [labeled]
jobs:
bump-tag-check:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-release-label@v1
id: bump-label
if: ${{ startsWith(github.event.label.name, 'release/') }}
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
if: ${{ steps.bump-label.outputs.level != null }}
with:
semver_only: true
- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
if: ${{ steps.bump-label.outputs.level != null }}
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: ${{ steps.bump-label.outputs.level }}
- uses: actions-ecosystem/action-create-comment@v1
if: ${{ steps.bump-semver.outputs.new_version != null }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body: |
This PR will update [${{ github.repository }}](https://github.com/${{ github.repository }}) from [${{ steps.get-latest-tag.outputs.tag }}](https://github.com/${{ github.repository }}/releases/tag/${{ steps.get-latest-tag.outputs.tag }}) to ${{ steps.bump-semver.outputs.new_version }} :rocket:
Changes: https://github.com/${{ github.repository }}/compare/${{ steps.get-latest-tag.outputs.tag }}...${{ github.event.pull_request.head.ref }}
If this update isn't as you expected, you may want to change or remove the *release label*.