Skip to content

Commit

Permalink
Merge pull request #61 from ngrok/release/testing
Browse files Browse the repository at this point in the history
Fix: github actions not running unless manually triggered
  • Loading branch information
dthomasngrokker authored Feb 21, 2025
2 parents 8c34240 + f226459 commit 38b8efc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/snap.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
name: snap
on: # The event that triggers the workflow
on:
push:
branches:
- main # When a commit is created on main
pull_request:
types: [opened, reopened] # when a pull request is opened or reopened
branches:
- main # When a pull request is opened against main
- main # the branch that the pull request is targeting
workflow_dispatch: # When the workflow is manually triggered

jobs:
build:
# It will run if:
# 1. The branch name contains the word 'release',
# 1. The event triggering the workflow is a 'pull_request' event,
# 2. The branch name contains the word 'release',
# OR
# 2. The event triggering the workflow is a 'workflow_dispatch' event. (manual run)
if: contains(github.ref, 'release') || github.event_name == 'workflow_dispatch'
# 3. The event triggering the workflow is a 'workflow_dispatch' event. (manual run)
if: (github.event_name == 'pull_request' && contains(github.head_ref, 'release')) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
outputs:
snap-file: ${{ steps.build-snap.outputs.snap }}
Expand All @@ -38,11 +40,10 @@ jobs:
publish:
# It will run if:
# 1. The event triggering the workflow is a 'push' event,
# 2. The push is to the 'main' branch,
# 3. The branch name contains the word 'release',
# 2. The pushed branch name contains the word 'release',
# OR
# 4. The event triggering the workflow is a 'workflow_dispatch' event. (manual run)
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.ref, 'release')) || github.event_name == 'workflow_dispatch'
# 3. The event triggering the workflow is a 'workflow_dispatch' event. (manual run)
if: (github.event_name == 'push' && contains(github.ref, 'release')) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
needs: build # Wait for the build job to complete
steps:
Expand Down

0 comments on commit 38b8efc

Please sign in to comment.