fix: use [skip-build] keyword to prevent build [skip-build]
Browse files
.github/workflows/build-and-commit.yml
CHANGED
|
@@ -9,7 +9,31 @@ permissions:
|
|
| 9 |
contents: write
|
| 10 |
|
| 11 |
jobs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
build_and_commit:
|
|
|
|
|
|
|
| 13 |
runs-on: docker-builder-01
|
| 14 |
steps:
|
| 15 |
- name: Show disk usage
|
|
@@ -32,7 +56,7 @@ jobs:
|
|
| 32 |
|
| 33 |
- name: Clean build directory
|
| 34 |
run: |
|
| 35 |
-
|
| 36 |
|
| 37 |
- name: Build with Nix
|
| 38 |
run: |
|
|
@@ -51,7 +75,7 @@ jobs:
|
|
| 51 |
git config user.name "github-actions[bot]"
|
| 52 |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
| 53 |
git add build/*
|
| 54 |
-
git commit -m "Add built binary [
|
| 55 |
|
| 56 |
- name: Push changes
|
| 57 |
run: |
|
|
|
|
| 9 |
contents: write
|
| 10 |
|
| 11 |
jobs:
|
| 12 |
+
check-commit:
|
| 13 |
+
runs-on: ubuntu-latest
|
| 14 |
+
outputs:
|
| 15 |
+
skip: ${{ steps.check.outputs.skip }}
|
| 16 |
+
steps:
|
| 17 |
+
- uses: actions/checkout@v4
|
| 18 |
+
with:
|
| 19 |
+
fetch-depth: 0
|
| 20 |
+
- id: check
|
| 21 |
+
run: |
|
| 22 |
+
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
| 23 |
+
msg=$(git log -1 --pretty=%B "${{ github.event.pull_request.head.sha }}")
|
| 24 |
+
else
|
| 25 |
+
msg="manual dispatch"
|
| 26 |
+
fi
|
| 27 |
+
echo "Commit message: $msg"
|
| 28 |
+
if echo "$msg" | grep -q '\[skip-build\]'; then
|
| 29 |
+
echo "skip=true" >> "$GITHUB_OUTPUT"
|
| 30 |
+
else
|
| 31 |
+
echo "skip=false" >> "$GITHUB_OUTPUT"
|
| 32 |
+
fi
|
| 33 |
+
|
| 34 |
build_and_commit:
|
| 35 |
+
needs: check-commit
|
| 36 |
+
if: needs.check-commit.outputs.skip == 'false'
|
| 37 |
runs-on: docker-builder-01
|
| 38 |
steps:
|
| 39 |
- name: Show disk usage
|
|
|
|
| 56 |
|
| 57 |
- name: Clean build directory
|
| 58 |
run: |
|
| 59 |
+
rm -rf build
|
| 60 |
|
| 61 |
- name: Build with Nix
|
| 62 |
run: |
|
|
|
|
| 75 |
git config user.name "github-actions[bot]"
|
| 76 |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
| 77 |
git add build/*
|
| 78 |
+
git commit -m "Add built binary [skip-build]"
|
| 79 |
|
| 80 |
- name: Push changes
|
| 81 |
run: |
|