-
Notifications
You must be signed in to change notification settings - Fork 419
chore: setup steps for copilot #4908
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
Changes from all commits
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,47 @@ | ||||||
name: "Copilot Setup Steps" | ||||||
|
||||||
# Allow testing of the setup steps from your repository's "Actions" tab. | ||||||
on: workflow_dispatch | ||||||
|
||||||
jobs: | ||||||
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. | ||||||
copilot-setup-steps: | ||||||
runs-on: ubuntu-latest | ||||||
|
||||||
# Set the permissions to the lowest permissions possible needed for your steps. | ||||||
# Copilot will be given its own token for its operations. | ||||||
permissions: | ||||||
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete. | ||||||
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. [optional]
Suggested change
|
||||||
contents: read | ||||||
|
||||||
# You can define any steps you want, and they will run before the agent starts. | ||||||
# If you do not check out your code, Copilot will do this for you. | ||||||
Comment on lines
+17
to
+18
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. [optional]
Suggested change
|
||||||
steps: | ||||||
- name: Checkout code | ||||||
uses: actions/checkout@v4 | ||||||
|
||||||
- name: Set up Go | ||||||
uses: actions/setup-go@v4 | ||||||
with: | ||||||
go-version-file: "go.mod" | ||||||
|
||||||
- name: Cache Go modules | ||||||
uses: actions/cache@v3 | ||||||
with: | ||||||
path: ~/go/pkg/mod | ||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||||||
restore-keys: | | ||||||
${{ runner.os }}-go- | ||||||
- name: Cache Go binaries | ||||||
uses: actions/cache@v3 | ||||||
with: | ||||||
path: ~/go/bin | ||||||
key: ${{ runner.os }}-go-binary-${{ hashFiles('**/go.sum') }} | ||||||
restore-keys: | | ||||||
${{ runner.os }}-go-binary- | ||||||
Comment on lines
+28
to
+41
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 wonder how much time this saves 🤔 I'll follow up and look at the actions tab after this merges b/c I don't see any invocations of this workflow yet. |
||||||
|
||||||
- name: Download Go dependencies | ||||||
run: go mod download | ||||||
|
||||||
- name: Verify Go setup | ||||||
run: go version |
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.
[uber nit] so that the name in the actions tab matches the file name so it's slightly easier to find