build(ci): fix update release metadata #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 Release Metadata | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
update-release-metadata: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download .env.development file and delete it after the workflow is finished | |
uses: zdeneklapes/dotenv-vault-action@v2 | |
with: | |
dotenvMe: ${{ secrets.VAULT_TOKEN }} | |
stage: "development" | |
delete: "true" | |
- name: Fetch the latest release data | |
id: fetch_release | |
run: | | |
curl \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ env.TOKEN_VALHALLA }}" \ | |
https://api.github.com/repos/tursodatabase/turso-client-php/releases/latest \ | |
-o release_metadata.json | |
- name: Configure git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "darkterminal" | |
- name: Commit and push if changed | |
env: | |
GITHUB_TOKEN: ${{ env.TOKEN_VALHALLA }} | |
run: | | |
git add release_metadata.json | |
git commit -m "Update release metadata" || exit 0 # Exit 0 if no changes | |
git push https://${{ env.TOKEN_VALHALLA }}@github.com/tursodatabase/turso-client-php.git |