Skip to content

Commit

Permalink
Replace hub with gh (#27)
Browse files Browse the repository at this point in the history
* ci: replace hub command with official GitHub CLI

Signed-off-by: Kengo TODA <[email protected]>

* ci: set GH_TOKEN env var

Signed-off-by: Kengo TODA <[email protected]>

* ci: set title and body of PR

Signed-off-by: Kengo TODA <[email protected]>

* ci: fix base branch

Signed-off-by: Kengo TODA <[email protected]>

* ci: search by head branch name

Signed-off-by: Kengo TODA <[email protected]>

---------

Signed-off-by: Kengo TODA <[email protected]>
  • Loading branch information
KengoTODA authored Dec 21, 2023
1 parent a9d7ace commit f8cf2c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check-for-new-master-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ jobs:
run: |
chmod +x ./scripts/check-for-new-master-data.sh
./scripts/check-for-new-master-data.sh
env:
GH_TOKEN: ${{ github.token }}
4 changes: 2 additions & 2 deletions scripts/check-for-new-master-data.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Exit if pull request already exists
if [ -n "$(hub pr list -h new-master-data-*)" ]; then
if [ -n "$(gh pr list --search head:new-master-data --state open)" ]; then
echo "Pull request already exists."
exit 0
fi
Expand Down Expand Up @@ -29,7 +29,7 @@ if [ ! -f "raw-master-data/s/$file_name" ]; then
git add .
git commit -m "Add new master data for $date"
git push origin "new-master-data-${date}"
hub pull-request -m "Add new master data for ${date}" -b master -h "new-master-data-${date}"
gh pr create --title "Add new master data for ${date}" --body "This PR was created automatically by GitHub Actions" -B main -H "new-master-data-${date}"
else
echo "No new master data available."
fi

0 comments on commit f8cf2c2

Please sign in to comment.