-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically update protos #1027
base: master
Are you sure you want to change the base?
Changes from 7 commits
19d07ba
10af2ea
c0f49cd
356464f
a73b51e
2d5df93
a6d8986
79ea12c
8c60dc5
1f69225
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Update Protobufs | ||
on: | ||
push: | ||
branches: | ||
- yaakov/auto-protos # temporary trigger during development | ||
#schedule: | ||
#- cron: '0 17 * * SUN' | ||
|
||
jobs: | ||
update-protobufs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Fetch latest protobufs | ||
run: | | ||
yaakov-h marked this conversation as resolved.
Show resolved
Hide resolved
|
||
git config pull.ff only | ||
git submodule update --init --recursive | ||
( cd Resources/Protobufs && git pull origin master ) | ||
|
||
- name: Regenerate C# Code | ||
shell: pwsh | ||
run: | | ||
Resources/ProtobufGen/generate-all.ps1 | ||
|
||
# TODO: We need a new GitHub Machine Account (or maybe an existing one?) to generate a PAT that we can use as the token here | ||
# otherwise, our new changes will not trigger further Actions (on:push or on:pull_request, i.e. CI/CD builds). | ||
#- name: Create Pull Request | ||
# uses: peter-evans/[email protected] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't played with GH actions much - but what does security look like for a third-party action that is fed a PAT? Does pinning the action to a specific version guarantee it to be immutable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure that we have a machine account around (I definitely don't have one), so we'll want to create one - and share creds among the core team? The PAT will definitely need to be limited in scope to just creating PRs, if that's doable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can provide a full commit hash as the version afaik. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be that pull requests created when run by cron shouldn't require a PAT.
FWIW, adding |
||
# with: | ||
# #token: ${{ secrets.PAT }} | ||
# commit-message: Update protobufs | ||
# title: Update protobufs | ||
# body: | | ||
# - Update protobufs | ||
# branch: auto/protobufs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Configure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It should update the existing branch, which is good, there's no reason to spam branches/prs for each update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just dropping a comment for this to be uncommented once we're ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can also add
workflow_dispatch:
to be able to manually trigger this from UI.