|
96 | 96 | # Make variable available for the next steps
|
97 | 97 | echo "PUZZLES_FILES_MODIFIED=$PUZZLES_FILES_MODIFIED" | tee -a "$GITHUB_ENV"
|
98 | 98 |
|
99 |
| - - name: Initialize Git variables for committing the changes |
100 |
| - if: env.PUZZLES_FILES_MODIFIED == 'yes' |
101 |
| - run: | |
102 |
| - AUTHOR_EMAIL="$(git show "$GITHUB_SHA" --no-patch --format=%aE)" |
103 |
| - AUTHOR_NAME="$(git show "$GITHUB_SHA" --no-patch --format=%aN)" |
104 |
| -
|
105 |
| - # Make variables available for the next steps |
106 |
| - ( |
107 |
| - echo "COMMIT_MSG=$(git show "$GITHUB_SHA" --no-patch --format=oneline --abbrev-commit)" |
108 |
| - echo "GIT_AUTHOR_NAME=GitHub Action on behalf of $AUTHOR_NAME" |
109 |
| - echo "GIT_COMMITTER_NAME=GitHub Action on behalf of $AUTHOR_NAME" |
110 |
| - echo "GIT_AUTHOR_EMAIL=$AUTHOR_EMAIL" |
111 |
| - echo "GIT_COMMITTER_EMAIL=$AUTHOR_EMAIL" |
112 |
| - ) | tee -a "$GITHUB_ENV" |
113 |
| -
|
114 |
| - - name: Commit the changes |
115 |
| - if: env.PUZZLES_FILES_MODIFIED == 'yes' |
116 |
| - env: |
117 |
| - NEW_COMMIT_MSG: "chore: processed ${{ env.COMMIT_MSG }}" |
118 |
| - working-directory: generated-todos |
119 |
| - run: | |
120 |
| - for FILE in pdd.xml todos-in-code.tsv; do |
121 |
| - mv -f ../$FILE . |
122 |
| - git add $FILE |
123 |
| - done |
124 |
| - git commit --all -m "$NEW_COMMIT_MSG" |
125 |
| - git push |
126 |
| -
|
127 | 99 | # It's possible that for some puzzles we haven't created issues yet
|
128 | 100 | # (because of network, rate limit or other kind of errors)
|
129 | 101 | - name: Check whether there are puzzles without related issues
|
@@ -165,6 +137,34 @@ jobs:
|
165 | 137 | # Make variable available for the next steps
|
166 | 138 | echo "PUZZLES_MAPPING_MODIFIED=$PUZZLES_MAPPING_MODIFIED" | tee -a "$GITHUB_ENV"
|
167 | 139 |
|
| 140 | + - name: Initialize Git variables for committing the changes |
| 141 | + if: env.PUZZLES_FILES_MODIFIED == 'yes' || env.PUZZLES_MAPPING_MODIFIED == 'yes' |
| 142 | + run: | |
| 143 | + AUTHOR_EMAIL="$(git show "$GITHUB_SHA" --no-patch --format=%aE)" |
| 144 | + AUTHOR_NAME="$(git show "$GITHUB_SHA" --no-patch --format=%aN)" |
| 145 | +
|
| 146 | + # Make variables available for the next steps |
| 147 | + ( |
| 148 | + echo "COMMIT_MSG=$(git show "$GITHUB_SHA" --no-patch --format=oneline --abbrev-commit)" |
| 149 | + echo "GIT_AUTHOR_NAME=GitHub Action on behalf of $AUTHOR_NAME" |
| 150 | + echo "GIT_COMMITTER_NAME=GitHub Action on behalf of $AUTHOR_NAME" |
| 151 | + echo "GIT_AUTHOR_EMAIL=$AUTHOR_EMAIL" |
| 152 | + echo "GIT_COMMITTER_EMAIL=$AUTHOR_EMAIL" |
| 153 | + ) | tee -a "$GITHUB_ENV" |
| 154 | +
|
| 155 | + - name: Commit the changes |
| 156 | + if: env.PUZZLES_FILES_MODIFIED == 'yes' |
| 157 | + env: |
| 158 | + NEW_COMMIT_MSG: "chore: processed ${{ env.COMMIT_MSG }}" |
| 159 | + working-directory: generated-todos |
| 160 | + run: | |
| 161 | + for FILE in pdd.xml todos-in-code.tsv; do |
| 162 | + mv -f ../$FILE . |
| 163 | + git add $FILE |
| 164 | + done |
| 165 | + git commit --all -m "$NEW_COMMIT_MSG" |
| 166 | + git push |
| 167 | +
|
168 | 168 | - name: Commit updated mapping
|
169 | 169 | if: env.PUZZLES_MAPPING_MODIFIED == 'yes'
|
170 | 170 | env:
|
|
0 commit comments