Update API Changelog #10
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 API Changelog | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [update_api_changelog] | |
jobs: | |
get_api_changelog: | |
runs-on: arc-runner-k8s | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: 'unipoll/api' | |
- name: Copy API changelog to artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: api_changelog | |
path: CHANGELOG.md | |
update_docs: | |
needs: get_api_changelog | |
runs-on: arc-runner-k8s | |
permissions: | |
contents: write | |
steps: | |
- name: Force update git | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y software-properties-common | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install -y git | |
- name: Checkout docs | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: true | |
- name: Copy API changelog from artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: api_changelog | |
path: docs/api-docs/changelog.md | |
- name: Commit update | |
run: | | |
git config --global user.name 'Bot' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git add docs/api-docs/changelog.md | |
git commit -m "Update API changelog on release" && git push --recurse-submodules=on-demand || echo "No changes to commit" |