From ffe4f6b6d39f7a697917c1c8056b397bf8a60404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 17 Jan 2025 22:56:31 +0100 Subject: [PATCH] Create commit.yaml --- .github/workflows/commit.yaml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/commit.yaml diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml new file mode 100644 index 0000000..9dd4c74 --- /dev/null +++ b/.github/workflows/commit.yaml @@ -0,0 +1,49 @@ +name: Update Chart.yaml + +on: + workflow_dispatch: + +jobs: + update-chart: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Modify Chart.yaml + run: | + echo "${{ github.sha }}" > commit.txt + + - name: Commit Changes Using GraphQL API + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api graphql -F query=' + mutation($input: CreateCommitOnBranchInput!) { + createCommitOnBranch(input: $input) { + commit { + url + } + } + }' \ + -F variables='{ + "input": { + "branch": { + "repositoryNameWithOwner": "${{ github.repository }}", + "branchName": "main" + }, + "expectedHeadOid": "${{ github.sha }}", + "message": { + "headline": "Update Chart.yaml" + }, + "fileChanges": { + "additions": [ + { + "path": "commit.txt", + "contents": "$(cat commit.txt | base64 -w 0)" + } + ], + "deletions": [] + } + } + }'