Rename and re-organize resources (#45) #21
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: Version Kubernetes Agent chart | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- charts/kubernetes-agent/** | |
- .github/workflows/create-versioning-pr.yaml | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
# For all pushes that aren't creating a versioning commit | |
if: ${{ !startsWith(github.event.commits[0].message, 'Version Kubernetes Agent Chart') }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup-node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
cache-dependency-path: ./charts/kubernetes-agent/package-lock.json | |
- name: npm install | |
run: npm install | |
working-directory: ./charts/kubernetes-agent | |
- name: Install YQ | |
uses: dcarbone/install-yq-action@v1.1.1 | |
- name: Create Release Pull Request | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
cwd: ./charts/kubernetes-agent | |
commit: 'Version Kubernetes Agent Chart' | |
title: 'Version Kubernetes Agent Chart' | |
createGitHubReleases: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.CHANGESETS_GITHUB_TOKEN }} | |
- name: 'Update version and commit Chart.yaml' | |
run: | | |
cd ./charts/kubernetes-agent | |
version=$(jq -r .version package.json) | |
version="$version" yq -i '.version = strenv(version)' Chart.yaml | |
npm i --package-lock-only | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git add Chart.yaml | |
git add package-lock.json | |
git commit -m "Update Chart.yaml" | |
git push --set-upstream origin changeset-release/main | |
if: steps.changesets.outputs.hasChangesets == 'true' | |