-
Notifications
You must be signed in to change notification settings - Fork 80
49 lines (41 loc) · 1.57 KB
/
Copy pathcopilot-setup-steps.yml
File metadata and controls
49 lines (41 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "Copilot Setup Steps"
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
timeout-minutes: 59
environment: copilot
# Least privilege; checkout needs contents:read.
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install Rust toolchain (stable)
uses: dtolnay/rust-toolchain@stable
# Strongly recommended for private git deps + auth in CI-like envs
- name: Configure Cargo to use git CLI
run: |
mkdir -p ~/.cargo
cat >> ~/.cargo/config.toml << 'EOF'
[net]
git-fetch-with-cli = true
EOF
# Provide non-interactive auth for *all* https://github.com/* git fetches
# using an environment secret in the `copilot` environment.
- name: Configure git auth for private GitHub deps (PAT)
run: |
test -n "${{ secrets.DUROXIDE_PG_OPT_TOKEN }}"
git config --global --add url."https://x-access-token:${{ secrets.DUROXIDE_PG_OPT_TOKEN }}@github.com/".insteadOf "https://github.com/"
git config --global --add url."https://x-access-token:${{ secrets.DUROXIDE_PG_OPT_TOKEN }}@github.com/".insteadOf "https://api.github.com/"
# Warm the Cargo git/db caches so later `cargo update/test` is fast and reliable.
- name: Prefetch Rust dependencies (including private git deps)
run: |
cargo fetch