-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.43 KB
/
wf-bump-image-version.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
on:
workflow_call:
inputs:
image-name:
description: full-name of container repository
required: true
type: string
new-image-tag:
description: new image tag
required: true
type: string
target-file:
description: target manifest file to update
required: true
type: string
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# if zsh:
# sed -i "s\!\(image: $IMAGE_NAME\):.\*\!\\1:$NEW_IMAGE_TAG\!g" "$TARGET_FILE"
- run: |
sed -i "s!\(image: $IMAGE_NAME\):.\+!\\1:$NEW_IMAGE_TAG!g" "$TARGET_FILE";
env:
IMAGE_NAME: "${{ inputs.image-name }}"
NEW_IMAGE_TAG: "${{ inputs.new-image-tag }}"
TARGET_FILE: "${{ inputs.target-file }}"
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: 364898
private-key: ${{ secrets.ARTHUR1_BOT_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@v6
with:
commit-message: Bump to ${{ inputs.image-name }}:${{ inputs.new-image-tag }}
title: Bump to ${{ inputs.image-name }}:${{ inputs.new-image-tag }}
body: |
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
Updated file: ${{ inputs.target-file }}
token: ${{ steps.app-token.outputs.token }}