Skip to content

Commit

Permalink
Revert "Test changelog update (#2152)" (#2153)
Browse files Browse the repository at this point in the history
This reverts commit 0cbdb11.
  • Loading branch information
oarbusi authored Apr 16, 2024
1 parent 0cbdb11 commit 9297a07
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 31 deletions.
3 changes: 0 additions & 3 deletions .changelog/2140.txt

This file was deleted.

39 changes: 27 additions & 12 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,36 @@ on:
- .changelog/**
workflow_dispatch:
jobs:
generate-and-update-changelog:
generate-changelog:
if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch'
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 }}
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
slack-notification:
needs: [generate-and-update-changelog]
if: ${{ !cancelled() && needs.generate-and-update-changelog.result == 'failure' }}
needs: [generate-changelog]
if: ${{ !cancelled() && needs.generate-changelog.result == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: Send Slack message
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/run-script-and-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
user_name:
required: true
type: string
secrets:
remote:
required: false

jobs:
run_script_and_commit:
Expand All @@ -35,25 +32,12 @@ jobs:
- name: Run specified script
run: ${{ inputs.script_call }}

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
with:
git_user_signingkey: true
git_commit_gpgsign: true
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}

- name: Commit changes
run: |
if [[ $(git status --porcelain) ]]; then
git pull
git config --local user.email ${{ inputs.user_email }}
git config --local user.name ${{ inputs.user_name }}
if ${{ secrets.remote != '' }}; then
git remote set-url origin ${{ secrets.remote }}
fi
git add ${{ inputs.file_to_commit }}
git commit -m "${{ inputs.commit_message }}"
git push
Expand Down

0 comments on commit 9297a07

Please sign in to comment.