Skip to content
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
25 changes: 12 additions & 13 deletions .github/workflows/sync-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,25 @@ jobs:
git diff --cached --stat | tail -25
fi

- name: Import GPG signing key
if: steps.diff.outputs.changed == 'true'
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true

# A unique branch per run (date + run id) so every sync opens a brand-new
# PR and never reuses/updates a previous one.
- name: Commit and push
- name: Create sync branch
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "justinpolygon"
git config user.email "[email protected]"
BRANCH="bot/openapi-sync-$(date -u +'%Y-%m-%d')-${GITHUB_RUN_ID}"
echo "BRANCH=$BRANCH" >> "$GITHUB_ENV"
git checkout -B "$BRANCH"
git commit -S -m "Sync client-go with OpenAPI spec"
git push origin "$BRANCH"

- name: Commit and push
if: steps.diff.outputs.changed == 'true'
uses: iarekylew00t/verified-bot-commit@v2
with:
token: ${{ steps.app-token.outputs.token }}
message: "Sync client-go with OpenAPI spec"
ref: ${{ env.BRANCH }}
files: |
rest/
scripts/

- name: Open PR
if: steps.diff.outputs.changed == 'true'
Expand Down
4 changes: 1 addition & 3 deletions scripts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ what's committed it:

- mints a short-lived **GitHub App** token (the default `GITHUB_TOKEN` can't open
PRs — org policy blocks it),
- makes a **GPG-signed** commit as the bot identity `justinpolygon`
(`[email protected]`),
- commits as the GitHub App's bot identity,
- pushes a **unique** branch `bot/openapi-sync-<date>-<run-id>` and opens a
brand-new `[bot]`-prefixed PR (never reusing an existing one, so author ≠
reviewer),
Expand All @@ -66,7 +65,6 @@ what's committed it:
| --- | --- | --- |
| Variable | `MASSIVE_CLIENT_LIBRARY_AUTOMATION_APP_ID` | GitHub App id (App must be installed on this repo) |
| Secret | `MASSIVE_CLIENT_LIBRARY_AUTOMATION_APP_PRIVATE_KEY` | GitHub App private key |
| Secret | `GPG_PRIVATE_KEY` | Signs the bot commit (shared with client-jvm / client-js) |
| Secret | `SLACK_CLIENT_LIBRARY_WEBHOOK` | Slack notification (shared; optional — skipped if unset) |

## Per-file reference
Expand Down
Loading