Skip to content

Commit 9b92170

Browse files
committed
Utvider sånn at ved workflow run så kjører den kun om det er endringer i src mappa. Dersom kun markdown filer er endret så bygger den ikke
1 parent 0e408b0 commit 9b92170

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/buildAndPublish.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
name: "Build and Publish"
22
on:
33
workflow_call:
4+
workflow_dispatch:
45
workflow_run:
56
workflows: ["Run static code validation"]
67
types:
78
- completed
89
jobs:
910
buildAndPublish:
1011
name: Build and Publish
11-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
12+
if: ${{
13+
github.event_name == 'workflow_call' ||
14+
github.event_name == 'workflow_dispatch' ||
15+
(
16+
github.event_name == 'workflow_run' &&
17+
github.event.workflow_run.conclusion == 'success' &&
18+
(
19+
contains(github.event.workflow_run.head_commit.modified, 'src/') ||
20+
contains(github.event.workflow_run.head_commit.added, 'src/')
21+
) &&
22+
!(
23+
github.event.workflow_run.head_commit.modified == '["*.md"]' ||
24+
github.event.workflow_run.head_commit.added == '["*.md"]'
25+
)
26+
)
27+
}}
28+
1229
runs-on: ubuntu-latest
1330
container: ghcr.io/flxbl-io/sfp:${{ vars.SFP_CONTAINER_VERSION }}
1431
permissions:

0 commit comments

Comments
 (0)