File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,41 @@ jobs:
189189 -F message='Update README.md with project metadata' \
190190 -F content="$(base64 -w 0 README.md)" \
191191 -F sha="$SHA"
192+
193+ - name : Update issue template config placeholders
194+ run : |
195+ # Update .github/ISSUE_TEMPLATE/config.yml placeholders
196+ CONFIG_FILE=".github/ISSUE_TEMPLATE/config.yml"
197+ if [ -f "$CONFIG_FILE" ]; then
198+ echo "Updating $CONFIG_FILE placeholders..."
199+ sed -i "s/{{repo_name}}/$REPO_NAME/g" $CONFIG_FILE
200+
201+ # Wait for the config.yml file to be available in the new repository
202+ CONFIG_SHA=""
203+ for i in {1..5}; do
204+ CONFIG_SHA=$(gh api repos/$OWNER/$REPO_NAME/contents/$CONFIG_FILE 2>/dev/null | jq -r '.sha')
205+ if [ "$CONFIG_SHA" != "null" ] && [ -n "$CONFIG_SHA" ]; then
206+ echo "Found $CONFIG_FILE sha: $CONFIG_SHA"
207+ break
208+ else
209+ echo "$CONFIG_FILE not yet available, retrying in 2s..."
210+ sleep 2
211+ fi
212+ done
213+
214+ if [ "$CONFIG_SHA" != "null" ] && [ -n "$CONFIG_SHA" ]; then
215+ gh api repos/$OWNER/$REPO_NAME/contents/$CONFIG_FILE \
216+ -X PUT \
217+ -F message="Update $CONFIG_FILE with project metadata" \
218+ -F content="$(base64 -w 0 $CONFIG_FILE)" \
219+ -F sha="$CONFIG_SHA"
220+ echo "Successfully updated $CONFIG_FILE"
221+ else
222+ echo "::warning::Could not find $CONFIG_FILE in the repository. Skipping update."
223+ fi
224+ else
225+ echo "::warning::$CONFIG_FILE not found in template. Skipping update."
226+ fi
192227
193228 - name : Set team permissions
194229 run : |
You can’t perform that action at this time.
0 commit comments