grafana / grafana/github-api-commit-action

GraphQL mutation fails with "fileDeletions[]" parameter error

Đang mở
#116 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
10
Fork
6
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Bug Report: GraphQL mutation fails with "fileDeletions[]" parameter error

### Description
The `grafana/github-api-commit-action@v1.0.0` action is failing when attempting to create a commit via GraphQL mutation. The error indicates that the `fileDeletions[]` field requires a value separated by an '=' sign.

### Expected Behavior
The action should successfully commit the staged files (`chart/README.md` and `chart/values.schema.json`) to the repository without errors.

### Actual Behavior
The action fails with the following error:
```
field "fileDeletions[]" requires a value separated by an '=' sign
Error: Process completed with exit code 1.
```

### Steps to Reproduce
1. Use the `grafana/github-api-commit-action@v1.0.0` action with the following configuration:
```yaml
- name: Commit changes
uses: grafana/github-api-commit-action@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: helm-docs automated action [skip ci]"
stage-all-files: true
create-branch-on-remote: false
success-if-no-changes: false
```

2. Have modified files in the repository (in this case, `chart/README.md` and a new file `chart/values.schema.json`)
3. Run the workflow

### Environment
- **Action Version**: v1.0.0
- **Runner**: GitHub Actions (ubuntu-latest)
- **Files being committed**:
- Modified: `chart/README.md`
- Added: `chart/values.schema.json`

### Error Logs
```
Run grafana/github-api-commit-action@v1.0.0
with:
token: ***
commit-message: docs: helm-docs automated action [skip ci]
stage-all-files: true
create-branch-on-remote: false
success-if-no-changes: false

Run # Get the remote URL (default "origin")
Remote URL: https://github.com//

Run git add .
git add .

Run status_output=$(git status --porcelain=v2 --branch --untracked-files=no)
status: M.
filepath: chart/README.md
status: A.
filepath: chart/values.schema.json

Run branch_oid=$(git ls-remote https://x-access-token:${GH_TOKEN}@github.com/${REPO}.git refs/heads/${BRANCH} | awk '{ print $1 }')

mutation( $repo: String!, $branch: String!, $commitMessage: String!, $expectedHeadOid: GitObjectID!, $fileAdditions: [FileAddition!]!, $fileDeletions: [FileDeletion!]!) { createCommitOnBranch( input: { branch: { repositoryNameWithOwner: $repo, branchName: $branch }, message: { headline: $commitMessage }, fileChanges: { additions: $fileAdditions, deletions: $fileDeletions }, expectedHeadOid: $expectedHeadOid } ){ commit { url, changedFilesIfAvailable } } }

field "fileDeletions[]" requires a value separated by an '=' sign
Error: Process completed with exit code 1.
```

### Analysis
The issue appears to be in the GraphQL mutation handling. The action is trying to pass a `fileDeletions` parameter to the `createCommitOnBranch` mutation, but the parameter seems to be malformed or empty, causing the GraphQL API to reject it.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.