-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.22 KB
/
version-set.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Update version-set
on:
push:
tags:
- "v*.*.*"
jobs:
versionset:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout current code
uses: actions/checkout@v3
with:
path: 'source'
- name: Get values
id: vars
run: |
echo "version=${GITHUB_REF_NAME#v}" | tee -a $GITHUB_OUTPUT
[ -f source/.versionset ] || { echo ".versionset file missing"; exit 1; }
echo "version_set_name=$(cat source/.versionset)" | tee -a $GITHUB_OUTPUT
- name: Checkout ansible repo
uses: actions/checkout@v3
with:
path: 'versionset'
repository: geokrety/geokrety-ansible
- name: Update Version-Set
uses: fjogeleit/yaml-update-action@main
with:
commitChange: false
repository: geokrety/geokrety-ansible
valueFile: defaults/versionset.yml
changes: |
{
"${{ steps.vars.outputs.version_set_name }}.docker_tag": "${{ steps.vars.outputs.version }}",
"${{ steps.vars.outputs.version_set_name }}.git_url": "${{ github.server_url }}/${{ github.repository }}"
}
workDir: versionset
- name: Create Pull Request
id: cpr
with:
uses: peter-evans/create-pull-request@v5
path: versionset
token: ${{ secrets.GH_TOKEN }}
add-paths: defaults/versionset.yml
commit-message: |
feat: Bump ${{ github.repository }} in version-set to ${{ github.ref_name }}
committer: geokrety-bot <[email protected]>
author: geokrety-bot <[email protected]>
branch: deployment/${{ github.repository }}
delete-branch: true
title: |
Bump ${{ github.repository }} in version-set
labels: version-set
assignees: kumy
reviewers: kumy
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"