-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: close previous update PRs when a new one is generated
- Loading branch information
Showing
1 changed file
with
11 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -22,20 +22,30 @@ jobs: | |
go-version-file: go.mod | ||
- run: go install golang.org/x/tools/cmd/goimports@latest | ||
- uses: arduino/setup-task@v2 | ||
- run: wget -O openapi.json https://api.aiven.io/doc/openapi.json | ||
- run: task generate | ||
env: | ||
AIVEN_TOKEN: ${{ secrets.AIVEN_TOKEN }} | ||
AIVEN_PROJECT_NAME: ${{ secrets.AIVEN_PROJECT_NAME }} | ||
- id: date | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
- name: Close previous update PRs | ||
run: | | ||
prs=$(gh pr list --state open --json number,headRefName --jq '.[] | select(.headRefName | startswith("update/")) | .number') | ||
for pr in $prs; do | ||
gh pr close $pr --comment "Auto-closing pull request" --delete-branch | ||
done | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: peter-evans/create-pull-request@v7 | ||
with: | ||
author: GitHub <[email protected]> | ||
body: > | ||
automated changes by | ||
[update](https://github.com/aiven/go-client-codegen/blob/main/.github/workflows/update.yml) | ||
GitHub Actions workflow | ||
labels: | | ||
schema bump | ||
automated pr | ||
branch: update/${{ steps.date.outputs.date }} | ||
commit-message: "chore(update): bump openapi schema (${{ steps.date.outputs.date }})" | ||
title: "chore(update): bump openapi schema (${{ steps.date.outputs.date }})" |