Skip to content

Commit

Permalink
Merge pull request #98 from truenas/add-manual-trigger
Browse files Browse the repository at this point in the history
Add github action to manually trigger update catalog workflow
  • Loading branch information
sonicaj authored Aug 6, 2024
2 parents b24e883 + 95f3544 commit 1efb9df
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/manual_update_catalog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: manual_catalog_update

concurrency:
group: manual_apps_catalog_update

on:
workflow_dispatch:

jobs:
publish_catalog:
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
run: |
/bin/bash -c "PWD=${pwd}; /usr/local/bin/apps_catalog_update update --path $PWD"
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update catalog changes [skip ci]"
commit_user_name: sonicaj
commit_user_email: [email protected]
commit_author: sonicaj <[email protected]>

0 comments on commit 1efb9df

Please sign in to comment.