1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-27 13:49:10 +02:00

chore: new attempt

This commit is contained in:
Nuno Góis 2025-07-02 14:44:23 +01:00
parent c3f5f2a1bc
commit 83d071ea63
No known key found for this signature in database
GPG Key ID: 71ECC689F1091765

View File

@ -58,12 +58,13 @@ jobs:
ref: ${{ github.ref }} ref: ${{ github.ref }}
token: ${{ steps.app_token.outputs.token }} token: ${{ steps.app_token.outputs.token }}
fetch-depth: 0 fetch-depth: 0
persist-credentials: true persist-credentials: false
- name: Get issue - name: Get issue
uses: actions/github-script@v7 uses: actions/github-script@v7
id: get_issue id: get_issue
with: with:
github-token: ${{ steps.app_token.outputs.token }}
script: | script: |
console.log('Fetching issue #${{ inputs.issue-number }}') console.log('Fetching issue #${{ inputs.issue-number }}')
const { owner, repo } = context.repo; const { owner, repo } = context.repo;
@ -97,6 +98,7 @@ jobs:
env: env:
FLAG_NAME: ${{ steps.extract_flag.outputs.flag-name }} FLAG_NAME: ${{ steps.extract_flag.outputs.flag-name }}
with: with:
github-token: ${{ steps.app_token.outputs.token }}
result-encoding: string result-encoding: string
script: | script: |
const kebab = (s) => s const kebab = (s) => s
@ -138,7 +140,7 @@ jobs:
ref: ${{ steps.create_branch.outputs.result }} ref: ${{ steps.create_branch.outputs.result }}
token: ${{ steps.app_token.outputs.token }} token: ${{ steps.app_token.outputs.token }}
fetch-depth: 0 fetch-depth: 0
persist-credentials: true persist-credentials: false
- name: Configure Git - name: Configure Git
env: env:
@ -164,42 +166,39 @@ jobs:
echo "file_list=./file_list.bin" >> $GITHUB_OUTPUT echo "file_list=./file_list.bin" >> $GITHUB_OUTPUT
- name: Create prompt - name: Create prompt
uses: actions/github-script@v7
id: create_prompt id: create_prompt
with: run: |
result-encoding: string const body = `${{ fromJson(steps.get_issue.outputs.result).body }}`;
script: | return `Based on the issue description below, refactor the codebase to permanently apply the desired outcome for this feature flag (e.g. enable, keep variant, or discard), by removing all conditional checks and dead branches, preserving only the correct code path.
const body = `${{ fromJson(steps.get_issue.outputs.result).body }}`;
return `Based on the issue description below, refactor the codebase to permanently apply the desired outcome for this feature flag (e.g. enable, keep variant, or discard), by removing all conditional checks and dead branches, preserving only the correct code path.
After making the changes, provide a **Markdown summary** of what was changed, written for a developer reviewing the PR. Keep it clear, focused, and readable. Use the exact following format (including start & end separator lines, headings, bullets, emojis): After making the changes, provide a **Markdown summary** of what was changed, written for a developer reviewing the PR. Keep it clear, focused, and readable. Use the exact following format (including start & end separator lines, headings, bullets, emojis):
\`\`\`md \`\`\`md
=== AI Flag Cleanup Summary Start === === AI Flag Cleanup Summary Start ===
## 🧹 AI Flag Cleanup Summary ## 🧹 AI Flag Cleanup Summary
(Short summary of the changes made) (Short summary of the changes made)
(Include any details that you think are critical for the reviewer to know, if any, prefixing them with an appropriate emoji) (Include any details that you think are critical for the reviewer to know, if any, prefixing them with an appropriate emoji)
### 🚮 Removed ### 🚮 Removed
- **(Category)** - **(Category)**
- (list of removed items) - (list of removed items)
### 🛠 Kept ### 🛠 Kept
- **(Category)** - **(Category)**
- (list of kept items) - (list of kept items)
### 📝 Why ### 📝 Why
(Your reasoning for the changes made, including any relevant context or decisions that do not belong at the top of the summary.) (Your reasoning for the changes made, including any relevant context or decisions that do not belong at the top of the summary.)
=== AI Flag Cleanup Summary End === === AI Flag Cleanup Summary End ===
\`\`\` \`\`\`
--- Issue Description --- --- Issue Description ---
${body}`; ${body}`;
- name: Write prompt - name: Write prompt
run: | run: |
@ -243,6 +242,7 @@ jobs:
- name: Create Pull Request - name: Create Pull Request
uses: actions/github-script@v7 uses: actions/github-script@v7
with: with:
github-token: ${{ steps.app_token.outputs.token }}
result-encoding: string result-encoding: string
script: | script: |
const { owner, repo } = context.repo; const { owner, repo } = context.repo;