Skip to content

Commit

Permalink
Gha feature 3357 enable pull request hook in GitHub action workflow (#…
Browse files Browse the repository at this point in the history
…3419)

* implement pull request hook for gh actions

* ignore tags on push

* ignore tags on push

* ignore tags on push

* apply if condition in build step to check if branch name is matching

* added comments and renamed branch to test gha

* pr fixes

* pr fixes

* implement pull request workflow for gha action and gradle action #3357

* implement pull request workflow for gha action and gradle action #3357
  • Loading branch information
hamidonos authored Sep 10, 2024
1 parent cfe8c0c commit e20de7f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/github-action-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@ name: Build SecHub GHA (scan)
on:
push:
branches:
- 'gha_*'
- main
- master
- develop
- hotfix
pull_request:
# This workflow will run for all pull requests that target following branches
branches:
- main
- master
- develop
- hotfix
# enable manual triggering of workflow
workflow_dispatch:

jobs:
build-scan:
# This job is only executed if the branch name starts with 'gha_feature-'
if: "startsWith(github.head_ref, 'gha_feature-')"
runs-on: ubuntu-latest
# Let's set the scan action folder as the working directory for all "run" steps:

Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,31 @@ name: Java & Go CI

on:
push:
branches-ignore:
# We do NOT build github action development branches here (because no Java or Go code is changed)
- 'gha_*'
# We ignore everything where tag starts with v* - this is done by release build!
branches:
- main
- master
- develop
- hotfix
# We ignore everything where tag starts with v* - this is done by release build!
tags-ignore:
- v*
pull_request:
# This workflow will run for all pull requests that target following branches
branches:
- main
- master
- develop
- hotfix
tags-ignore:
- v*

# enable manual triggering of workflow
workflow_dispatch:

jobs:
build:
# This job is only executed if the branch name starts with or 'feature-'
if: "startsWith(github.head_ref, 'feature-')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down

0 comments on commit e20de7f

Please sign in to comment.