Skip to content

Commit 143e2a8

Browse files
committed
ci(workflows): Standardize Git operations with custom actions
1 parent 74f0b76 commit 143e2a8

3 files changed

Lines changed: 18 additions & 40 deletions

File tree

.github/workflows/mkdocs.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Markdown Update
22
on:
3+
workflow_dispatch:
34
push:
45
paths:
56
- 'docs/**'
@@ -24,19 +25,15 @@ defaults:
2425

2526
jobs:
2627
docs:
27-
permissions:
28-
contents: write
2928
name: Update Markdown (embedded snippets)
3029
runs-on: ubuntu-24.04
3130
steps:
3231
-
3332
name: Checkout
34-
uses: actions/checkout@v6
35-
if: github.event_name == 'push'
36-
-
37-
name: Checkout
38-
uses: actions/checkout@v6
39-
if: github.event_name == 'pull_request'
33+
uses: gittools/cicd/checkout@v1
34+
with:
35+
op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
36+
fetch-depth: 1
4037
-
4138
name: Setup .NET SDK
4239
uses: actions/setup-dotnet@v5
@@ -48,17 +45,9 @@ jobs:
4845
dotnet tool install --global MarkdownSnippets.Tool
4946
mdsnippets --write-header false
5047
working-directory: ${{ github.workspace }}/docs/input
48+
5149
-
52-
name: Check for changes
53-
id: status
54-
run: |
55-
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
56-
-
57-
name: Push changes
58-
run: |
59-
git add --verbose .
60-
git config user.name 'gittools-bot'
61-
git config user.email 'gittoolsbot@outlook.com'
62-
git commit -m 'Docs changes' --allow-empty
63-
git push --force
64-
if: steps.status.outputs.has_changes == '1' && github.event_name == 'push'
50+
name: Commit and push markdown docs changes
51+
uses: gittools/cicd/git-commit-push@v1
52+
with:
53+
message: "include markdown docs changes"

.github/workflows/public-api.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,20 @@ defaults:
1111

1212
jobs:
1313
public-api:
14-
permissions:
15-
contents: write
1614
name: Mark public API as shipped
1715
runs-on: ubuntu-24.04
1816
steps:
1917
-
2018
name: Checkout
21-
uses: actions/checkout@v6
22-
if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch'
19+
uses: gittools/cicd/checkout@v1
20+
with:
21+
op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
22+
fetch-depth: 0
2323
-
2424
name: Mark public API as shipped
2525
run: ./src/mark-shipped.ps1
2626
-
27-
name: Check for changes
28-
id: status
29-
run: |
30-
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
31-
-
32-
name: Push changes
33-
run: |
34-
git add --verbose .
35-
git config user.name 'gittools-bot'
36-
git config user.email 'gittoolsbot@outlook.com'
37-
git commit -m 'Mark public API as shipped' --allow-empty
38-
git push --force
39-
if: steps.status.outputs.has_changes == '1'
27+
name: Commit and push changes
28+
uses: gittools/cicd/git-commit-push@v1
29+
with:
30+
message: "include public API changes"

.github/workflows/winget.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ permissions:
1414

1515
jobs:
1616
homebrew:
17-
permissions:
18-
contents: none
1917
name: Bump winget manifest
2018
runs-on: ubuntu-24.04
2119
steps:

0 commit comments

Comments
 (0)