-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from oarbusi/CLOUDP-242548
sign commits and reuse workflow to commit changes
- Loading branch information
Showing
2 changed files
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,36 +7,21 @@ on: | |
- .changelog/** | ||
workflow_dispatch: | ||
jobs: | ||
generate-changelog: | ||
generate-and-update-changelog: | ||
if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 | ||
with: | ||
go-version-file: 'go.mod' | ||
- run: make tools update-changelog-unreleased-section | ||
- run: | | ||
if [[ $(git status --porcelain) ]]; then | ||
if ${{github.event_name == 'workflow_dispatch'}}; then | ||
MSG="Update CHANGELOG.md (Manual Trigger)" | ||
else | ||
MSG="Update CHANGELOG.md for #${{ github.event.pull_request.number }}" | ||
fi | ||
git config --local user.email [email protected] | ||
git config --local user.name changelogbot | ||
git remote set-url origin https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }} | ||
git add CHANGELOG.md | ||
git commit -m "$MSG" | ||
git push | ||
fi | ||
uses: ./.github/workflows/run-script-and-commit.yml | ||
with: | ||
script_call: 'make tools update-changelog-unreleased-section' | ||
file_to_commit: 'CHANGELOG.md' | ||
commit_message: ${{ github.event_name == 'workflow_dispatch' && 'Update CHANGELOG.md (Manual Trigger)' || format('{0}{1}', 'Update CHANGELOG.md for \#', github.event.pull_request.number) }} | ||
user_email: '[email protected]' | ||
user_name: 'svc-apix-bot' | ||
secrets: | ||
remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }} | ||
|
||
slack-notification: | ||
needs: [generate-changelog] | ||
if: ${{ !cancelled() && needs.generate-changelog.result == 'failure' }} | ||
needs: [generate-and-update-changelog] | ||
if: ${{ !cancelled() && needs.generate-and-update-changelog.result == 'failure' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Slack message | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters