Skip to content

Commit

Permalink
gate commit on main
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Martin <[email protected]>
  • Loading branch information
jmartin-tech committed Aug 6, 2024
1 parent 06fdbc0 commit 78336af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/maintain_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILE_TO_COMMIT: garak/resources/plugin_cache.json
DESTINATION_BRANCH: ${{ github.ref_name }}
COMMIT_RESULT: ${{ endsWith(github.ref_name, '/main')}}
run: |
if [ -f $HOME/.cache/garak/resources/plugin_cache.json ]; then
echo "File updated from user cache"
Expand All @@ -51,7 +52,7 @@ jobs:
if [ $? -ne 0 ]; then
set -e
echo "Plugin cache updates exist"
if [ ${{ endsWith(github.ref_name, '/main')}} ]; then
if [ "$COMMIT_RESULT" = true ]; then
export MESSAGE="automatic $FILE_TO_COMMIT update"
export SHA=$( git rev-parse $DESTINATION_BRANCH:$FILE_TO_COMMIT )
cat <<- EOF > write_request.py
Expand Down

0 comments on commit 78336af

Please sign in to comment.