Skip to content

Commit

Permalink
test calling the pipeline multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
epassaro committed Feb 22, 2022
1 parent a399a80 commit 2aed82c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .azure-pipelines/update-refdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- bash: |
cd $(refdata.dir)
git remote add fork https://$(bot_token)@github.com/tardis-bot/tardis-refdata
git checkout -b pr-$(pr.number)
git checkout -B pr-$(pr.number)
displayName: 'Set up new branch'
- bash: |
Expand All @@ -49,11 +49,19 @@ jobs:
git config --local user.email "tardis.sn.bot@gmail.com"
git config --local user.name "tardis-bot"
git commit -m "Automated Update (PR $(pr.number))"
git push fork pr-$(pr.number)
git push fork pr-$(pr.number) -f
displayName: 'Commit new reference data'
- bash: |
cd $(refdata.dir)
echo "$(bot_token)" | gh auth login --with-token
gh pr create --repo tardis-sn/tardis-refdata --head tardis-bot:pr-$(pr.number) --title "Automated Update (PR $(pr.number))" --body "_Pull request automatically generated by [#$(pr.number)](https://github.com/tardis-sn/tardis/pull/$(pr.number))_"
STATE=$(gh pr list --repo tardis-sn/tardis-refdata -H pr-$(pr.number) --json state | jq -r .[].state)
if [[ -z "$STATE" ]]; then
echo "$(bot_token)" | gh auth login --with-token
gh pr create --repo tardis-sn/tardis-refdata --head tardis-bot:pr-$(pr.number) --title "Automated Update (PR $(pr.number))" --body "_Pull request automatically generated by [#$(pr.number)](https://github.com/tardis-sn/tardis/pull/$(pr.number))_"
else
exit 0
fi
displayName: 'Propose changes via pull request'

0 comments on commit 2aed82c

Please sign in to comment.