Update From Changelog #5
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
name: Update From Changelog | |
on: | |
workflow_run: | |
workflows: ["Update From Submodule"] | |
types: | |
- completed | |
permissions: | |
contents: write | |
jobs: | |
update_changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
# Check out the branch from the triggering workflow | |
ref: ${{ github.event.workflow_run.head_branch }} | |
submodules: true | |
- name: Validate repository | |
run: | | |
if [[ ${{ github.event.workflow_run.head_repository.full_name }} != "${{ github.repository }}" ]]; then | |
echo "Untrusted repository detected! Exiting." | |
exit 1 | |
fi | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
fingerprint: "F768450FB05B817D0B4BC26FB9B6A9B428C8676A" | |
trust_level: 5 | |
- name: Run update script | |
run: bash update-changelog.bash | |
- name: Show updated 'CHANGELOG.md' | |
run: cat CHANGELOG.md | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m "Update 'CHANGELOG.md' based on submodule commits" | |
git pull --rebase origin ${{ github.ref_name }} | |
git push origin HEAD:${{ github.ref_name }} |