Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/create-release.yml
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
Comment on lines +15 to +27
Copy link

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 사용 및 라벨 매칭 방식 개선 필요

  • GitHub Actions의 ::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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 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
- name: Check for 'create' label
id: label-check
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
🧰 Tools
🪛 actionlint (1.7.7)

17-17: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: 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_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

🤖 Prompt for AI Agents
In .github/workflows/create-release.yml around lines 15 to 27, replace the
deprecated ::set-output usage and loose grep check: read the GitHub token from
env and use an Authorization: Bearer header, fetch labels, use jq to test for
exact equality to "create" (not substring), and write the result to
$GITHUB_OUTPUT (e.g. append "has_label=true" or "has_label=false" to that file)
instead of using ::set-output; ensure the curl uses the env-injected token
variable for clarity and security.


create_release:
needs: check-label
if: needs.check-label.outputs.has_label == 'true'
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

actions/checkout 버전 업데이트 필요 (@v2@v4)

actions/checkout@v2 는 최신 러너에서 비호환 문제가 있으며 보안/성능 측면에서도 구버전입니다. @v4로 올려주세요.

-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v2
- uses: actions/checkout@v4
🧰 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
.github/workflows/create-release.yml around line 34: the workflow is using
actions/checkout@v2 which is outdated; update the step to use
actions/checkout@v4 by changing the uses reference to @v4, verify any option
keys (e.g., fetch-depth or token) remain compatible with v4, run the workflow or
a linting action to ensure no breakages, and commit the change.

- name: Create XCFramework
uses: unsignedapps/swift-create-xcframework@v2
Loading