-
Notifications
You must be signed in to change notification settings - Fork 17
51 lines (45 loc) · 1.63 KB
/
update_catalog.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
48
49
50
51
name: catalog_update
concurrency:
group: apps_catalog_update
on:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
publish_catalog:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
container:
image: ghcr.io/truenas/apps_validation:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Add catalog json as a safe directory
run: |
/bin/bash -c "PWD=${pwd}; git config --global --add safe.directory $PWD"
- name: Publish catalog
run: |
/bin/bash -c "PWD=${pwd}; /usr/local/bin/apps_catalog_update publish --path $PWD"
- name: Check untracked files existence
run: echo "CHANGES=$(git -C $(pwd) --no-pager status --porcelain | wc -l)" >> "$GITHUB_ENV"
- uses: stefanzweifel/git-auto-commit-action@v4
if: env.CHANGES != '0'
with:
commit_message: "Publish new changes in catalog [skip ci]"
commit_user_name: sonicaj
commit_user_email: [email protected]
commit_author: sonicaj <[email protected]>
- name: Update catalog
if: env.CHANGES != '0'
run: |
/bin/bash -c "PWD=${pwd}; /usr/local/bin/apps_catalog_update update --path $PWD"
- uses: stefanzweifel/git-auto-commit-action@v4
if: env.CHANGES != '0'
with:
commit_message: "Update catalog changes [skip ci]"
commit_user_name: sonicaj
commit_user_email: [email protected]
commit_author: sonicaj <[email protected]>