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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3d2102c..7179a61 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,6 +7,7 @@ on:
branches: [ main, maint/* ]
pull_request:
branches: [ main, maint/* ]
+ workflow_dispatch:
env:
docker-registry: docker.pkg.github.com
@@ -48,7 +49,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- if: github.event_name == 'push'
+ if: github.event_name != 'pull_request'
- name: Setup QEMU
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
if: matrix.container.qemu == true
@@ -59,7 +60,7 @@ jobs:
DOCKER_REGISTRY: ${{ env.docker-registry }}
GITHUB_TOKEN: ${{ secrets.github_token }}
working-directory: ${{ env.docker-config-path }}
- if: github.event_name == 'push'
+ if: github.event_name != 'pull_request'
- name: Build and publish image
run: |
if [ "${{ matrix.container.base }}" != "" ]; then
@@ -68,7 +69,7 @@ jobs:
docker build -t ${{ env.docker-registry-container-sha }} ${BASE_ARG} -f ${{ env.dockerfile }} .
docker push ${{ env.docker-registry-container-sha }}
working-directory: ${{ env.docker-config-path }}
- if: github.event_name == 'push' && env.docker-container-exists != 'true'
+ if: github.event_name != 'pull_request' && env.docker-container-exists != 'true'
# Run our CI/CD builds. We build a matrix with the various build targets
# and their details. Then we build either in a docker container (Linux)
@@ -292,4 +293,4 @@ jobs:
path: api-documentation.zip
- name: Push documentation branch
run: git push origin gh-pages
- if: github.event_name == 'push' && github.repository == 'libgit2/libgit2'
+ if: github.event_name != 'pull_request' && github.repository == 'libgit2/libgit2'