From c4263a3d587605572fa45539274ae6d14a26b48c Mon Sep 17 00:00:00 2001 From: sealldeveloper <120470330+sealldeveloper@users.noreply.github.com> Date: Thu, 17 Oct 2024 20:31:12 +1100 Subject: [PATCH] fix typos and make the pull system work, add deliberately bad mapping for 255 to test workflow --- .github/workflows/autocheckcombos.yml | 23 ++++++++++++++--------- data/originalMappings.csv | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/autocheckcombos.yml b/.github/workflows/autocheckcombos.yml index d9aa328..58e4ee4 100644 --- a/.github/workflows/autocheckcombos.yml +++ b/.github/workflows/autocheckcombos.yml @@ -24,7 +24,7 @@ jobs: python-version: '3.9' # Specify your required Python version - name: Install dependencies - id: dependecies + id: dependencies run: | sudo apt-get install -y expect @@ -33,13 +33,16 @@ jobs: run: | unbuffer python find-num.py --range 255 | tee result.txt - - name: Check for new candidates and existing combinations - id: check_candidates + - name: Update originalMappings.csv + id: update_mappings run: | NEW_CANDIDATES_FOUND=false while IFS= read -r line; do if [[ "$line" =~ ^[0-9] ]]; then NEW_CANDIDATES_FOUND=true + ASCII_NUM=$(echo $line | cut -d',' -f1) + NEW_PYTHON_CODE=$(echo $line | cut -d',' -f2) + sed -i "s/^$ASCII_NUM,.*/$ASCII_NUM,$NEW_PYTHON_CODE/" data/originalMappings.csv fi done < result.txt @@ -49,18 +52,20 @@ jobs: echo "new_candidates=false" >> $GITHUB_OUTPUT fi - - name: Create Pull Request for New Candidates - if: steps.check_candidates.outputs.new_candidates == 'true' + - name: Create Pull Request for Updated Mappings + if: steps.update_mappings.outputs.new_candidates == 'true' uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} - title: "Add new shorter candidates" - body: "This PR adds new shorter candidates found by find-num.py." + title: "Update originalMappings.csv with shorter candidates" + body: "This PR updates data/originalMappings.csv with new shorter candidates found by find-num.py." base: main - branch: add-shorter-candidates-branch + branch: update-original-mappings + commit-message: "Update originalMappings.csv with shorter candidates" + delete-branch: true - name: Upload Existing Combinations Log - if: steps.check_candidates.outputs.new_candidates == 'false' + if: steps.update_mappings.outputs.new_candidates == 'false' uses: actions/upload-artifact@v3 with: name: results-log diff --git a/data/originalMappings.csv b/data/originalMappings.csv index 8580ae8..7f8254b 100644 --- a/data/originalMappings.csv +++ b/data/originalMappings.csv @@ -253,4 +253,4 @@ 252,chr(ord(min(str(()in())))+len(str(credits)+str(hash))) 253,chr(sum(range(len(str(bin))))) 254,chr((not())+sum(range(len(str(bin))))) -255,chr((not())+(not())+sum(range(len(str(bin))))) \ No newline at end of file +255,chr(ord(min(str(()in())))+len(str(credits)+str(hash))+(not())+(not())+(not())) \ No newline at end of file