Skip to content

bump-command

bump-command #296

name: Manual Triggers
on:
repository_dispatch:
types: [bump-command, docs-command]
jobs:
ok-to-run:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.manually_approved.outputs.result }}
steps:
- name: Check if was manually approved
id: manually_approved
run: |
manually_approved=${{ github.event_name == 'repository_dispatch' && github.event.client_payload.slash_command.args.named.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha) }}
echo ::set-output name=result::"$manually_approved"
bump:
permissions:
id-token: write
contents: read
needs: [ok-to-run]
if: github.event_name == 'repository_dispatch' && github.event.action == 'bump-command' && needs.ok-to-run.outputs.status == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.slash_command.args.named.sha }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
token: ${{ secrets.GH_CQ_BOT }}
- name: Update chart version
run: 'sed -i "s/^version.*/version: $(grep ''^version'' charts/cloudquery/Chart.yaml | cut -d" " -f2 | awk -F. ''{$NF = $NF + 1;} 1'' | sed ''s/ /./g'')/g" charts/cloudquery/Chart.yaml'
- name: Update Docs
run: |
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.11.0
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Update version and docs"
branch: ${{ github.event.client_payload.pull_request.head.ref }}
docs:
permissions:
id-token: write
contents: read
needs: [ok-to-run]
if: github.event_name == 'repository_dispatch' && github.event.action == 'docs-command' && needs.ok-to-run.outputs.status == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.slash_command.args.named.sha }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
token: ${{ secrets.GH_CQ_BOT }}
- name: Update Docs
run: |
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.11.0
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Update docs"
branch: ${{ github.event.client_payload.pull_request.head.ref }}