Repository navigation
Expand file tree
/
Copy pathworkflow.yml
More file actions
58 lines (50 loc) · 1.88 KB
/
Copy pathworkflow.yml
File metadata and controls
58 lines (50 loc) · 1.88 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
50
51
52
53
54
55
56
57
58
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Update Carter NuGet package references
on:
workflow_dispatch:
inputs:
includePrerelease:
type: boolean
default: false
description: Whether to include prerelease versions when searching for the latest version of the Carter NuGet package
commitAndPush:
type: boolean
default: false
description: Whether to commit and push the changes; Useful to test the process by looking at the resulting Git diff
jobs:
update-carter-package-references:
name: Update Carter NuGet package references
runs-on: ubuntu-latest
steps:
- name: Check out this repository
uses: actions/checkout@v3
with:
path: self
- name: Check out the CarterCommunity/.github repository
uses: actions/checkout@v3
with:
repository: CarterCommunity/.github
path: .github
- name: Update package references with latest version from NuGet
run: >-
.github/update-carter-package-references/run.ps1
-RootDirectory (Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'self')
-IncludePrerelease:$${{ github.event.inputs.includePrerelease }}
shell: pwsh
- name: Show Git diff
run: git diff
# https://github.com/marketplace/actions/checkout#push-a-commit-using-the-built-in-token
- if: github.event.inputs.commitAndPush
name: Commit changes and push if necessary
run: |
GIT_CHANGES=$(git status --porcelain)
if [ "$GIT_CHANGES" == "" ]; then
echo "No changes to commit"
else
echo "Committing and pushing changes"
git config user.name Jonathan Channon
git config user.email jonathan.channon@gmail.com
git add .
git commit -m "Update Carter NuGet package references"
git push
fi