feat: trust graphql API call rather than CircleCI injected vars

This commit is contained in:
Naramsim 2023-01-14 22:00:27 +01:00
parent ba99279d6a
commit 39b88987c3
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,5 @@
#!/bin/bash
# Executed when the master branch of PokeAPI/pokeapi gets updated
# Executed when the master/staging branch of PokeAPI/pokeapi gets updated
# Runs in CircleCI
# Generates new data using the latest changes of PokeAPI/pokeapi in order to open a Pull Request towards PokeAPI/api-data
@ -90,10 +90,10 @@ get_invokator_pr_number() {
commit_msg_regex="Merge pull request #([0-9]+) from PokeAPI/(.*)"
last_commit_message=$(git log --oneline --format=%B -n 1 HEAD | head -n 1)
invokator_pr_number_from_graphql="$(get_invokator_pr_number_from_graphql)"
if ! [ -z "$CIRCLE_PULL_REQUEST" ]; then
echo "${CIRCLE_PULL_REQUEST##*/}"
elif [ "$invokator_pr_number_from_graphql" != 'null' ]; then
if [ "$invokator_pr_number_from_graphql" != 'null' ]; then
echo "$invokator_pr_number_from_graphql"
elif [ -n "$CIRCLE_PULL_REQUEST" ]; then
echo "${CIRCLE_PULL_REQUEST##*/}"
elif [[ $last_commit_message =~ $commit_msg_regex ]]; then
echo "${BASH_REMATCH[1]}"
else

@ -1 +1 @@
Subproject commit a0e2c217b87f650a7ff258b437a028b5cd1aadf4
Subproject commit f301664fbbce6ccbe09f9561287e05653379f870