Skip to content

Commit da603df

Browse files
committed
add copilot setup
1 parent a318002 commit da603df

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches-ignore:
9+
- "copilot/**"
10+
- "dependabot/**"
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
pull_request:
14+
paths:
15+
- .github/workflows/copilot-setup-steps.yml
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
19+
cancel-in-progress: true
20+
21+
permissions: {}
22+
23+
jobs:
24+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
25+
copilot-setup-steps:
26+
name: Copilot Setup
27+
28+
runs-on: ubuntu-24.04
29+
30+
# Note: Do not try to run inside of a container yet. That causes all the setup scripts
31+
# by Copilot to fail since that triggers `sh` instead of `bash` for runs. Setting
32+
# defaults to bash does not fix it.
33+
34+
# Set the permissions to the lowest permissions possible needed for your steps.
35+
# Copilot will be given its own token for its operations.
36+
permissions:
37+
contents: read # Needed to checkout the repository
38+
39+
# You can define any steps you want, and they will run before the agent starts.
40+
# If you do not check out your code, Copilot will do this for you.
41+
steps:
42+
- name: Checkout Repository
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44+
with:
45+
persist-credentials: false
46+
- name: Setup NodeJS
47+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
48+
with:
49+
node-version-file: .node-version
50+
- name: Install actionlint
51+
run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
52+
- name: Install Zizmor
53+
env:
54+
TMP_DIR: ${{ runner.temp }}
55+
GH_TOKEN: ${{ github.token }}
56+
run: |
57+
set -euoC pipefail
58+
tarball="$TMP_DIR/zizmor.tar.gz"
59+
gh release download --repo zizmorcore/zizmor --pattern "zizmor-x86_64-unknown-linux-gnu.tar.gz" --output "$tarball"
60+
tar -xzf "$tarball" -C "$TMP_DIR"
61+
install -D "$TMP_DIR/zizmor" /usr/local/bin
62+
rm "$tarball" "$TMP_DIR/zizmor"

0 commit comments

Comments
 (0)