Cardinal-Cryptography / Cardinal-Cryptography/github-actions-validator

False positive error for action output

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

描述

On example on [this](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/5356212949/jobs/9715455989) run:
> EA811: action create-featurenet step 5 Called step with id 'get-argocd-featurnet-app-name' output 'name' does not exist
EA811: action create-featurenet step 6 Called step with id 'get-argocd-featurnet-app-name' output 'name' does not exist
EA811: action create-featurenet step 8 Called step with id 'get-argocd-featurnet-app-name' output 'name' does not exist
EA811: action delete-featurenet step 6 Called step with id 'get-argocd-featurnet-app-name' output 'name' does not exist
EA811: action delete-featurenet step 9 Called step with id 'get-argocd-featurnet-app-name' output 'name' does not exist
This error comes from the below code
```yaml
- name: Get argocd featurenet app name
id: get-argocd-featurnet-app-name
shell: bash
env:
# yamllint disable-line rule:line-length
APP_NAME: ${{ inputs.featurenet-name != '' && inputs.featurenet-name || format('{0}{1}', 'fe-', steps.get-ref-properties.outputs.branch-name-for-argo) }}
run: |
echo "name=${{ env.APP_NAME }}" >> $GITHUB_OUTPUT
```
Most likely problem is that validator sees GH expression and cannot parse `name` identifier correctly.

[The workaround is:](https://github.com/Cardinal-Cryptography/aleph-node/pull/1266/commits/bd1783cef6fbf842f6a43200eae61ade8c22791c)
```yaml
- name: Get argocd featurenet app name
id: get-argocd-featurnet-app-name
shell: bash
env:
# yamllint disable-line rule:line-length
APP_NAME: ${{ inputs.featurenet-name != '' && inputs.featurenet-name || format('{0}{1}', 'fe-', steps.get-ref-properties.outputs.branch-name-for-argo) }}
run: |
name_local=${{ env.APP_NAME }}
echo "name=$name_local" >> $GITHUB_OUTPUT
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先使用 issue 中显示的 GitHub Actions YAML 重现报告的 EA811 诊断,然后检查 validator 如何处理用于 action 输出赋值的表达式。完成标准是:所示 workflow 不再产生错误的 'output does not exist' 错误,同时仍能检测到确实缺失的输出。

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

评估

技术栈
github-actions, go
领域
ci-cd, devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

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