Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: GitHub api field value type #35

Merged
merged 4 commits into from
Feb 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ Note: GITHUB_TOKEN does not have the necessary scopes to access projects (beta).
You must create a token with ***org:write*** scope and save it as a secret in your repository or organization.
For more information, see [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).

> :warning: The GitHub API change of 2022-02-23 results in an error message requiring an upgrade to a new version.
>
> What is the problem?
>
> As of 2022-02-23 , the GitHub API requires that the value of a single select/iteration field be a string instead of an ID!
>
> This causes the automation to throw an error message.
>
> https://github.blog/changelog/2022-02-23-the-new-github-issues-february-23rd-update/

## Project board

Since the issues and pull requests from this repository are also managed by this automation, you can take an example from the public project board to see what it looks like.
Expand Down
4 changes: 2 additions & 2 deletions gh_api_global.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getItemID() {
# 1: project id
# 2: project item id
# 3: field id
# 4: field option id
# 4: field option string (id as string)
function updateSingleSelectField() {
local project_id=$1
local item_id=$2
Expand All @@ -33,7 +33,7 @@ function updateSingleSelectField() {
$project: ID!
$item: ID!
$fieldid: ID!
$fieldOption: ID!
$fieldOption: String!
) {
updateProjectNextItemField(
input: {
Expand Down
10 changes: 3 additions & 7 deletions test_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@ $ENTRYPOINT_SCRIPT "$ENTRYPOINT_MODE" "$ENTRYPOINT_TYPE" "$ORG_OR_USER_NAME" "$P
date=$(date -d "+10 days" --rfc-3339=ns | sed 's/ /T/; s/\(\....\).*\([+-]\)/\1\2/g')
uuid1=$(uuidgen)
uuid2=$(uuidgen)
random_number=$(( $RANDOM % 2500 ))
custom_fields="[
{
\"name\": \"Priority\",
\"type\": \"text\",
\"value\": \"$uuid1\"
},
{
\"name\": \"Severity\",
\"type\": \"text\",
\"value\": \"$uuid2\"
},
{
\"name\": \"Number\",
\"type\": \"number\",
\"value\": \"1000000\",
\"value\": \"$random_number\"
},
{
\"name\": \"Date\",
Expand All @@ -49,7 +45,7 @@ custom_fields="[
{
\"name\": \"Iteration\",
\"type\": \"iteration\",
\"value\": \"Iteration 1\"
\"value\": \"Iteration 3\"
}
]"

Expand Down