Skip to content

Commit

Permalink
Add possibility to disable cache
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Jan 12, 2024
1 parent 8d25910 commit 790aea0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,21 @@ jobs:
- '**.ac'
- '**.in'
list-files: shell
- name: "Check '@github-action disable-cache' in PR Comment"
id: issue_comment
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
shell: /usr/bin/bash {0}
run: |
ISSUE_COMMENTS=$(gh api -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments | jq ".[] | .body")
if echo "${ISSUE_COMMENT_BODIES}" | grep "@github-actions disable-cache"; then
echo "DISABLE_CACHE=true" >> $GITHUB_OUTPUT
else
echo "DISABLE_CACHE=false" >> $GITHUB_OUTPUT
fi
- name: Restore from cache
env:
NO_CACHE: ${{ steps.cache.outputs.no-cache || steps.cache.outputs.deleted_count > 20 }}
NO_CACHE: ${{ (steps.cache.outputs.no-cache || (steps.cache.outputs.deleted_count > 20)) || (steps.issue_comment.outputs.DISABLE_CACHE == "true") }}
BOOTSTRAP: ${{ steps.cache.outputs.bootstrap }}
CONFIGURE: ${{ steps.cache.outputs.configure }}
EVENT: ${{ github.event_name }}
Expand Down

0 comments on commit 790aea0

Please sign in to comment.