Workflow file for this run
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 Debricked CLI | |
on: | |
push: | |
branches: ['**'] | |
jobs: | |
update-cli: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: '6-integrate-debricked-cli-with-vs-code-extension-2' | |
- name: Get latest release info | |
id: get_latest_release | |
run: | | |
latest_release=$(curl -s https://api.github.com/repos/debricked/cli/releases/tags/v2.0.3) | |
download_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith("cli_windows_x86_64.tar.gz")).browser_download_url') | |
echo "Download URL: $download_url" | |
echo "download_url=$download_url" >> $GITHUB_OUTPUT | |
- name: Download latest release | |
run: | | |
mkdir -p resources/debricked-cli | |
echo "Download URL: ${{ steps.get_latest_release.outputs.download_url }}" | |
curl -L ${{ steps.get_latest_release.outputs.download_url }} -o resources/debricked-cli/debricked-cli.tar.gz | |
- name: Extract Debricked CLI | |
run: | | |
tar -xzf resources/debricked-cli/debricked-cli.tar.gz -C resources/debricked-cli | |
rm resources/debricked-cli/debricked-cli.tar.gz | |
- name: Commit changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add resources/debricked-cli | |
git commit -m "Update Debricked CLI to latest release" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |