bump_cli_version #32
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: Bump CLI version info | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [ bump_cli_version ] | |
jobs: | |
bump-cli: | |
name: Bump CLI version info | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download latest releases.json | |
run: | | |
curl https://api.github.com/repos/infracost/infracost/releases -o ./static/releases.json | |
git add ./static/releases.json | |
echo "latest_version=$(jq .[0].name static/releases.json | sed s/v//)" >> $GITHUB_ENV | |
- name: Find/replace lastest CLI version references | |
run: | | |
find docs -name '*.md' -print0 | xargs -0 \ | |
sed -r -i "s/infracost --version # Should show [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/infracost --version # Should show ${{ env.latest_version }}/g" | |
git --no-pager diff -R | |
- name: Create pull request | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "tim775" | |
git add . | |
git checkout -b chore/bump_to_release_${{ env.latest_version }} | |
git commit -m "chore: bump to latest CLI version" | |
git push --set-upstream origin chore/bump_to_release_${{ env.latest_version }} | |
gh pr create -r tim775 --title="chore: Bump to cli version ${{ env.latest_version }}" --body="Autogenerated by CLI release workflow." |