Skip to content

Commit a688d88

Browse files
authored
Merge branch 'main' into direct-commit-includes
2 parents d6e46b0 + 4bd76ee commit a688d88

File tree

4 files changed

+98
-32
lines changed

4 files changed

+98
-32
lines changed

.github/workflows/changelog.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,24 @@ on:
44
types: [released]
55
workflow_dispatch:
66

7-
env:
8-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
9-
107
jobs:
118
changelog:
129
runs-on: ubuntu-latest
1310
steps:
14-
- name: 🔍 GH_TOKEN
15-
if: env.GH_TOKEN == ''
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
19-
2011
- name: 🤘 checkout
2112
uses: actions/checkout@v2
2213
with:
2314
fetch-depth: 0
2415
ref: main
25-
token: ${{ env.GH_TOKEN }}
2616

17+
- name: 🔍 defaults
18+
uses: ./.github/workflows/defaults
19+
env:
20+
GH_TOKEN_SECRET: ${{ secrets.GH_TOKEN }}
21+
BOT_NAME_SECRET: ${{ secrets.BOT_NAME }}
22+
BOT_EMAIL_SECRET: ${{ secrets.BOT_EMAIL }}
23+
BOT_AUTHOR_SECRET: ${{ secrets.BOT_AUTHOR }}
24+
2725
- name: ⚙ ruby
2826
uses: ruby/setup-ruby@v1
2927
with:
@@ -36,7 +34,7 @@ jobs:
3634
3735
- name: 🚀 changelog
3836
run: |
39-
git config --local user.name github-actions
40-
git config --local user.email github-actions@github.com
37+
git config --local user.name $BOT_NAME
38+
git config --local user.email $BOT_EMAIL
4139
git add changelog.md
4240
(git commit -m "🖉 Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: test
2+
description: runs dotnet tests with retry
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: 🔍 GH_TOKEN
7+
if: env.GH_TOKEN == ''
8+
shell: bash
9+
run: |
10+
if [ -z "$GH_TOKEN_SECRET" ]
11+
then
12+
echo "Using default GITHUB_TOKEN"
13+
echo "GH_TOKEN=$GITHUB_TOKEN" >> $GITHUB_ENV
14+
else
15+
echo "Using custom GH_TOKEN"
16+
echo "GH_TOKEN=$GH_TOKEN_SECRET" >> $GITHUB_ENV
17+
fi
18+
19+
- name: 🔍 BOT
20+
shell: bash
21+
run: |
22+
if [ -z "$BOT_NAME"]
23+
then
24+
if [ -z "$BOT_NAME_SECRET" ]
25+
then
26+
echo "Using default GITHUB_ACTOR as BOT_NAME"
27+
BOT_NAME="$GITHUB_ACTOR"
28+
else
29+
echo "Using custom BOT_NAME"
30+
BOT_NAME=$BOT_NAME_SECRET
31+
fi
32+
echo "BOT_NAME=$BOT_NAME" >> $GITHUB_ENV
33+
fi
34+
35+
if [ -z "$BOT_EMAIL"]
36+
then
37+
if [ -z "$BOT_EMAIL_SECRET" ]
38+
then
39+
echo "Using default GITHUB_EMAIL as BOT_EMAIL"
40+
BOT_EMAIL="$GITHUB_ACTOR@users.noreply.github.com"
41+
else
42+
echo "Using custom BOT_EMAIL"
43+
BOT_EMAIL="$BOT_EMAIL_SECRET"
44+
fi
45+
echo "BOT_EMAIL=$BOT_EMAIL" >> $GITHUB_ENV
46+
fi
47+
48+
if [ -z "$BOT_AUTHOR"]
49+
then
50+
if [ -z "$BOT_AUTHOR_SECRET" ]
51+
then
52+
echo "Using default BOT_NAME <BOT_EMAIL> as BOT_AUTHOR"
53+
BOT_AUTHOR="$BOT_NAME <$BOT_EMAIL>"
54+
else
55+
echo "Using custom BOT_AUTHOR"
56+
BOT_AUTHOR="$BOT_AUTHOR_SECRET"
57+
fi
58+
echo "BOT_AUTHOR=$BOT_AUTHOR" >> $GITHUB_ENV
59+
fi

.github/workflows/dotnet-file.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,24 @@ on:
99

1010
env:
1111
DOTNET_NOLOGO: true
12-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
1312

1413
jobs:
1514
sync:
1615
runs-on: windows-latest
1716
steps:
18-
- name: 🔍 GH_TOKEN
19-
if: env.GH_TOKEN == ''
20-
shell: bash
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
17+
- name: 🤘 checkout
18+
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
ref: main
22+
23+
- name: 🔍 defaults
24+
uses: ./.github/workflows/defaults
25+
env:
26+
GH_TOKEN_SECRET: ${{ secrets.GH_TOKEN }}
27+
BOT_NAME_SECRET: ${{ secrets.BOT_NAME }}
28+
BOT_EMAIL_SECRET: ${{ secrets.BOT_EMAIL }}
29+
BOT_AUTHOR_SECRET: ${{ secrets.BOT_AUTHOR }}
2430

2531
- name: ⌛ rate
2632
shell: pwsh
@@ -38,13 +44,6 @@ jobs:
3844
echo "Rate limit has reset to $($rate.remaining) requests"
3945
}
4046
41-
- name: 🤘 checkout
42-
uses: actions/checkout@v2
43-
with:
44-
fetch-depth: 0
45-
ref: main
46-
token: ${{ env.GH_TOKEN }}
47-
4847
- name: 🔄 sync
4948
shell: pwsh
5049
run: |
@@ -70,9 +69,11 @@ jobs:
7069
branch: dotnet-file-sync
7170
delete-branch: true
7271
labels: dependencies
72+
author: ${{ env.BOT_AUTHOR }}
73+
committer: ${{ env.BOT_AUTHOR }}
7374
commit-message: ⬆️ Bump files with dotnet-file sync
7475

7576
${{ env.CHANGES }}
76-
title: "Bump files with dotnet-file sync"
77+
title: "⬆️ Bump files with dotnet-file sync"
7778
body: ${{ env.CHANGES }}
78-
token: ${{ env.GH_TOKEN }}
79+
token: ${{ env.GH_TOKEN }}

.github/workflows/includes.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: +M▼ includes
1+
name: +Mᐁ includes
22
on:
33
workflow_dispatch:
44
push:
@@ -23,13 +23,21 @@ jobs:
2323
ref: main
2424
token: ${{ env.BOT_TOKEN }}
2525

26-
- name: +M▼ includes
26+
- name: 🔍 defaults
27+
uses: ./.github/workflows/defaults
28+
env:
29+
GH_TOKEN_SECRET: ${{ secrets.GH_TOKEN }}
30+
BOT_NAME_SECRET: ${{ secrets.BOT_NAME }}
31+
BOT_EMAIL_SECRET: ${{ secrets.BOT_EMAIL }}
32+
BOT_AUTHOR_SECRET: ${{ secrets.BOT_AUTHOR }}
33+
34+
- name: +Mᐁ includes
2735
uses: devlooped/actions-include@v4
2836

2937
- name: ✍ commit
3038
run: |
3139
git config --local user.name ${BOT_NAME}
3240
git config --local user.email ${BOT_EMAIL}
3341
git add .
34-
git commit -m "+M▼ includes" || exit 0
35-
git push
42+
git commit -m "+Mᐁ includes" || exit 0
43+
git push

0 commit comments

Comments
 (0)