Skip to content

Commit e3e0ced

Browse files
committed
remove changes from pipeline
1 parent 875fcc4 commit e3e0ced

File tree

1 file changed

+15
-59
lines changed

1 file changed

+15
-59
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [main]
66
workflow_dispatch:
77
schedule:
8-
- cron: "0 7 * * *"
8+
- cron: "0 6 * * *"
99

1010
permissions:
1111
contents: write
@@ -14,7 +14,6 @@ permissions:
1414

1515
jobs:
1616
build:
17-
if: github.repository == 'devsecopsmaturitymodel/DevSecOps-MaturityModel'
1817
runs-on: ubuntu-latest
1918
steps:
2019
- uses: actions/checkout@v3
@@ -29,22 +28,7 @@ jobs:
2928
- name: Get Semantic Release Version
3029
id: get-version
3130
run: |
32-
# Check if latest commit is a merge commit
33-
if git log --format="%s" -1 | grep -q "^Merge pull request"; then
34-
echo "✅ Merge commit detected, forcing patch release"
35-
# Get last tag and increment patch
36-
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0")
37-
VERSION=$(echo $LAST_TAG | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
38-
else
39-
VERSION=$(npx semantic-release --dry-run 2>&1 | grep -o 'Release note for version [0-9]\+\.[0-9]\+\.[0-9]\+' | head -1 | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
40-
fi
41-
42-
if [ -z "$VERSION" ]; then
43-
echo "❌ No version could be detected by semantic-release"
44-
echo "This usually means no commits warrant a release (no feat/fix/breaking changes)"
45-
exit 1
46-
fi
47-
echo "version=$VERSION" >> $GITHUB_OUTPUT
31+
echo "::set-output name=version::$(grep -oP '\[\d+\.\d+\.\d+\]' CHANGELOG.md | tr -d '[]')"
4832
4933
- name: show version
5034
run: |
@@ -62,54 +46,26 @@ jobs:
6246
#registry: registry.hub.docker.com
6347
username: wurstbrot
6448
password: ${{ secrets.HUB_TOKEN }}
65-
- name: create and push dsomm image
49+
- name: create and push yaml image
6650
uses: docker/build-push-action@v3
6751
with:
6852
push: true
53+
file: Dockerfile
6954
platforms: linux/amd64,linux/arm64
70-
tags: wurstbrot/dsomm:${{ steps.get-version.outputs.version }},wurstbrot/dsomm:latest
71-
build-args: |
72-
COMMIT_HASH=${{ github.sha }}
73-
COMMIT_DATE=${{ github.event.head_commit.timestamp }}
74-
GIT_BRANCH=${{ github.ref_name }}
75-
# Commit all changed files back to the repository
76-
- uses: planetscale/ghcommit-action@v0.1.6
55+
tags: wurstbrot/dsomm-yaml-generation:${{ steps.get-version.outputs.version }},wurstbrot/dsomm-yaml-generation:latest
56+
- name: Extract generated files from docker image
57+
run: |
58+
docker run -d --name=yaml --entrypoint="/bin/sleep" wurstbrot/dsomm-yaml-generation:${{ steps.get-version.outputs.version }} 60
59+
docker cp yaml:/var/www/html/generated/model.yaml generated/model.yaml
60+
docker cp yaml:/var/www/html/generated/dependency-tree.md generated/dependency-tree.md
61+
- name: Replace version placeholder in model.yaml
62+
run: |
63+
sed -i "s/__VERSION_PLACEHOLDER__/${{ steps.get-version.outputs.version }}/g" src/assets/YAML/model.yaml
64+
- name: Commit all changed files back to the repository
65+
uses: planetscale/ghcommit-action@v0.1.6
7766
with:
7867
commit_message: "🤖 fmt"
7968
repo: ${{ github.repository }}
8069
branch: ${{ github.head_ref || github.ref_name }}
8170
env:
8271
GITHUB_TOKEN: ${{secrets.ACCESS_TOKEN}}
83-
heroku:
84-
if: github.repository == 'devsecopsmaturitymodel/DevSecOps-MaturityModel' && github.event_name == 'push' && github.ref == 'refs/heads/main'
85-
runs-on: ubuntu-latest
86-
steps:
87-
- name: "Check out Git repository"
88-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
89-
- name: "Set Heroku app & branch for ${{ github.ref }}"
90-
run: |
91-
echo $GITHUB_REF
92-
if [ "$GITHUB_REF" == "refs/heads/main" ]; then
93-
echo "HEROKU_APP=" >> $GITHUB_ENV
94-
echo "HEROKU_BRANCH=main" >> $GITHUB_ENV
95-
fi
96-
echo "HEROKU_BRANCH=main" >> $GITHUB_ENV
97-
- name: Install Heroku CLI
98-
run: |
99-
curl https://cli-assets.heroku.com/install.sh | sh
100-
- name: "Deploy ${{ github.ref }} to Heroku"
101-
uses: akhileshns/heroku-deploy@v3.13.15
102-
with:
103-
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
104-
heroku_app_name: "dsomm"
105-
heroku_email: timo.pagel@owasp.org
106-
branch: ${{ env.HEROKU_BRANCH }}
107-
usedocker: true
108-
docker_build_args: |
109-
COMMIT_HASH
110-
COMMIT_DATE
111-
GIT_BRANCH
112-
env:
113-
COMMIT_HASH: ${{ github.sha }}
114-
COMMIT_DATE: ${{ github.event.head_commit.timestamp }}
115-
GIT_BRANCH: ${{ github.ref_name }}

0 commit comments

Comments
 (0)