-
Notifications
You must be signed in to change notification settings - Fork 6
36 lines (28 loc) · 958 Bytes
/
ci-pipeline.yml
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
name: CI Pipeline
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Restore Dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run Tests
run: dotnet test --no-build --verbosity normal
- name: Get Remote File Content
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PATH_TO_FILE="src/commit_message_processor.cs" # specify the correct path
ENCODED_REF=$(echo "${GITHUB_REF}" | jq -s -R -r @uri)
curl -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/guibranco/dotnet-aicommitmessage/contents/${PATH_TO_FILE}?ref=${ENCODED_REF}" -o retrieved_file.cs