-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from truenas/add-manual-trigger
Add github action to manually trigger update catalog workflow
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> |