-
Notifications
You must be signed in to change notification settings - Fork 3
add: create xcframework workflow #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||
| name: Create Release | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| types: [opened, labeled, synchronize] | ||||||
| branches: | ||||||
| - main | ||||||
|
|
||||||
| jobs: | ||||||
| check-label: | ||||||
| runs-on: ubuntu-latest | ||||||
| outputs: | ||||||
| has_label: ${{ steps.label-check.outputs.has_label }} | ||||||
| steps: | ||||||
| - name: Check for 'create' label | ||||||
| id: label-check | ||||||
| run: | | ||||||
| labels=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||||||
| "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \ | ||||||
| | jq -r '.[].name') | ||||||
| if echo "$labels" | grep -q 'create'; then | ||||||
| echo "Label 'create' found." | ||||||
| echo "::set-output name=has_label::true" | ||||||
| else | ||||||
| echo "Label 'create' not found." | ||||||
| echo "::set-output name=has_label::false" | ||||||
| fi | ||||||
|
|
||||||
| create_release: | ||||||
| needs: check-label | ||||||
| if: needs.check-label.outputs.has_label == 'true' | ||||||
| runs-on: macos-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v2 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actions/checkout 버전 업데이트 필요 (@v2 → @v4)
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)34-34: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||
| - name: Create XCFramework | ||||||
| uses: unsignedapps/swift-create-xcframework@v2 | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Deprecated set-output 사용 및 라벨 매칭 방식 개선 필요
::set-output은 더 이상 지원되지 않습니다.$GITHUB_OUTPUT파일에 쓰는 방식으로 교체하세요.grep -q 'create'는 부분 일치(예:recreate)에도 매칭됩니다.jq로 정확히"create"라벨 존재 여부를 판별하는 편이 안전합니다.Authorization: Bearer형태가 최신 권장 사항이며,${{ github.token }}를env로 주입해 사용하는 편이 간결합니다.아래 diff를 적용해 주세요.
- name: Check for 'create' label id: label-check - run: | - labels=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \ - | jq -r '.[].name') - if echo "$labels" | grep -q 'create'; then - echo "Label 'create' found." - echo "::set-output name=has_label::true" - else - echo "Label 'create' not found." - echo "::set-output name=has_label::false" - fi + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + resp="$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ + "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels")" + if echo "$resp" | jq -e '.[] | select(.name=="create")' > /dev/null; then + echo "Label 'create' found." + echo "has_label=true" >> "$GITHUB_OUTPUT" + else + echo "Label 'create' not found." + echo "has_label=false" >> "$GITHUB_OUTPUT" + fi📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.7)
17-17: workflow command "set-output" was deprecated. use
echo "{name}={value}" >> $GITHUB_OUTPUTinstead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions(deprecated-commands)
17-17: workflow command "set-output" was deprecated. use
echo "{name}={value}" >> $GITHUB_OUTPUTinstead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions(deprecated-commands)
🤖 Prompt for AI Agents