Skip to content

Commit 220bbe0

Browse files
committed
Add .github/composites/git-config
1 parent dd616b3 commit 220bbe0

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Git config
2+
3+
runs:
4+
using: 'composite'
5+
steps:
6+
7+
- name: "Update git config"
8+
shell: bash
9+
run: |
10+
git config user.name "${{ github.actor }}"
11+
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"

.github/workflows/DependabotPulls.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ jobs:
3737
swift: ${{ matrix.swift }}
3838
os: ${{ matrix.os }}
3939

40-
- name: "git config"
41-
run: |
42-
git config user.name "${{ github.token }}"
43-
git config user.email "${{ github.actor }}@users.noreply.github.com"
40+
- uses: ./.github/composites/git-config
4441

4542
- name: "Commit new sources"
4643
run: |

.github/workflows/Release.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v6
2323

24+
- uses: ./.github/composites/git-config
2425
- name: Remove submodule to improve Swift Package experience
2526
env:
2627
SUBMODULE_PATH: Submodule/github/rest-api-description
2728
run: |
2829
if [ -d "$SUBMODULE_PATH" ]; then
29-
#
30-
git config user.name "${GITHUB_ACTOR}"
31-
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
3230
#
3331
git checkout -B $RELEASE_BRANCH
3432
#
@@ -66,12 +64,10 @@ jobs:
6664
with:
6765
ref: ${{ env.RELEASE_BRANCH }}
6866
fetch-depth: 2
69-
67+
68+
- uses: ./.github/composites/git-config
7069
- name: Revert previous commit
7170
run: |
72-
#
73-
git config user.name "${GITHUB_ACTOR}"
74-
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
7571
#
7672
git revert --no-edit HEAD
7773
git push

.github/workflows/Test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ jobs:
2727
- uses: actions/checkout@v6
2828
with:
2929
submodules: true
30+
3031
- uses: ./.github/composites/setup
3132
with:
3233
swift: ${{ matrix.swift }}
3334
os: ${{ matrix.os }}
35+
36+
- uses: ./.github/composites/git-config
37+
3438
- name: "Test Scripts work on ${{ matrix.os }}"
3539
run: swift Scripts/SPIManifestBuilder.swift
3640
- name: "Test Swift Package"

0 commit comments

Comments
 (0)