-
Notifications
You must be signed in to change notification settings - Fork 33
47 lines (40 loc) · 1.37 KB
/
update-container-tags.yaml
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
---
name: update container tags
'on':
pull_request_target:
jobs:
update-container-tags:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: git fetch
run: |
git fetch
- name: git checkout
run: |
git checkout ${{ github.head_ref }}
# compare to upstream main branch
- name: git add remote
run: |
git remote add toolforgepaws https://github.com/toolforge/paws.git
- name: git remote update
run: |
git remote update
- name: update values.yaml
run: |
for i in renderer nbserve paws-hub jobber singleuser minesweeper ; do
if [[ $(git diff remotes/toolforgepaws/main -- images/${i}/) ]]; then
sed -i "s/tag: .* # ${i} tag managed by github actions$/tag: pr-${{ github.event.number }} # ${i} tag managed by github actions/" paws/values.yaml
fi
done
- uses: EndBug/add-and-commit@v7
with:
add: 'paws/values.yaml'
author_name: Github Action
author_email: [email protected]
branch: ${{ github.head_ref }}
message: 'auto update of ${{ inputs.imagename }} tag'
pull: --rebase --autostash