Skip to content

Commit

Permalink
Merge pull request #71 from telekom-mms/switch_to_main
Browse files Browse the repository at this point in the history
use shared workflow and switch to main
  • Loading branch information
rndmh3ro authored Feb 12, 2024
2 parents 2f28595 + 9146d70 commit a70c38e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: CI - Linting & Testing

on:
push:
branches: [master]
branches: [main]
paths:
- 'playbooks/**'
- 'roles/**'
- 'tests/**'
- 'meta/**'
pull_request:
branches: [master]
branches: [main]
paths:
- 'playbooks/**'
- 'roles/**'
Expand Down
71 changes: 7 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,12 @@ on:
workflow_dispatch:
push:
branches:
- master
- main

jobs:
generate_changelog:
runs-on: ubuntu-latest
name: create release draft
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Get Previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: calculate next version
id: version
uses: patrickjahns/version-drafter-action@fda4b8e4017bee5dd5794f255a4d484e8e647561 # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate changelog
uses: charmixer/auto-changelog-action@b25e89c9410e03189f0d48b02b3a8caad6e78015 # v1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
future_release: ${{ steps.version.outputs.next-version }}

- name: push changelog
uses: github-actions-x/commit@722d56b8968bf00ced78407bbe2ead81062d8baa # v2.9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: master
commit-message: update changelog
force-add: true
files: CHANGELOG.md
name: Deutsche Telekom MMS GmbH
email: [email protected]

# do a second checkout to prevent race situation
# changelog gets updated but action works on old commit id
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: master

- name: Generate changelog for the release
run: |
sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md
- name: Read CHANGELOG.md
id: package
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1
with:
path: ./CHANGELOGRELEASE.md

- name: Create Release draft
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
release_name: ${{ steps.version.outputs.next-version }}
tag_name: ${{ steps.version.outputs.next-version }}
body: |
${{ steps.package.outputs.content }}
draft: true
release:
# docs: https://github.com/telekom-mms/.github#release
if: github.repository != '$TEMPLATE_REPOSITORY'
uses: telekom-mms/.github/.github/workflows/release.yml@main
secrets:
GH_BRANCH_PROTECTION_APP_TOKEN: ${{ secrets.GH_BRANCH_PROTECTION_APP_TOKEN }}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $ git commit -m "improved feature X for ansible-icinga-collection"
Use the `git push` command to add your local made changes to your remote fork

```
$ git push origin master
$ git push origin HEAD
```

### Open a Pull Request
Expand Down

0 comments on commit a70c38e

Please sign in to comment.