Release Prep (Manual Test) #5
This file contains hidden or 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: Test Updatecli Version Update | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| service_name: | |
| description: "Name of the service to update" | |
| type: string | |
| required: true | |
| version: | |
| description: "Version to set for the service" | |
| type: string | |
| required: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update_version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Updatecli in the runner | |
| uses: updatecli/updatecli-action@v2 | |
| - name: Generate UTC timestamp | |
| id: timestamp | |
| run: echo "ts=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | |
| - name: Create Updatecli config dynamically | |
| run: | | |
| cat <<EOF > updatecli.yaml | |
| name: "Update version in versions.md" | |
| sources: | |
| new_version: | |
| kind: shell | |
| spec: | |
| command: "echo ${VERSION}" | |
| timestamp: | |
| kind: shell | |
| spec: | |
| command: "echo ${TIMESTAMP}" | |
| targets: | |
| update_markdown: | |
| kind: file | |
| spec: | |
| file: "versions.md" | |
| matchpattern: "^\\| ${SERVICE_NAME} \\|.*$" | |
| replacepattern: "| ${SERVICE_NAME} | {{ source \`new_version\` }} | {{ source \`timestamp\` }} |" | |
| actions: | |
| default: | |
| kind: github/pullrequest | |
| spec: | |
| title: "chore: update ${SERVICE_NAME} → ${VERSION}" | |
| labels: | |
| - update | |
| EOF | |
| env: | |
| SERVICE_NAME: ${{ github.event.inputs.service_name }} | |
| VERSION: ${{ github.event.inputs.version }} | |
| TIMESTAMP: ${{ steps.timestamp.outputs.ts }} | |
| - name: Run Updatecli Apply | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: updatecli apply --config updatecli.yaml --clean=true |