Skip to content

Commit 935f851

Browse files
committed
CI: add workflow_dispatch event to the main build
Invert the workflow conditionals so that a workflow_dispatch event acts like an on: push build.
1 parent a4218a0 commit 935f851

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches: [ main, maint/* ]
88
pull_request:
99
branches: [ main, maint/* ]
10+
workflow_dispatch:
1011

1112
env:
1213
docker-registry: docker.pkg.github.com
@@ -48,7 +49,7 @@ jobs:
4849
uses: actions/checkout@v2
4950
with:
5051
fetch-depth: 0
51-
if: github.event_name == 'push'
52+
if: github.event_name != 'pull_request'
5253
- name: Setup QEMU
5354
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
5455
if: matrix.container.qemu == true
@@ -59,7 +60,7 @@ jobs:
5960
DOCKER_REGISTRY: ${{ env.docker-registry }}
6061
GITHUB_TOKEN: ${{ secrets.github_token }}
6162
working-directory: ${{ env.docker-config-path }}
62-
if: github.event_name == 'push'
63+
if: github.event_name != 'pull_request'
6364
- name: Build and publish image
6465
run: |
6566
if [ "${{ matrix.container.base }}" != "" ]; then
@@ -68,7 +69,7 @@ jobs:
6869
docker build -t ${{ env.docker-registry-container-sha }} ${BASE_ARG} -f ${{ env.dockerfile }} .
6970
docker push ${{ env.docker-registry-container-sha }}
7071
working-directory: ${{ env.docker-config-path }}
71-
if: github.event_name == 'push' && env.docker-container-exists != 'true'
72+
if: github.event_name != 'pull_request' && env.docker-container-exists != 'true'
7273

7374
# Run our CI/CD builds. We build a matrix with the various build targets
7475
# and their details. Then we build either in a docker container (Linux)
@@ -292,4 +293,4 @@ jobs:
292293
path: api-documentation.zip
293294
- name: Push documentation branch
294295
run: git push origin gh-pages
295-
if: github.event_name == 'push' && github.repository == 'libgit2/libgit2'
296+
if: github.event_name != 'pull_request' && github.repository == 'libgit2/libgit2'

0 commit comments

Comments
 (0)