Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update template workflow to reusable workflow #8

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 3 additions & 53 deletions workflow-templates/changelog-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,6 @@ on:
branches: [ $default-branch ]

jobs:
prebuild:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.semrel.outputs.version }}
steps:
- uses: actions/checkout@v3

- name: Check pre-commit presence
id: precommit_exists
uses: andstor/file-existence-action@v1
with:
files: ".pre-commit-config.yaml"

- uses: actions/setup-python@v3
if: steps.precommit_exists.outputs.files_exists == 'true'

- uses: pre-commit/[email protected]
if: steps.precommit_exists.outputs.files_exists == 'true'

- uses: go-semantic-release/action@v1
if: github.event_name != 'pull_request'
id: semrel
with:
github-token: ${{ secrets.BOT_ACCESS_TOKEN }}
prepend: true
dry: true

release:
needs: [ prebuild ]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }} # needed for push to protected branch

- uses: go-semantic-release/action@v1
if: needs.prebuild.outputs.version != ''
id: generate_changelog
with:
github-token: ${{ secrets.BOT_ACCESS_TOKEN }}
prepend: true
changelog-file: CHANGELOG.md

- name: Update changelog
uses: stefanzweifel/git-auto-commit-action@v4
if: steps.generate_changelog.outputs.version != ''
with:
commit_user_name: infralovers-machine
commit_user_email: [email protected]
commit_message: 'chore(ci): commit changes from go-semantic-release'
file_pattern: CHANGELOG.md
changelog-automation:
uses: infralovers/.github/.github/workflows/changelog-automation.yml@main
secrets: inherit
Loading