-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Move_issue_to_WitcherTPRG.yml
- Loading branch information
1 parent
7b6e6a8
commit 3ec5b36
Showing
1 changed file
with
7 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,24 @@ | ||
name: Move issue to WitcherTPRG project | ||
name: Get Backlog board ID | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
move_to_witcher_project: | ||
get_board_id: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Move issue to WitcherTPRG project | ||
- name: Get Backlog board ID | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
issue_number=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH") | ||
project_id=3 # Замените на реальный ID проекта "WitcherTPRG" | ||
board_name="Backlog" | ||
status_name="Todo" | ||
# Найти ID доски | ||
# Найти ID доски "Backlog" в проекте "WitcherTPRG" | ||
board_id=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/projects/$project_id/boards" | jq -r '.[] | select(.name == "'$board_name'") | .id') | ||
if [ -z "$board_id" ]; then | ||
echo "Board '$board_name' not found in project 'WitcherTPRG'." | ||
exit 1 | ||
else | ||
echo "Board ID for '$board_name' in project 'WitcherTPRG' is $board_id." | ||
fi | ||
# Найти ID колонки "Todo" в доске "Backlog" | ||
status_id=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/projects/columns/$board_id/cards" | jq -r '.[] | select(.note == "'$status_name'") | .id') | ||
if [ -z "$status_id" ]; then | ||
echo "Status '$status_name' not found in board '$board_name' in project 'WitcherTPRG'." | ||
exit 1 | ||
fi | ||
# Переместить задачу в колонку "Todo" | ||
curl -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.inertia-preview+json" -d "{\"content_id\": $issue_number}" "https://api.github.com/projects/columns/cards/$status_id/moves" |