Skip to content

Commit 398ef69

Browse files
committed
generate docs only if squid has new commits since last run
1 parent 593892e commit 398ef69

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/gen-docs.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,43 @@ jobs:
3333
with:
3434
repository: squid-cache/squid
3535
path: squid
36+
37+
- name: cache last commit hash
38+
uses: actions/cache@v4
39+
with:
40+
path: last-squid-commit.txt
41+
key: squid-last-commit-hash
42+
43+
- name: Check for squid source updates
44+
id: check_squid_updates
45+
run: |
46+
LAST_COMMIT_HASH=$(cat last-squid-commit.txt || echo "")
47+
cd squid
48+
CURRENT_COMMIT_HASH=$(git rev-parse HEAD)
49+
echo "current=$CURRENT_COMMIT_HASH" >> $GITHUB_OUTPUT
50+
if [ "$LAST_COMMIT_HASH" = "$CURRENT_COMMIT_HASH" ]; then
51+
echo "marking as no no updates"
52+
echo "had_update=false" >> $GITHUB_OUTPUT
53+
else
54+
echo "had_update=true" >> $GITHUB_OUTPUT
55+
fi
56+
echo $CURRENT_COMMIT_HASH > ../last-squid-commit.txt
3657
3758
- name: Prepare squid sources
3859
working-directory: squid
60+
if: steps.check_squid_updates.outputs.had_update == 'true'
3961
run: |
4062
./bootstrap.sh
4163
. ./test-suite/buildtests/layer-02-maximus.opts
4264
eval ./configure $DISTCHECK_CONFIGURE_FLAGS
4365
4466
- name: Build programming guide
67+
if: steps.check_squid_updates.outputs.had_update == 'true'
4568
run: |
4669
doxygen doxyfile
4770
4871
- name: update self
72+
if: steps.check_squid_updates.outputs.had_update == 'true'
4973
uses: EndBug/add-and-commit@v9
5074
with:
5175
message: "automated update"

0 commit comments

Comments
 (0)