github / github/vscode-github-actions

False positive missing-required-inputs for app_location when action: "close" in Azure Static Web Apps deploy

未关闭
#609 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
TypeScript
星标
660
派生
213
PR 合并指标
30 天内没有已合并 PR

描述

## Bug report

**Describe the bug**

The extension reports a `missing-required-inputs` error for `app_location` on the
`close_pull_request_job` pattern recommended by Azure Static Web Apps. The workflow
runs successfully in CI — the error is a false positive.

`Azure/static-web-apps-deploy@v1` marks `app_location` as `required: true` in its
`action.yml`, but the field is only meaningful when `action: "upload"`. When
`action: "close"`, the action ignores `app_location` entirely and completes without it.

**Steps to reproduce**

Use the standard close-PR job that Azure's own onboarding wizard generates, with GitHub Actions extension installed:

```yaml
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
submodules: true
lfs: false
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
app_location: "/"
#api_location: "api"
output_location: "dist"

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: "close"

贡献指南

打开贡献指南

调研方向

首先定位读取 Azure/static-web-apps-deploy@v1 的 action.yml 的 GitHub Actions 输入验证,并复现此处所示的 close_pull_request_job 工作流。当 action: "close" 不再报告缺少 app_location,同时 upload 模式仍能验证其必需输入时,工作就完成了。

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions, typescript
领域
developer-experience
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
58/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。