Skip to content

Commit dc9eff5

Browse files
DataBoySuCopilot
andauthored
Removing unreachable code (#632)
* Workflows changed, CI partitioned * Changing CI run manner; brnach protection rules are always fulfilled to prevent CI stalling * Starting dual ci construction * breaking files down * dirty feature added * fix pr exclusions * fix ci naming * finalize dual ci * finalize dual ci * Update Dockerfile * finalize dual ci * finalize dual ci * finalizing workflows * finalizing scripts * Dual CI finished * Update Dockerfile (#6) * Update Dockerfile * Update ci_pr.yml * Experimenting with preview comment * Rename ci.yml to ci_PR.yml * Rename ci_PR.yml to ci_MASTER.yml * Update ci_pr.yml * Update CI_PR * temp * fixing issue when multiple comments exist * Restore error message on github token absence * temp * chore: upgrade PyGithub to 2.8.1 * artifact naming sanitization * max cap trial * max cap logs * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * added skip logic * Docker fix+alt max_cap * Docker file error invest * Docker file error invest * Docker file error invest * Docker fix * Syntax fix * pygithub modifications * reformat main script * main script reformatted * import fixed * import fixed * import fixed * remove unreachable code + restore safe docker config * Preview update * change comment process --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent bd7e17b commit dc9eff5

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/ci_PR.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,33 @@ jobs:
102102
INPUT_SHOW_LANGUAGE_PER_REPO: True
103103
INPUT_SHOW_UPDATED_DATE: True
104104

105-
run: python3 sources/main.py
105+
run: |
106+
mkdir -p preview
107+
python3 sources/main.py 2>&1 | tee preview/run.log
106108
107-
- name: Upsert preview comment 💬
109+
- name: Write preview markdown
108110
if: ${{ steps.changed.outputs.code == 'true' }}
111+
env:
112+
README_CONTENT: ${{ steps.make-stats.outputs.README_CONTENT }}
113+
run: |
114+
mkdir -p preview
115+
printf '%s\n' "$README_CONTENT" > preview/preview.md
116+
if [ ! -s preview/preview.md ]; then
117+
echo "README_CONTENT was empty." > preview/preview.md
118+
fi
119+
120+
- name: Upload preview artifact
121+
if: ${{ always() && steps.changed.outputs.code == 'true' }}
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: preview-stats
125+
path: |
126+
preview/preview.md
127+
preview/run.log
128+
if-no-files-found: ignore
129+
130+
- name: Upsert preview comment 💬
131+
if: ${{ steps.changed.outputs.code == 'true' && github.event.pull_request.head.repo.full_name == github.repository }}
109132
uses: actions/github-script@v7
110133
env:
111134
README_CONTENT: ${{ steps.make-stats.outputs.README_CONTENT }}
@@ -173,4 +196,4 @@ jobs:
173196
}
174197
} catch (e) {
175198
core.warning(`Unable to create/update PR comment: ${e.message || e}`)
176-
}
199+
}

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ inputs:
169169

170170
runs:
171171
using: 'docker'
172-
image: 'Dockerfile'
172+
image: 'docker://wakareadmestats/waka-readme-stats:master'
173173

174174
branding:
175175
icon: 'activity'

0 commit comments

Comments
 (0)