@@ -23,23 +23,39 @@ jobs:
2323 outputs :
2424 dictionaries : ${{ steps.dictionaries.outputs.dictionaries }}
2525 steps :
26+ - name : checkout
27+ uses : actions/checkout@v4
28+ - name : prepare archive
29+ shell : bash
30+ env :
31+ check_spelling : ${{ inputs.check-spelling }}
32+ manifest : ${{ inputs.manifest }}
33+ run : |
34+ : Prepare archive
35+ archive=$(mktemp -d)/archive.zip
36+ echo "archive=$archive" >> $GITHUB_ENV
37+ perl -pi -e 's<CHECK_SPELLING><$ENV{check_spelling}>;s<VERSION><$ENV{manifest}>' check-spelling-stub.yml
38+ zip "$archive" check-spelling-stub.yml
2639 - name : checkout
2740 uses : actions/checkout@v4
2841 with :
2942 ref : ${{ inputs.branch }}
3043 - name : select dictionaries
3144 id : dictionaries
3245 shell : bash
46+ env :
47+ check_spelling : ${{ inputs.check-spelling }}
48+ manifest : ${{ inputs.manifest }}
3349 run : |
50+ : Select dictionaries
3451 action=$(mktemp)
35- curl -sL 'https://raw.githubusercontent.com/${{ inputs.check-spelling }} /check-spelling/${{ inputs. manifest }} /action.yml' > "$action"
52+ curl -sL 'https://raw.githubusercontent.com/$check_spelling /check-spelling/refs/heads/$ manifest/action.yml' > "$action"
3653 files=$(mktemp)
3754 (
3855 cd dictionaries
3956 perl -ne 'next unless s/^\s*cspell://;my $file=$_; chomp $file; print if -e $file' "$action"
4057 ) > "$files"
4158 echo "dictionaries=[$(perl -ne 'next unless s/^(\S+)\n/"$1",/;print' "$files"|perl -pe 's/,$//')]" >> "$GITHUB_OUTPUT"
42- archive=$(mktemp -d)/archive.zip
4359 (cd dictionaries; zip "$archive" $(cat $files))
4460 echo "archive=$archive" >> "$GITHUB_OUTPUT"
4561 - name : upload
6682 - name : setup check
6783 shell : bash
6884 run : |
85+ : Create sandbox
6986 mkdir -p .github/actions/spelling
7087 echo '\Q${{ matrix.dictionary }}\E$' > .github/actions/spelling/only.txt
7188 unzip /tmp/archive/*.zip "${{ matrix.dictionary }}"
7491 git config user.email "[email protected] " 7592 git add .
7693 git commit -m 'Prepare for check-spelling'
94+ : Create stub action
95+ mkdir -p ../actions/check-spelling
96+ unzip -p /tmp/archive/*.zip check-spelling-stub.yml > ../actions/check-spelling/action.yml
7797 - name : check-spelling
7898 id : spelling
79- uses : check-spelling/ check-spelling@prerelease
99+ uses : ./../actions/ check-spelling
80100 with :
81101 event_aliases : ' {"workflow_dispatch":"push"}'
82102 suppress_push_for_open_pull_request : 1
0 commit comments