-
Notifications
You must be signed in to change notification settings - Fork 23
66 lines (59 loc) · 2.57 KB
/
manual_triggers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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 }}